Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
GROUP MEMBERS<br />ADIL SHAKIRHAMMAD YOUSAF<br />AMMAR YASIR 			HASEEB KHALID<br />AWAIS AFTAB BUTTMUDDASIR ABID<br />BILA...
PrEsEnTeRs<br />Hammad<br />Bilal<br />Awais<br />
ID : 05<br />
Introduction<br /><ul><li>A business need
Database</li></ul>“An organized collection of information”<br />OR<br /> “Set of tables each having different class of dat...
Structured Query Language ( SQL ) <br /><ul><li>A language to communicate with the database
A tool to retrieve the required information from database
Elements
Syntax of SQL is in plain English
To question the database</li></li></ul><li>What SQL can do?<br />With SQL you can:<br />1. Execute queries against a datab...
UPDATE      Update Records in a database
DELETE         Delete Records from a database</li></li></ul><li>
Pre-requisites for SQL<br /><ul><li>Relational Database
Tables
Fields
Records
Different Relationships
1-1
1-m </li></li></ul><li>SYNTAX<br />Statement<br />Table Name<br />Condition<br />SELECT CustomerName, City, Country  FROM ...
ID : 11<br />
QUERIES<br />
SQL Queries<br />
Upcoming SlideShare
Loading in …5
×

Structured Query Language (SQL)

1,449 views

Published on

Presentation on Structured Query Language (SQL)

Published in: Technology
  • Be the first to comment

Structured Query Language (SQL)

  1. 1.
  2. 2. GROUP MEMBERS<br />ADIL SHAKIRHAMMAD YOUSAF<br />AMMAR YASIR HASEEB KHALID<br />AWAIS AFTAB BUTTMUDDASIR ABID<br />BILAL AHMED MOHAMMED IMRAN<br />FAIZA KHALID RAAZIA IRSHAD<br />HAMMAD RASHEED ZULQARNAIN BAJWA<br />
  3. 3. PrEsEnTeRs<br />Hammad<br />Bilal<br />Awais<br />
  4. 4. ID : 05<br />
  5. 5. Introduction<br /><ul><li>A business need
  6. 6. Database</li></ul>“An organized collection of information”<br />OR<br /> “Set of tables each having different class of data.”<br />
  7. 7. Structured Query Language ( SQL ) <br /><ul><li>A language to communicate with the database
  8. 8. A tool to retrieve the required information from database
  9. 9. Elements
  10. 10. Syntax of SQL is in plain English
  11. 11. To question the database</li></li></ul><li>What SQL can do?<br />With SQL you can:<br />1. Execute queries against a database<br />2. Perform CRUD function:<br /><ul><li>CREATE New databases</li></ul>New tables in a database<br />  Records in a database<br /><ul><li>READ Retrieve data from a database
  12. 12. UPDATE Update Records in a database
  13. 13. DELETE  Delete Records from a database</li></li></ul><li>
  14. 14. Pre-requisites for SQL<br /><ul><li>Relational Database
  15. 15. Tables
  16. 16. Fields
  17. 17. Records
  18. 18. Different Relationships
  19. 19. 1-1
  20. 20. 1-m </li></li></ul><li>SYNTAX<br />Statement<br />Table Name<br />Condition<br />SELECT CustomerName, City, Country FROM Customer WHERE Country=‘USA’<br />Columns<br />FROM Clause<br />WHERE Clause<br />SELECT Clause<br />
  21. 21. ID : 11<br />
  22. 22. QUERIES<br />
  23. 23. SQL Queries<br />
  24. 24. ID : 47<br />
  25. 25. Function Queries<br />Function queries in SQL involve manipulating functions in SQL statements to retrieve desired information from the database.<br />Such function queries are of two broad categories:<br /><ul><li>Aggregate Function Queries
  26. 26. Scalar Function Queries</li></li></ul><li>
  27. 27. SQL JOIN QUERIES<br />SQL joins are used to query data from two or more tables, based on a relationship between certain columns in these tables.<br />
  28. 28. Inner Join<br />The INNER JOIN keyword return rows when there is at least one match in both tables.<br />Syntax<br />SELECT column_name(s)FROM table_name1INNER JOIN table_name2ON table_name1.column_name=table_name2.column_name<br />
  29. 29. Outer Join<br />The OUTER JOIN clause differs from the INNER JOIN in that rows are returned even when there are no matches through the JOIN critieria on the second table. <br />Difference Explained:<br />Assuming you're joining on columns with no duplicates, which is by far the most common case:<br />An inner join of A and B gives the result of A intersect B, i.e. the inner part of a venn diagram intersection.<br />An outer join of A and B gives the results of A union B, i.e. the outer parts of a venn diagram union.<br />
  30. 30. Left Outer Join<br />The LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2)<br />Syntax<br />SELECT column_name(s)FROM table_name1LEFT JOIN table_name2ON table_name1.column_name=table_name2.column_name<br />
  31. 31. Right Outer Join<br />The RIGHT JOIN keyword Return all rows from the right table (table_name2), even if there are no matches in the left table (table_name1)<br />Syntax<br />SELECT column_name(s)FROM table_name1RIGHT JOIN table_name2ON table_name1.column_name=table_name2.column_name<br />
  32. 32. Full Join<br />The FULL JOIN keyword return rows when there is a match in one of the tables.<br />Syntax<br />SELECT column_name(s)FROM table_name1FULL JOIN table_name2ON table_name1.column_name=table_name2.column_name<br />
  33. 33. THANK YOU<br />

×