SQL allows a foreign-key dependency to refer to the same relation, as in the following example: create table manager (employee name char(20), manager name char(20), primary key employee_name, foreign key (manager name) references manager on delete cascade) Here, employee name is a key to the table manager, meaning that each em- ployee has at most one manager. The foreign-key clause requires that every manager also be an employee. Explain exactly what happens when a tuple in the relation manager is deleted.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter4: Constraints
Section: Chapter Questions
Problem 1RQ: What is the difference between a PRIMARY KEY constraint and a UNIQUE constraint?
icon
Related questions
icon
Concept explainers
Question
SQL allows a foreign-key dependency to refer to the same relation, as in the
following example:
create table manager
(employee_name
char(20),
manager_name char(20),
primary key employee_name,
foreign key (manager name) references manager
on delete cascade)
Here, employee name is a key to the table manager, meaning that each em-
ployee has at most one manager. The foreign-key clause requires that every
manager also be an employee. Explain exactly what happens when a tuple
in the relation manager is deleted.
Transcribed Image Text:SQL allows a foreign-key dependency to refer to the same relation, as in the following example: create table manager (employee_name char(20), manager_name char(20), primary key employee_name, foreign key (manager name) references manager on delete cascade) Here, employee name is a key to the table manager, meaning that each em- ployee has at most one manager. The foreign-key clause requires that every manager also be an employee. Explain exactly what happens when a tuple in the relation manager is deleted.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr