SlideShare ist ein Scribd-Unternehmen logo
1 von 80
MySQL Database Essentials Cherrie Ann B. Domingo, CCNA Software Engineer, Accenture President, PHP User Group Philippines (PHPUGPH) Acting Secretary/Treasurer, Philippine SQL Server Users Group (PHISSUG)
Objectives for the Session  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Historical Roots of Databases ,[object Object],[object Object],[object Object],[object Object]
Disadvantages of File Systems ,[object Object],[object Object],[object Object],[object Object],[object Object]
Database Management Systems vs. File Systems
Database Systems Terms ,[object Object],[object Object],[object Object]
Database Management System (DBMS) ,[object Object],[object Object],[object Object]
Functions of DBMS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Functions of DBMS ,[object Object],[object Object],[object Object],[object Object]
Advantages of DBMS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Advantages of DBMS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Disadvantages of DBMS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],Disadvantages of DBMS
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],SQL (Structured Query Language)
SQL (Structured Query Language) ,[object Object],[object Object],[object Object]
SQL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SQL ,[object Object],[object Object],[object Object]
Capabilities of SELECT Statement ,[object Object],[object Object],[object Object]
Capabilities of SELECT Statement Selection Projection Table 1 Table 2 Table 1 Table 1 Join
SELECT Syntax ,[object Object],[object Object],[object Object],[object Object]
Column Alias ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],*A multiple word heading can be specified by putting it in quotes
Arithmetic Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],SELECT ProductID, ProductName, UnitPrice * 10 FROM  Products
Operator Precedence ,[object Object],[object Object],Parentheses are used to force prioritized evaluation and to clarify statements SELECT ProductName, UnitPrice*UnitsInStock+12 FROM  Products
Defining a NULL value  ,[object Object],[object Object]
Null Values in Arithmetic Expressions ,[object Object]
Duplicate Rows ,[object Object],[object Object],[object Object],[object Object]
Displaying Table Structure ,[object Object],[object Object],[object Object],[object Object]
Limiting rows that are selected ,[object Object],[object Object],[object Object],[object Object],[object Object],SELECT employee_id, last_name, job_id, department_id FROM  employees WHERE  department_id = 90 ;
Character Strings and Dates ,[object Object],[object Object],[object Object],SELECT last_name, job_id, department_id FROM  employees WHERE  last_name = 'Whalen' ;
Comparison Condition Operator Meaning ,[object Object],Equal to ,[object Object],Greater than >= Greater than or equal to ,[object Object],Less than ,[object Object],Less than or equal to ,[object Object],Not equal to BETWEEN ...AND... Between two values (inclusive) IN(set) Match any of a list of values  LIKE Match a character pattern  IS NULL Is a null value
Using Comparison Conditions SELECT last_name, salary FROM  employees WHERE  salary <= 3000 ;
BETWEEN condition ,[object Object],SELECT last_name, salary FROM  employees WHERE  salary BETWEEN 2500 AND 3500 ; Lower limit Upper limit
IN condition ,[object Object],SELECT employee_id, last_name, salary, manager_id FROM  employees WHERE  manager_id IN (100, 101, 201) ;
LIKE condition ,[object Object],[object Object],[object Object],[object Object],SELECT first_name FROM  employees WHERE first_name LIKE 'S%' ;
LIKE condition ,[object Object],[object Object],SELECT last_name FROM  employees WHERE  last_name LIKE '_o%' ;
NULL Conditions ,[object Object],SELECT last_name, manager_id FROM  employees WHERE  manager_id IS NULL ;
LOGICAL Conditions Operator Meaning ,[object Object],Returns  TRUE  if  both  component conditions are true ,[object Object],Returns  TRUE  if  either  component condition is true NOT Returns  TRUE  if the following condition is false
Sorting using ORDER BY ,[object Object],[object Object],[object Object],[object Object]
Obtaining Data from Multiple Tables EMPLOYEES   DEPARTMENTS  … …
Types of Joins ,[object Object],[object Object],[object Object],[object Object]
JOIN ,[object Object],Foreign key Primary key EMPLOYEES   DEPARTMENTS  … …
Qualifying Ambiguous Column Names ,[object Object],[object Object],[object Object]
Using Table Aliases ,[object Object],[object Object]
Retrieving Records with the  ON  Clause SELECT e.employee_id, e.last_name, e.department_id,  d.department_id, d.location_id FROM  employees e JOIN departments d ON  (e.department_id = d.department_id);
Self-Joins Using the  ON  Clause MANAGER_ID  in the  WORKER  table is equal to  EMPLOYEE_ID  in the  MANAGER  table. EMPLOYEES (WORKER) EMPLOYEES (MANAGER) …
Self-Joins Using the  ON  Clause SELECT e.last_name emp, m.last_name mgr FROM  employees e JOIN employees m ON  (e.manager_id = m.employee_id); …
Creating Three-Way Joins with the  ON  Clause SELECT employee_id, city, department_name FROM  employees e  JOIN  departments d ON  d.department_id = e.department_id  JOIN  locations l ON  d.location_id = l.location_id;
Inner JOIN ,[object Object]
Outer JOIN ,[object Object],[object Object],DEPARTMENTS EMPLOYEES There are no employees in department 190.  …
INNER Versus OUTER Joins ,[object Object],[object Object],[object Object]
LEFT OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM  employees e LEFT OUTER JOIN departments d ON  (e.department_id = d.department_id) ; …
RIGHT OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM  employees e RIGHT OUTER JOIN departments d ON  (e.department_id = d.department_id) ; …
FULL OUTER JOIN SELECT e.last_name, d.department_id, d.department_name FROM  employees e FULL OUTER JOIN departments d ON  (e.department_id = d.department_id) ; …
Cartesian Products ,[object Object],[object Object],[object Object],[object Object],[object Object]
Generating a Cartesian Product Cartesian product:  20 x 8 = 160 rows EMPLOYEES   (20 rows) DEPARTMENTS   (8 rows) … …
Creating CROSS JOIN ,[object Object],[object Object],SELECT last_name, department_name FROM  employees CROSS JOIN departments ; …
Adding a New Row to a Table DEPARTMENTS  New  row Insert new row into the DEPARTMENTS   table
INSERT statement ,[object Object],[object Object],INSERT INTO table  [( column  [ , column... ])] VALUES (value  [ , value... ]);
Inserting New Rows ,[object Object],[object Object],[object Object],[object Object],INSERT INTO departments(department_id,  department_name, manager_id, location_id) VALUES (70, 'Public Relations', 100, 1700); 1 row created.
UPDATE  Statement Syntax ,[object Object],[object Object],UPDATE table SET column  =  value  [,  column  =  value, ... ] [WHERE  condition ];
Updating Rows in a Table ,[object Object],[object Object],UPDATE employees SET  department_id = 70 WHERE  employee_id = 113; 1 row updated. UPDATE  copy_emp SET  department_id = 110; 22 rows updated.
Removing a Row from a Table  Delete a row from the  DEPARTMENTS  table: DEPARTMENTS
DELETE Statement ,[object Object],DELETE [FROM]   table [WHERE   condition ];
Deleting Rows from a Table ,[object Object],[object Object],DELETE FROM departments WHERE  department_name = 'Finance'; 1 row deleted. DELETE FROM  copy_emp; 22 rows deleted.
TRUNCATE Statement ,[object Object],[object Object],[object Object],[object Object],TRUNCATE TABLE  table_name ; TRUNCATE TABLE copy_emp;
DROP Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],DROP TABLE dept80; Table dropped.
Database Transactions ,[object Object],[object Object],[object Object],[object Object]
Database Transactions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Advantages of  COMMIT  and  ROLLBACK  Statements ,[object Object],[object Object],[object Object],[object Object]
Controlling Transactions DELETE INSERT UPDATE INSERT COMMIT Time Transaction ROLLBACK
State of the Data Before  COMMIT  or  ROLLBACK ,[object Object],[object Object],[object Object],[object Object]
State of the Data After  COMMIT ,[object Object],[object Object],[object Object],[object Object]
Committing Data ,[object Object],[object Object],DELETE FROM employees WHERE  employee_id = 99999; 1 row deleted. INSERT INTO departments  VALUES (290, 'Corporate Tax', NULL, 1700); 1 row created. COMMIT; Commit complete.
State of the Data After  ROLLBACK ,[object Object],[object Object],[object Object],[object Object]
State of the Data After  ROLLBACK DELETE FROM test; 25,000 rows deleted. ROLLBACK; Rollback complete. DELETE FROM test WHERE  id = 100; 1 row deleted. SELECT * FROM  test WHERE  id = 100; No rows selected. COMMIT; Commit complete.
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Function Description INSERT Adds a new row to the table UPDATE Modifies existing rows in the table DELETE Removes existing rows from the table COMMIT Makes all pending changes permanent ROLLBACK Discards all pending data changes
Be a PHPUGPH’er! ^__^ It’s totally FREE!  Register now at http://www.phpugph.com
Contact Me ^__^ Cherrie Ann B. Domingo, CCNA http://www.plurk.com/chean http://www.twitter.com/betelguese blue_cherie29 cherrie.ann.domingo cherrie.ann.domingo cherrie.ann.domingo [email_address] [email_address] http://www.cherrieanndomingo.com +63917.865.2412 (Globe) (632) 975.6976

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Sql server T-sql basics ppt-3
Sql server T-sql basics  ppt-3Sql server T-sql basics  ppt-3
Sql server T-sql basics ppt-3
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
 
