🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: ER to Tables: questions with answers

15 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. In a 1:N relationship between Department (1) and Student (N), where does the foreign key go?
  2. Q2. How is an M:N relationship such as Student enrolls Course mapped?
  3. Q3. A student can have several phone numbers. What is the right design?
  4. Q4. The attribute "grade" in Student enrolls Course belongs in which table?
  5. Q5. Why is age usually not stored as a column?
  6. Q6. "Each department has exactly one head; most faculty are not heads." Where should the foreign key go?
  7. Q7. A course can have other courses as prerequisites. What kind of relationship is this?
  8. Q8. A weak entity Dependent is identified by (employee, dependent name). What is its table's primary key?
  9. Q9. The composite attribute name (first, last) becomes:
  10. Q10. What does the primary key (rollno, coursecode) on the enrollment table prevent?
  11. Q11. An ER design has Student (with a multivalued phone attribute), Course, and an M:N relationship "enrolls". How many tables does the mapping…
  12. Q12. Why is department.headid created as nullable at first?
  13. Q13. Why does a weak entity's foreign key to its owner usually use ON DELETE CASCADE?
  14. Q14. In the phone-count query, why is COUNT(p.phone) used after the LEFT JOIN instead of COUNT()?
  15. Q15. Listing each course with its prerequisite's title needs the course table twice. How is that written?