ITM 209 SQL Exam study guide
4 Common SQL Statements Select, Insert, Update, Delete
What does 'Select' do Read data
A grouping of tables and other database objects
SQL Schema
such as views, constraints, and indexes which
logically belong together.
, How many tables are 3
needed for a n:m
relationship
What do you use to end a semicolon ;
SQl query
SELECT
table1.field1 AS
'field1 label',
Format of Select statement
table1.field2 as
'field2 label'
(list as many fields as you need from any table.
Fields must be part of tables listed in the from or
join clause)
FROM
schema.table1
Format of From & Join
statement (inner/left/right)
JOIN
schema.table2 on table1.field1(PK) = table2.field3(FK)
WHERE
table.field1 operator criteria
AND table1.field2
operator criteria OR
Format of Where statement
table2.field5 operator
criteria
(Criteria for filtering on fields (non-aggregated / non-
calculated). List as many fields & operators as
needed. Order of logical operators (i.e. and / or) can
be specified by using parenthesis to group
together.)
GROUP BY
table1.field3,
table1.field4
Format of Group By
statement (LEVEL of aggregation at which calculations or
aggregated functions are applied. This must have
at least one field and can specify additional fields.
Data will be grouped by based upon the order of
the fields listed.)
HAVING
table.field1 operator criteria
AND table1.field2 operator criteria
4 Common SQL Statements Select, Insert, Update, Delete
What does 'Select' do Read data
A grouping of tables and other database objects
SQL Schema
such as views, constraints, and indexes which
logically belong together.
, How many tables are 3
needed for a n:m
relationship
What do you use to end a semicolon ;
SQl query
SELECT
table1.field1 AS
'field1 label',
Format of Select statement
table1.field2 as
'field2 label'
(list as many fields as you need from any table.
Fields must be part of tables listed in the from or
join clause)
FROM
schema.table1
Format of From & Join
statement (inner/left/right)
JOIN
schema.table2 on table1.field1(PK) = table2.field3(FK)
WHERE
table.field1 operator criteria
AND table1.field2
operator criteria OR
Format of Where statement
table2.field5 operator
criteria
(Criteria for filtering on fields (non-aggregated / non-
calculated). List as many fields & operators as
needed. Order of logical operators (i.e. and / or) can
be specified by using parenthesis to group
together.)
GROUP BY
table1.field3,
table1.field4
Format of Group By
statement (LEVEL of aggregation at which calculations or
aggregated functions are applied. This must have
at least one field and can specify additional fields.
Data will be grouped by based upon the order of
the fields listed.)
HAVING
table.field1 operator criteria
AND table1.field2 operator criteria