Database Implementation Rules

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

13 Terms

1
New cards

For the 1:M relationships, Primary Key of the 1 is placed in the M as a _______ Key.

Foreign

2
New cards

For ___ relationships, based on semantics, place the PK in the other relation as a FK.

1:1

3
New cards

For M:N (or ternary) create a new relation, PK of new relation is _________ key of parent entities.

Composite

4
New cards

For ____ Entity, create an entity, PK is partially or totally derived from Parent Entity.

Weak

5
New cards

For ____________ attribute, create an entity and treat as a weak entity.

Multi-valued

6
New cards

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));

7
New cards

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));

8
New cards

For a 1:1 relationship, ___________ is placed in the most frequently accessed entity or selected by the semantics of the problem.

Foreign key

9
New cards

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

10
New cards

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);

11
New cards

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

12
New cards

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);

13
New cards

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