Introduction to mysql part 1
Introduction to mysql part 1Introduction to mysql part 1
Introduction to mysql part 1
 
Create table
Create tableCreate table
Create table
 
intro for sql
intro for sql intro for sql
intro for sql
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st sessionIntro to T-SQL - 1st session
Intro to T-SQL - 1st session
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql – Structured Query Language
Sql – Structured Query LanguageSql – Structured Query Language
Sql – Structured Query Language
 
Air Line Management System | DBMS project
Air Line Management System | DBMS projectAir Line Management System | DBMS project
Air Line Management System | DBMS project
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Database queries
Database queriesDatabase queries
Database queries
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 

Andere mochten auch

Introduction to encryption
Introduction to encryptionIntroduction to encryption
Introduction to encryptionfaffyman
 
Mc leod9e ch06 database management systems
Mc leod9e ch06 database management systemsMc leod9e ch06 database management systems
Mc leod9e ch06 database management systemssellyhood
 
DATABASE Fp304 chapter 1
DATABASE Fp304   chapter 1DATABASE Fp304   chapter 1
DATABASE Fp304 chapter 1Radio Deejay
 
The State of Artificial Intelligence and What It Means for the Philippines
The State of Artificial Intelligence and What It Means for the PhilippinesThe State of Artificial Intelligence and What It Means for the Philippines
The State of Artificial Intelligence and What It Means for the PhilippinesThinking Machines
 
