Lab 04 - SQL (DDL)
Lab 04 - SQL (DDL)
• Primary keys must contain UNIQUE values, and cannot contain NULL
values.
• A table can have only one primary key, which may consist of single or
multiple fields.
• The table containing the foreign key is called the child table, and the
table containing the candidate key is called the referenced or parent
table.
• Any such relation that is not part of the logical model, but
is made visible to a user as a virtual relation, is called a
view.
• Ex:
create view faculty as
select ID, name, dept_name
from instructor;
Using Views in SQL Queries
create view faculty as
select ID, name, dept_name
from instructor;