Standard language for creating and querying relational databases
Classification of SQL commands
Data Definition Language (DDL)
Data Manipulation Language (DML)
Data Control Language (DCL)
Data Definition Language (DDL)
used to create, alter, and drop tables
Data Manipulation Language (DML)
core commands of SQL used for updating, inserting, modifying, and querying the data in the database
Data Control Language (DCL)
used to grant or revoke privileges to access the databases or particular objects within the databases; used to store or remove transactions that would affect the databases
DML Command
Select
Insert
Update
Delete
Select
allows users to query the data contained in the tables based on certain criteria
Structure of an SQL Query
Select
From
Where
Group By
Having
Order By
Select
columns or attributes
literals
arithmetic expression
scalar or column functions
From
tables or views
WHERE
condition for row selection
ORDER BY
sort key
Select *
From Product T;
means Select all attributes/rows FROM Product_T table.
USING BOOLEAN OPERATORS WITH SELECT CLAUSE (IN ORDER)
NOT
AND
OR
AND
joins 2 or more conditions; only when all conditions are TRUE
OR
joins 2 or more conditions; when ANY conditions are TRUE
NOT
negates an expression
IN
used in the WHERE clause, specify that a particular column value must match one of the values in a list.
NOT
inverts expression
BETWEEN
allows user to specify MINIMUM and MAXIMUM VALUE on 1 line (RANGE)