Introduction To Structured Query Language SQL
Introduction To Structured Query Language SQL
by Ijaz Ahmad
DDL (Data Definition Language)
1 CREATE TABLE
DROP TABLE 2
Removes a table and its data from a
database 3 ALTER TABLE
UPDATE DELETE
Gives users permission to access Denies users permission to Removes users' permission to
and manipulate data access data access data
Primary Keys
A primary key is a column, or combination of columns, used to uniquely identify each row in a table. By default,
primary keys are used to create a clustered index.
Returns only the matching rows Returns all the matching rows Returns all the matching rows
from both tables from both tables, plus all from both tables, plus all
unmatched rows from the left unmatched rows from the right
table table
Subqueries
A subquery is a nested query that is executed within the context of another query. Subqueries can be used to
filter, sort, and aggregate data in various ways.
Returns only one row Returns multiple rows Returns a table that can
be used in another query
Aggregate Functions
1 SUM
2 AVG
3 MIN
4 MAX