SQLFundamentalspptx-210320-170025
SQLFundamentalspptx-210320-170025
M1W4D2
Relational Databases
1) CREATE
2) ALTER
3) DROP
4) RENAME
Data Manipulation Language
1) SELECT
2) INSERT
3) UPDATE
4) DELETE
Basic Structure of SQL Query
General Structure SELECT, ALL/ DISTINCT, *, AS, FROM,
WHERE
Union UNION
SELECT & DISTINCT Statement
SELECT is the most common statement used, and it allows us to
retrieve information from a table.
= EQUAL
Useful for not wanting to return every single row in a table, but only
view the top few rows to get an idea of the table layout
LIMIT goes at the very end of a query request and is the last
command to be executed
BETWEEN Statement
Combination of Wildcards
WHERE name LIKE ‘_ her%’
● Cheryl
● Theresa
● Sherri
Aggregate Functions
Category Data A 10
A 10 A 5 Category Result
A 5
AVG() A 7.5
B 2
B 2
B 3
B 4
B 4
C 9
C 12 C 12
C 6 C 6
HAVING BY Statement
3 Charlie 3 Yauren
4 David 4 Bob
FULL OUTER JOIN Statement
Reg_ID Name Log_ID Name Red_ID Name Log_ID Name
3 Charlie 3 Yauren
4 David 4 Bob