Comparing Research Designs
Comparing Research DesignsComparing Research Designs
Comparing Research DesignsPat Barlow
 
Database Management system
Database Management systemDatabase Management system
Database Management systemVijay Thorat
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbmssethu pm
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of DatabaseMarlon Jamera
 
From Information to Insight: Data Storytelling for Organizations
From Information to Insight: Data Storytelling for OrganizationsFrom Information to Insight: Data Storytelling for Organizations
From Information to Insight: Data Storytelling for OrganizationsThinking Machines
 
Machine Learning and the Smart City
Machine Learning and the Smart CityMachine Learning and the Smart City
Machine Learning and the Smart CityErika Fille Legara
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMSkoolkampus
 
Hybrid Intelligence: The New Paradigm
Hybrid Intelligence: The New ParadigmHybrid Intelligence: The New Paradigm
Hybrid Intelligence: The New ParadigmClare Corthell
 

Andere mochten auch (20)

Introduction to encryption
Introduction to encryptionIntroduction to encryption
Introduction to encryption
 
Mc leod9e ch06 database management systems
Mc leod9e ch06 database management systemsMc leod9e ch06 database management systems
Mc leod9e ch06 database management systems
 
DATABASE Fp304 chapter 1
DATABASE Fp304   chapter 1DATABASE Fp304   chapter 1
DATABASE Fp304 chapter 1
 
