200 likes | 345 Views
Welcome. Nineteenth Lecture for ITEC 1010 3.0 A Professor G.E. Denzel. Go over some of the exam questions Review (again) material from Lecture 7 on relational databases. Go into more depth on some of the basics around relational databases.
E N D
Welcome Nineteenth Lecture for ITEC 1010 3.0 A Professor G.E. Denzel
Go over some of the exam questions Review (again) material from Lecture 7 on relational databases. Go into more depth on some of the basics around relational databases. Emphasize that using MS Access to do the assignment requires going through the tutorials. Agenda
Relational Data Model • Relational data model • All data elements are placed in two-dimensional tables, called relations, that are the logical equivalent of files Schematic
Data Table 2: Department Table Data Table 1: Project Table Data Table 3: Manager Table
Relational Database Terminology • Selecting • Data manipulation that eliminates rows according to certain criteria • Projecting • Data manipulation that eliminates columns in a table • Joining • Data manipulation that combines two or more tables • Linked • Related tables in a relational database together
Linking Data Tables to Answer an Inquiry Schematic
Relational Database Terminology • Relation <==> Table <==> Entity • Tuple <==> Row <==> Record • Attribute <==> Column <==> Field • Primary Key is one or more columns whose values together uniquely identify a row in a table • Normalization is the process of making the structure and contents of a database comply with some level of the Normal Form hierarchy (usually only the first three levels, but there are (at least) seven layers of increasing stringency.)
Relational Database Terminology • Why Normalization? • Ensure data consistency and stability • Minimize data redundancy • Ensure consistent updatability and maintainability of data • Avoid update/delete anomalies which result in ambiguous data or inconsistent results
Relational Database Terminology • What is a “good” way to store data?
Themes(What is wrong with this table?) • Recreation
Parent-child (master-detail) • ACTIVITY-FEE
STUDENT-ACTIVITY Plus “relationships”
It could be worse! • Recreation
Principles of a “proper” table • Property 1: Entries in columns are single-valued (atomic). • Property 2: Entries in columns are of the same kind. • Property 3: Each row is unique. • Property 4: Sequence of columns is insignificant. • Property 5: Sequence of rows is insignificant. • Property 6: Each column has a unique name.
A Better Key • STUDENT-ID
First Normal Form • Reduce entities to first normal form (1NF) by removing repeating or multivalued attributes to another, child entity.
Second Normal Form • Reduce first normal form entities to second normal form (2NF) by removing attributes that are not dependent on the whole primary key.
For more examples • http://www.15seconds.com/issue/020522.htm