Cardinality and database diagrams

image-20230911110116777
image-20230911110133733
image-20230911110143431
image-20230911110149655
image-20230911110207183

Exercise 1: Identify the primary key

  • Describe: What is a primary key? What are the characteristics

  • What could be the primary key from the following database schemas? If none answer that

    • person(navn, fødselsdato, addresse, bruger_briller, cpr_nummer)

    • bil(farve,stelnummer,nummerplade, mærke, model)

    • sang(kunstner, album, længde, danceability, genre)

    • film(titel, hovedrolle, genre, årstal, instruktør)

    • hvem_står_i_kø(navn, alder, hårfarve, nummer_i_kø)

Exercise 2 - in Pairs: ER Diagram

Draw a ER diagram model for a small college with the classes/entities: Student, Instructor, Course, Project

You can use an online tool such as: https://app.diagrams.net/

The rules are:

  • All students must be enrolled in at least one course or one project

  • An instructor must teach at least one course og supervise at least one project

  • A student cannot be working on more than one project (they're too time consuming)

  • An instructor can teach any number of courses and supervise any number of projects

  • A project or course must have an instructor

  • A course must have at least 1 student (or it is cancelled)

Last updated