Dbms presentaion
Dbms presentaionDbms presentaion
Dbms presentaion
 
1 5~1
1 5~11 5~1
1 5~1
 
The State of Artificial Intelligence and What It Means for the Philippines
The State of Artificial Intelligence and What It Means for the PhilippinesThe State of Artificial Intelligence and What It Means for the Philippines
The State of Artificial Intelligence and What It Means for the Philippines
 
Comparing Research Designs
Comparing Research DesignsComparing Research Designs
Comparing Research Designs
 
Database Management system
Database Management systemDatabase Management system
Database Management system
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbms
 
Dbms mca-section a
Dbms mca-section aDbms mca-section a
Dbms mca-section a
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
 
Dbms ppt
Dbms pptDbms ppt
Dbms ppt
 
From Information to Insight: Data Storytelling for Organizations
From Information to Insight: Data Storytelling for OrganizationsFrom Information to Insight: Data Storytelling for Organizations
From Information to Insight: Data Storytelling for Organizations
 
Machine Learning and the Smart City
Machine Learning and the Smart CityMachine Learning and the Smart City
Machine Learning and the Smart City
 
DbMs
DbMsDbMs
DbMs
 
Files Vs DataBase
Files Vs DataBaseFiles Vs DataBase
Files Vs DataBase
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
Types dbms
Types dbmsTypes dbms
Types dbms
 
Hybrid Intelligence: The New Paradigm
Hybrid Intelligence: The New ParadigmHybrid Intelligence: The New Paradigm
Hybrid Intelligence: The New Paradigm
 

Ähnlich wie [PHPUGPH] PHP Roadshow - MySQL (20)

2nd chapter dbms.pptx
2nd chapter dbms.pptx2nd chapter dbms.pptx
2nd chapter dbms.pptx
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Chapter02
Chapter02Chapter02
Chapter02
 
Database Management System (DBMS).pptx
Database Management System (DBMS).pptxDatabase Management System (DBMS).pptx
Database Management System (DBMS).pptx
 
7. SQL.pptx
7. SQL.pptx7. SQL.pptx
7. SQL.pptx
 
Dbms sql-final
Dbms  sql-finalDbms  sql-final
Dbms sql-final
 
Module02
Module02Module02
Module02
 
DBMS PPT.pptx
DBMS PPT.pptxDBMS PPT.pptx
DBMS PPT.pptx
 
Dbms Basics
Dbms BasicsDbms Basics
Dbms Basics
 
PT- Oracle session01
PT- Oracle session01 PT- Oracle session01
PT- Oracle session01
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
Data base
Data baseData base
Data base
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
AWS RDS Migration Tool
AWS RDS Migration Tool AWS RDS Migration Tool
AWS RDS Migration Tool
 
Database Project Airport management System
Database Project Airport management SystemDatabase Project Airport management System
Database Project Airport management System
 
4.Database Management System.pdf
4.Database Management System.pdf4.Database Management System.pdf
4.Database Management System.pdf
 
PPT SQL CLASS.pptx
PPT SQL CLASS.pptxPPT SQL CLASS.pptx
PPT SQL CLASS.pptx
 
