SQL Overview
Presents an overview of concepts pertaining to relational databases and SQL. Describes the tables used in the course.
| Relational Concepts
Databases based on a relational model. Components of relational tables. |
| Course Tables
Data found in the tables used in the course. |
| SQL Concepts
Purpose of SQL. Features of Data Definition Language, Data Manipulation Language and Authorization Language. Syntax rules for coding SQL statements. |
Date and Time Functions
Describes how to use date and time data in SQL queries.
| Selecting Date and Time Columns
Use of the DATE, TIME and TIMESTAMP data types. |
| Parsing Date and Time Columns
Use of the YEAR, MONTH, DAY, HOUR, MINUTE and SECOND functions. |
| Arithmetic with Date and Time Columns
Use of the YEARS, MONTHS and DAYS functions. |
Combining Information from Two Tables
Describes the concepts and practices related to joining and merging tables.
| Theory
Situations where you need to join or merge information from two tables. Types of joins. |
| Inner Joins
Coding the FROM clause when joining two tables. Specifying the joining condition. Incorporating other search conditions. How to order a query that joins two tables. Use of built-in functions when joining tables. |
| Outer Joins
How to use and code the three types of outer joins. Using the VALUE (COALESCE) function. |
| Merging
Coding UNION versus UNION ALL to merge tables. Use of literals for columns with fixed values. Considerations for the columns in tables to be merged. Coding WHERE and ORDER BY clauses when merging tables. |
| Workshop
Building queries that join and merge tables. |
Subselects
Describes the concepts and practices related to subqueries and subselects.
| What is a Subselect?
Explanation of a subselect and a subquery. Nested table expressions. |
| A Simple Subquery
Rules for coding subselects. Coding the main SELECT versus the subselect. Valid relational operators when a single value is returned from the subselect. |
| Subqueries Returning Several Rows
Valid relational operators when more than one row is selected. Coding IN, =ANY and =SOME for equality. Coding ALL, ANY and SOME for greater or less than. |
| Workshop
Building queries that use subselects. |
|