Introduction
Introduction
Tools Used in This Course
Setting Up Course Tools
Download PostgreSQL
Install PostgreSQL
Download SQLectron
Install SQLectron
Connect to PostgreSQL - Credentials
Connect to PostgreSQL Using SQLectron
Import Course Data Using SQLectron
FOR WINDOWS 32-BIT USERS: SQL Alternative - DBeaver
FOR WINDOWS 32-BIT USERS: Download, Install, Configure & Import Data
Browsing & Filtering Data
Check Imported Data
So.. What is a Database?
SQL Data Types
Finally Some Fun! Extracting Data Based on Requirements
Filtering Data using WHERE Keyword
Filter Data by Range Using BETWEEN
Filter Data by Set of Values Using IN
Filter Data by Date
More Filtering by Date
Another Query Filtering by Date
Filter Data by Strings (Names, Addresses, ...)
More Filtering by Strings
More Filtering by Strings 2
More Filtering by Strings 3
How to Ignore Caps when Filtering by String
Filter Data with AND, OR, NOT Operators
AND Operator
OR Operator
NOT Operator
AND, OR & NOT Operators: Which Has The Highest Priority?
Math Operations
Basic Math Operations
Modulo Operator
It's Payday! Calculate The Net Salary for Employees
Filter Data with Math Equations
String Concatenation
Concatenate Strings with '||' Operator
Concatenate Strings with Numbers
Tidy Up Your Results: Sorting, Alias Names, Limit Records
Give Your Report Fields A Cool Name
A Report for Payroll
Order Records by Column
Order Records by Multiple Columns
How Alias Names Cannot Be Used with WHERE
LIMIT Record Count Fetched by Your Query
NULL, DISTINCT & CASE Statements
Fetch A Field's Unique Values Using DISTINCT
Using DISTINCT Keyword with Multiple Columns
What is a NULL Value Anyway?
Build More Sophisticated Queries with CASE Statements
Your Knowledge So Far Under A Great Test
Functions in SQL: Multiple-Row Functions
Let Me Introduce You to Functions
SUM Function
AVG (Average) Function
COUNT Function
MIN & MAX Functions
How To Count Your Field's Unique Values
GROUP BY Clause: Use Functions with Dimensions
GROUP BY More Than One Dimension
Now For Some Tough Workout
Filter By Aggregate Functions with HAVING Clause
Functions in SQL: Single-Row Functions
Character Functions - UPPER, LOWER & INITCAP
Character Functions - CONCAT & LENGTH
Character Functions - LPAD & RPAD
Character Functions - TRIM
Character Functions - REPLACE
Character Functions - SUBSTR
Number Functions - MOD & ROUND
Number Functions - TRUNC
Nested Queries
Selectception: A Select Query Inside Another Select Query!
Casting & Data Conversion
Auto Data Conversion in SQL
Cast Date to Character
Cast Number to Character
Cast Timestamp to Character
Cast Character to Number
Cast Character to Date & Timestamp
Combination Relationships
UNION
UNION ALL
Important Note about Combining Queries
INTERSECT
EXCEPT
Joins in SQL
Employees & Departments Tables Revised
Entity Relationship Diagram (ERD)
Cartesian Join
Table Aliases with Joins
Why I Don't Recommend Cartesian Joins
Inner Join
In-Depth Look into Join Types in SQL
Outer Join - Right, Left & Full
Data Manipulation (DML)
INSERT a New Record to a Table
Insert Without Specifying Column Names
UPDATE a Record's Field Values
CAUTION! How an UPDATE Query Can Go Wrong
Update a Record Using Single-Row Functions
A Good Exercise: Extract Employee's Email Address
Hints on How to Extract Employee's Email Address
Solution: Extract Employee's Email Address
DELETE a Table's Record
Insert Records with Nested Select Queries
SQL Data Definition Language (DDL)
SQL Data Types Revised
Bookstore Data Set: Let's Move It to Database
Create Your First Table!
Insert Data to Your New Table
Change Column Data Type
Rename Column
Add a New Column to Table
Constraints in SQL
Primary Keys
NOT NULL Constraint
UNIQUE Constraint
DEFAULT Constraint
Foreign Keys
Use Foreign Keys with Joins - Books & Publishers
Foreign Keys - Properties
Drop Column
DROP Table
Create a New Table with Select Statement
A Trick to Create an Empty Table with Select Statement
Insert New Records Using Select Statement
Views
Schemas
Create & Use Schemas
Access Control
Introduction to Access Control
Create User
Grant SELECT to User
Grant Insert & Update to User
Revoke Privilege from User
User Groups