CS 306, Spring 2018 Quiz 4 1. The primary key of Club is the composite key (name
ID: 3739420 • Letter: C
Question
CS 306, Spring 2018 Quiz 4 1. The primary key of Club is the composite key (name, address) and the primary key of Security is name. Club 1.. Security a) What do the multiplicities of this relationship mean in the example? b) Which table should have a foreign key to maintain this relationship? c) Give the relation schemas (in text form) of these two tables, showing all known attributes based on the above description and diagram. You must indicating primary and foreign keys, if there is any. You may rename certain attributes 2. Draw one ER model diagram (with names and multiplicities) showing three entities, Flight, Pilot, Airline. Each flight is for a particular airline; each pilot is employed by one airline. There is one relationship called "is assigned" involvin Flight and Pilot. Each flight is assigned two pilots, one captain and the other th co-pilot. A pilot can flight different flights.Explanation / Answer
a) Club has many securities.
b) If the Secutiy table is having columns of composite key of Club table then "Foriegn key constraint can be set in table Security".
c)
create table Club
(
name varchar2(30),
address varchar2(100),
constraint pl_club PRIMARY KEY (name, address)
)
CREATE TABLE Security
(
sec_id int,
sec_name varchar2(30),
sec_address varchar2(100),
)
Alter table Security add constraint fk_security FOREIGN KEY (sec_name, sec_address) REFERENCES Club(name, address)