Difference between revisions of "DDL Student Records"

From SQLZOO
Jump to: navigation, search
(Created page with "Creating a database: Student record database. In this tutorial you will learn how to create tables and set up links between tables. ==Student Records, Logical Design== The d...")
 
(Student Records, Logical Design)
Line 8: Line 8:
 
There are a number of students, identified by a matric number. There are a number of modules, identified by a module code. Each student studies many modules and will get a result for each. Each module is studied by many students.
 
There are a number of students, identified by a matric number. There are a number of modules, identified by a module code. Each student studies many modules and will get a result for each. Each module is studied by many students.
  
[[File:SITS_ERD.jpg]]
+
[[File:SITS_ERD.png]]
  
 
==The plan==
 
==The plan==
 
We will create three tables, one for each of the entities in the diagram shown above. Where there is a "parent/child" relation (a one to many) we must create the ONE before we create the MANY. That means we should create the table in the order [student, module, registration] (or [module, student, registration]) but not [registration, module, student].
 
We will create three tables, one for each of the entities in the diagram shown above. Where there is a "parent/child" relation (a one to many) we must create the ONE before we create the MANY. That means we should create the table in the order [student, module, registration] (or [module, student, registration]) but not [registration, module, student].

Revision as of 10:26, 20 October 2016

Creating a database: Student record database.

In this tutorial you will learn how to create tables and set up links between tables.

Student Records, Logical Design

The database is intended to record the grades of students studying modules at a University.

There are a number of students, identified by a matric number. There are a number of modules, identified by a module code. Each student studies many modules and will get a result for each. Each module is studied by many students.

SITS ERD.png

The plan

We will create three tables, one for each of the entities in the diagram shown above. Where there is a "parent/child" relation (a one to many) we must create the ONE before we create the MANY. That means we should create the table in the order [student, module, registration] (or [module, student, registration]) but not [registration, module, student].