1/12
Looks like no tags are added yet.
For the 1:M relationships, Primary Key of the 1 is placed in the M as a _______ Key.
Foreign
For ___ relationships, based on semantics, place the PK in the other relation as a FK.
1:1
For M:N (or ternary) create a new relation, PK of new relation is _________ key of parent entities.
Composite
For ____ Entity, create an entity, PK is partially or totally derived from Parent Entity.
Weak
For ____________ attribute, create an entity and treat as a weak entity.
Multi-valued
What is a SQL example of mandatory participation?
CREATE TABLE Faculty
(Employee_Num CHAR(3) PRIMARY KEY,
Emp_LName CHAR(12),
Emp_FName CHAR (12),
Emp_Initial CHAR (1),
Dept_Code CHAR(6) NOT NULL,
FOREIGN KEY (Dept_Code) references Department
(Dept_Code));
What is a SQL example of optional participation?
CREATE TABLE Student
(Student_Num CHAR(4) PRIMARY KEY,
Stu_LName CHAR(12),
STU_FName CHAR(12),
Stu_Initial CHAR(1),
Room_Code Char(5),
Employee_Num CHAR(3) NOT NULL,
FOREIGN KEY (Room_Code) references Room (Room_Code)
ON DELETE SET NULL,
FOREIGN KEY (Employee_Num) references Faculty
(Employee_Num));
For a 1:1 relationship, ___________ is placed in the most frequently accessed entity or selected by the semantics of the problem.
Foreign key
For a M:N relationship, decompose into two 1:M relationships with a Composite Entity. The Primary Key of the Composite Entity is a composite primary key comprised of the two ______ entities Primary Keys.
Parent
What is a SQL example where both sides are optional?
CREATE TABLE Enrollment (
Class_Code CHAR(7) NOT NULL,
Student_Num CHAR(4) NOT NULL,
Enroll_Grade NUMBER (2),
PRIMARY KEY (Class_Code, Student_Num),
FOREIGN KEY (Class_Code) references Class
(Class_Code) on delete cascade,
FOREIGN KEY (Student_Num) references Student
(Student_num) on delete cascade);
For a weak entity, primary key of Parent Entity is placed in _____ Entity as a Foreign Key and also will be part of Primary Key of Child Entity.
Child
What is a SQL example of a weak entity?
CREATE TABLE Dependent
(Dep_Num CHAR(9),
Emp_Num CHAR(9) NOT NULL,
Dep_FName VARCHAR(12),
Dep_LName VARCHAR(12),
Dep_DOB DATE,
PRIMARY KEY (Dep_num, Emp_Num),
Foreign KEY (Emp_Num) references Employee
(Emp_Num) ON DELETE CASCADE);
For a multi-valued attribute, create a new entity for multivalued attribute having 1:M relationship with parent entity. New entity conforms to ___________ rules.
Weak entity