Database Theory Flashcards
Normalization is the process of ________________.
Normalization is the process of efficiently organizing data in a database.
There are a few (4) goals of the normalization process:
There are a few (4) goals of the normalization process:
1) Eliminate redundant data (for example, storing the same data in more than one table)
2) Ensuring data dependencies make sense (only storing related data in a table)
3) Eliminate anomalies (Operations on a database table should not affect the validity of data of other entities)
4) Eliminate derived data. (Information that could be calculated from should not be stored)
Normalization reduces the _____________ consumes and ensures that data is ______ ______.
Normalization reduces the amount of space a database consumes and ensures that data is logically stored.
It’s important to point out that they are guidelines and guidelines only. Occasionally, it becomes necessary to stray from them to meet practical business requirements.
You shouldn’t have the same information in full text form in _____ ______ if possible.
You shouldn’t have the same information in full text form in multiple tables if possible.
If Dan were to change his name you would have to go through multiple tables and change them all.
Generally, when you have tables with a lot of redundant data, it needs to be _________.
Generally, when you have tables with a lot of redundant data, it needs to be broken into multiple tables.
The college address should not be put into this Student table due the fact it could change and you would have to go into each record and change it. Each table should have data that generally is very specific to itself.
The college address should not be put into this table due the fact it could change and you would have to go into each record and change it. Each table should have data that generally is very specific to itself.
The ProductTotal field should not be entered since it can be _______ .
The ProductTotal field should not be entered since it can be calculated.
Every student has a primary mobile telephone number (probably!), and every mobile telephone number corresponds to just one person. There is a _____ relationship between students and mobile telephone numbers.
Every student has a primary mobile telephone number (probably!), and every mobile telephone number corresponds to just one person. There is a one-to-one relationship between students and mobile telephone numbers.
If we have a table whose entity is Student (i.e. a table with information about students), we could simply add “Mobile number” as one of the fields in that table. However, we might not want to clutter the table with this kind of information, so we might make another table showing simply the student ID and the telephone number. We can then look up this information if we ever need it. The link between the two tables Students and Mobiles would be a one-to-one link.
Other examples of one to one relationships:
Other examples of one to one relationships:
1) One student in IMM has one computer
2) One faculty member is assigned one parking spots
A student only has one Director of Studies in any one year (usually), but a Director of Studies can have many different students.
The relationship between Directors of Studies and Students is a _______ relationship. So, if our database were to show the Director of Studies of each student, we could have a table listing all the Directors of Studies of the Colleges, with their IDs (primary key) and any extra information wanted (full names and contact information, for example).
DoS_ID Name College Telephone
rrb20 Zen, Dan Sheridan 905-555-0000
A student only has one Director of Studies in any one year (usually), but a Director of Studies can have many different students. The relationship between Directors of Studies and Students is a one-to-many relationship. So, if our database were to show the Director of Studies of each student, we could have a table listing all the Directors of Studies of the Colleges, with their IDs (primary key) and any extra information wanted (full names and contact information, for example).
You could then simply add a field “DoS” to your Students table (since a student can only have one DoS) containing the DoS’s ID, and link the two tables, DoS and Students, with a one-to-many relationship. The linked fields are the DoS_IDs (which appear in both tables).
Other examples of one to many relationships:
1)
2)
Other examples of one to many relationships:
1) Many students have one Program (IMM)
2) Many students in IMM are assigned to one class room(s139) for learning
(Note: Supervisor could also be Teacher) There is a kind of relationship that needs special handling in ______ databases, the many-to-many relationship.
One student may have many supervisors, but equally, one supervisor will have many students. This poses a problem in terms of how to represent the relationship without resorting to repeating attributes
(Note: Supervisor could also be Teacher) There is a kind of relationship that needs special handling in relational databases, the many-to-many relationship.
One student may have many supervisors, but equally, one supervisor will have many students. This poses a problem in terms of how to represent the relationship without resorting to repeating attributes
If you find yourself wanting to put repeating attributes in a table, then it is a sure sign that there is something wrong with your ____ ________.
Imagine the complications here if the Supervisors table were to list all the students taught by each supervisor: you would have to have an indeterminate number of fields: Student1, Student2, Student3, Student4, …, Student25 …
Solution?
The solution is to provide a third linking table, one which simply lists pairs of supervisors and supervisees.
In relational databases, many-to-many relationships always require a third linking table between the two entities which are linked by this kind of relationship.
Note that it doesn’t matter if a student ID or a supervisor ID appears ______, in fact that’s the whole point since a student can have many supervisors and vice versa.
There is also no record that is EXACTLY like another in this table. This table doesn’t need a ______ _____ because the pairs of IDs together each form a unique composite key.
Note that it doesn’t matter if a student ID or a supervisor ID appears twice, in fact that’s the whole point since a student can have many supervisors and vice versa.
There is also no record that is EXACTLY like another in this table. This table doesn’t need a primary key because the pairs of IDs together each form a unique composite key.
A field that uniquely identifies a record in a table.
In a students table, for instance, a key built from last name + first name might not give you a unique identifier (two or more Jane Does in the school, for example).
To uniquely identify each student, you might add a special Student ID field to be used as the _______ key.
A field that uniquely identifies a record in a table.
In a students table, for instance, a key built from last name + first name might not give you a unique identifier (two or more Jane Does in the school, for example).
To uniquely identify each student, you might add a special Student ID field to be used as the primary key.