Ch06 - Introduction To SQL
Ch06 - Introduction To SQL
INTRODUCTION TO SQL
Define terms
Interpret history and role of SQL
Define a database using SQL data definition
language
Write single table queries using SQL
Establish referential integrity using SQL
Discuss SQL:1999 and SQL:2011 standards
Catalog
A set of schemas that constitute the description of a database
Schema
The structure that contains descriptions of objects created by a user (base tables,
views, constraints)
Data Definition Language (DDL)
Commands that define a database, including creating, altering, and dropping tables
and establishing constraints
Data Manipulation Language (DML)
Commands that maintain and query a database
Data Control Language (DCL)
Commands that control a database, including administering privileges and
committing data
(Oracle 12c)
Overall table
definitions
Primary keys
can never have
NULL values
Identifying primary key
Chapter 6 Copyright © 2016 Pearson Education, Ltd. 6-17
Non-nullable specifications
Primary key
Default value
Domain constraint
Primary key of
parent table
Relational
integrity is
enforced via
the primary-
key to foreign-
key match
Table Actions:
Figure 6-10
SQL statement
processing order
(based on van der
Lans, 2006 p.100)
SELECT CUST.CUSTOMERNAME AS
NAME, CUST.CUSTOMERADDRESS
FROM CUSTOMER_V CUST
WHERE NAME = ‘Home
Furnishings’;
By default,
processing order
of Boolean
operators is NOT,
then AND, then
OR