1 / 20

SQL LANGUAGE TUTORIAL

SQL LANGUAGE TUTORIAL. Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha. Basic Syntax of SQL Language. SELECT attribute name(s) FROM table name WHERE comparison predicate (Boolean expression) GROUP BY attribute name HAVING comparison predicate ORDER BY attribute name. Create Tables.

brac
Download Presentation

SQL LANGUAGE TUTORIAL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQL LANGUAGE TUTORIAL Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha

  2. Basic Syntax of SQL Language SELECT attribute name(s) FROM table name WHERE comparison predicate (Boolean expression) GROUP BY attribute name HAVING comparison predicate ORDER BY attribute name

  3. Create Tables

  4. SELECT ALL records

  5. Formula • Like & DISTINCT

  6. SELECT specific records with conditions

  7. SQL ORDER BY

  8. SQL UPDATE UPDATE table name SET column1 = value, column2 = value2,… WHERE comparison predicate (Boolean expression)

  9. SQL IN OPERATOR AVG() - Returns the average value COUNT() - Returns the number of rows FIRST() - Returns the first value LAST() - Returns the last value MAX() - Returns the largest value MIN() - Returns the smallest value SUM() - Returns the sum

  10. SQL Alias

  11. SQL Joins • INNER JOIN: Return rows when there is at least one match in both tables • LEFT JOIN: Return all rows from the left table, even if there are no matches in the right table • RIGHT JOIN: Return all rows from the right table, even if there are no matches in the left table SELECT column_name(s) FROM table_name1 JOIN_TYPES table_name2 ON table_name1.column_name = table_name2.column_name

  12. SQL INNER JOIN

  13. SQL LEFT JOIN

  14. SQL RIGHT JOIN

  15. SQL GROUP BY Statement

  16. SQL HAVING Clause

  17. PosgreSQL Arrays (1)

  18. PosgreSQL Arrays (2)

  19. PosgreSQL Arrays (3)

  20. PosgreSQL Composite Types

More Related