Quiz # 4 – Convert E-R to Tables

 

1)         ssn, Sname                                                                    ApplicationID, Aname

                                    1:1                                            0:1

Student                                     submits                            Application                            

 

 

a)   Student (ssn, sname), Application (ApplicationID, Aname, sname)

b) Student (ssn, sname, ApplicationID), Application (ApplicationID, Aname)

c) Student (ssn, sname), Application (ApplicationID, Aname, ssn)

a)      Student (ssn, sname), Application (ApplicationID, Aname), Submits (ssn, ApplicationID)

 

2) ssn, name                                                                              aid, type, aname, dollar

                                    1:1                                            0:N

Actor                                        wins                                 Awards                   

 

 

 

a)      Actor (ssn, name, aid, type, aname, dollar)

b)      Actor (ssn, name, aid), Awards (aid, type, aname, dollar)

c)      Actor (ssn, aname), Awards (aid, type, aname, dollar), Wins (ssn, aid)

d)      Actor (ssn, name), Awards (aid, type, aname, dollar, ssn)

 

 

3)  When converting a one (1) to  one (1) binary relationship into tables,  which of the following statement is true:

a)            It doesn’t matter which of the two entities that you insert a Foreign Key.

b)      Check if one of the Foreign Keys represent a mandatory one. If so, you should insert a FK use that one to  avoid null values

c)  You should always place a Foreign key on both entities in order to avoid null values

d)  It is always best to create an associative table.

 

4) When converting one (1) to many (N) binary relationship into tables, the recommended solution is usually:

a) One big table with all attributes from both entities included

b) foreign key added on the Child (many side) referencing the parent

c)      foreign key added on the Parent (one side) referencing the child

d)      foreign key added on both sides (both tables)

third table

 

5) When converting a many (N) to many (N) unary relationship into tables, the recommended solution is:

a)      Either a FK or an associative table

b)      Three tables. The third table is the intersection table.

c)      One entity with a recursive foreign key

d)  Two tables. The second table will contain the recursive relationship.

 

Every Many to Many Relationship can be broken down into  Two One to Many Relationships.

What is the cardinality of the two one  to many relationships ?    The Intersection table will be the Child (many) of both of the new relations.

What is the Primary key of this associate (or intersection) table ?  a composite PK that consists of the PK of each of the original tables.