Design a simple schema of students, courses and exams, from the diagram to the SQL code.
- Add two entities. Place an entity on the canvas from the toolbar, then a second one. Double-click each entity to name them
STUDENTandCOURSE. - Add identifiers. Select
STUDENT, click Attribute, name itStudentIdand toggle Identifier. Do the same forCOURSEwithCode. - Connect them. Add a relationship
EXAMand place it between the two entities. Select it, click Connect and clickSTUDENT; repeat forCOURSE. Add the attributesDateandMarktoEXAM. - Set cardinalities. Select the participation line on the
STUDENTside and choose Card. → Optional-Many, (0,N): a student can take no exams or many. Select the line on theCOURSEside and choose Mandatory-Many, (1,N): every course has at least one exam. - Translate. Click Translate. Click Fix Entities first, then Fix Relationships.
EXAMbecomes a table whose primary key combines both identifiers. - Export. Click Done, assign the data types using Type, then open the Export menu and choose SQL.