Lecture on DBMS & MySQL.pdf v. C. .
Lecture on DBMS & MySQL.pdf v.  C.     .Lecture on DBMS & MySQL.pdf v.  C.     .
Lecture on DBMS & MySQL.pdf v. C. .
 
Database Management System ppt
Database Management System pptDatabase Management System ppt
Database Management System ppt
 
csedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfcsedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdf
 

Kürzlich hochgeladen

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Kürzlich hochgeladen (20)

New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

[PHPUGPH] PHP Roadshow - MySQL

  • 1. MySQL Database Essentials Cherrie Ann B. Domingo, CCNA Software Engineer, Accenture President, PHP User Group Philippines (PHPUGPH) Acting Secretary/Treasurer, Philippine SQL Server Users Group (PHISSUG)
  • 2.
  • 3.
  • 4.
  • 5. Database Management Systems vs. File Systems
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Capabilities of SELECT Statement Selection Projection Table 1 Table 2 Table 1 Table 1 Join
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. Using Comparison Conditions SELECT last_name, salary FROM employees WHERE salary <= 3000 ;
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. Obtaining Data from Multiple Tables EMPLOYEES DEPARTMENTS … …
  • 42.
  • 43.
  • 44.
  • 45.
  • 46. Retrieving Records with the ON Clause SELECT e.employee_id, e.last_name, e.department_id, d.department_id, d.location_id FROM employees e JOIN departments d ON (e.department_id = d.department_id);
  • 47. Self-Joins Using the ON Clause MANAGER_ID in the WORKER table is equal to EMPLOYEE_ID in the MANAGER table. EMPLOYEES (WORKER) EMPLOYEES (MANAGER) …
  • 48. Self-Joins Using the ON Clause SELECT e.last_name emp, m.last_name mgr FROM employees e JOIN employees m ON (e.manager_id = m.employee_id); …
  • 49. Creating Three-Way Joins with the ON Clause SELECT employee_id, city, department_name FROM employees e JOIN departments d ON d.department_id = e.department_id JOIN locations l ON d.location_id = l.location_id;
  • 50.
  • 51.
  • 52.
  • 53. LEFT OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM employees e LEFT OUTER JOIN departments d ON (e.department_id = d.department_id) ; …
  • 54. RIGHT OUTER JOIN SELECT e.last_name, e.department_id, d.department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id) ; …
  • 55. FULL OUTER JOIN SELECT e.last_name, d.department_id, d.department_name FROM employees e FULL OUTER JOIN departments d ON (e.department_id = d.department_id) ; …
  • 56.
  • 57. Generating a Cartesian Product Cartesian product: 20 x 8 = 160 rows EMPLOYEES (20 rows) DEPARTMENTS (8 rows) … …
  • 58.
  • 59. Adding a New Row to a Table DEPARTMENTS New row Insert new row into the DEPARTMENTS table
  • 60.
  • 61.
  • 62.
  • 63.
  • 64. Removing a Row from a Table Delete a row from the DEPARTMENTS table: DEPARTMENTS
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72. Controlling Transactions DELETE INSERT UPDATE INSERT COMMIT Time Transaction ROLLBACK
  • 73.
  • 74.
  • 75.
  • 76.
  • 77. State of the Data After ROLLBACK DELETE FROM test; 25,000 rows deleted. ROLLBACK; Rollback complete. DELETE FROM test WHERE id = 100; 1 row deleted. SELECT * FROM test WHERE id = 100; No rows selected. COMMIT; Commit complete.
  • 78.
  • 79. Be a PHPUGPH’er! ^__^ It’s totally FREE! Register now at http://www.phpugph.com
  • 80. Contact Me ^__^ Cherrie Ann B. Domingo, CCNA http://www.plurk.com/chean http://www.twitter.com/betelguese blue_cherie29 cherrie.ann.domingo cherrie.ann.domingo cherrie.ann.domingo [email_address] [email_address] http://www.cherrieanndomingo.com +63917.865.2412 (Globe) (632) 975.6976