CS370 Sample Questions for Final Exam

advertisement
CS370 Sample Questions for Final Exam
Important Note: This set of sample questions are taken from the material covered since
the last in-class test. However, the final exam will be comprehensive, so students should
also study the previous sample test and the previous in-class test. As always, these
questions are only samples of the kinds of questions that might be on the test. They in no
way limit the material that may be on the test. All material covered in class is “fair
game” for the final exam.
1.) Using the “crow’s foot” notation, draw an entity-relationship diagram showing
entity types CollegeStudent and College. Attributes of CollegeStudents are
student SSN (the primary key), firstName, lastName, and address. Attributes of
College are college number (the primary key), collegeName, and collegeState.
The relationship, “attends,” that relates a Student to a College. A CollegeStudent
must attend exactly 1 college, and college can have zero or more students. Show
that the “attends” relationship has an attribute called GPA.
2.) Describe the following relationship cardinalities:
a.)
b.)
c.)
d.)
1-M
M-N
Optional
Functional
3.) What is are “weak entity types “ and “identifying relationships?” How are they
represented in an ERD?
4.) What are “associative entity types?”
Provide an example.
5.) Two entity types, “Order” and “Product “ have a M-N relationship called
“contains.” (Orders may contain must contain one or more products and products
may appear on zero or more orders). Draw the ERD for the original
relationship. Redraw the diagram adding an associative entity type that
transforms the M-N relationship to two 1-M relationships.
6.) Draw an ERD showing the hierarchical relationship between the entity types
“Class,”, “CS Class,”, and “English Class.” Define the terms “complete” and
“disjoint” in this context.
7.) How are 1-M relationships typically represented in a relational database?
8.) The Optional 1-M Relationship Rule states, “Each 1-M relationship with 0 for the
minimum cardinality on the parent side becomes a new table. The primary key of
the new table is the primary key of the entity type on the child (many) side of the
relationship. The new table contains foreign keys for the primary keys of both
entity types participating in the relationship. Both foreign keys in the new table
do not permit null values. The new table also contains the attributes of the
optional 1-M relationship.” Use this rule to transform the optional relationship in
question 5.
9.) Describe functional dependency between columns in a table.
10.)
Given the following functional dependencies for a table, identify the
normal form constraints that are met, given that OfferNo and StdSSN are the
composite primary key.
StdSSN->StdCity, StdClass
OfferNo->OffTerm, OffYear, CourseNo, CrsDesc
CourseNo->CrsDesc
StdSSN, offerNo->ENrGrade
11.)
What are the requirements for each of the following?:
a.) First Normal Form
i. No repeating groups (nested tables)
b.) Second Normal Form
i. First normal form
ii. Key columns are columns that are, or are part of, a candidate key
1. candidate keys are “minimal” sets of columns
c.) Third Normal Form
d.) Boyce-Codd Normal Form
Download