SQL Basics

13,249 views

Published on

Basics of Structured Query Language.

Published in: Technology
3 Comments
26 Likes
Statistics
Notes
  • @Bushra Nayab you can download the ppt file from given link http://documents.mx/technology/structured-query-language-sql.html
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • http://www.dbmanagement.info/Tutorials/SQL.htm
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • why the saving option is disabled??
    i need this presentation
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
13,249
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
0
Comments
3
Likes
26
Embeds 0
No embeds

No notes for slide

SQL Basics

  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 />

×