110 likes | 244 Views
CSCI N207 Data Analysis Using Spreadsheets. 5 . Database Design. Lingma Acheson Department of Computer and Information Science IUPUI. What Design is About. You are hired by a small business, and are asked to build a database system. How would you proceed?
E N D
CSCI N207 Data Analysis Using Spreadsheets 5. Database Design Lingma Acheson Department of Computer and Information Science IUPUI
What Design is About • You are hired by a small business, and are asked to build a database system. How would you proceed? • There is no data to start with . • Process: • Collect requirements • Interview potential users • Collect sample forms, reports, description of activities • Understand business rules and the nature of data
What Design is About • Design the database • Sketch out the design • Document the design • Envision the future system • Create prototypes (small sample database) • Get feedbacks from the users • Implement the database
Data Normalization • Must know before starting the design! • Different levels of normalization determines how good your table design is. • Relational model revisit:
First Normal Form (1NF) E.g., Create tables to describe the students, advisors and registration information as below:
First Normal Form (1NF) • First Normal Form: No repeating fields Table: REGISTRATION Problem - If we change the room of Jones, we must change it in several places.
Second Normal Form (2NF) • Second Normal Form: Eliminate redundant data Table: REGISTRATION Table: STUDENT_ADVISOR Problem - If we remove one advisor, we will lose a student.
Third Normal Form (3NF) • Third Normal Form: Eliminate data not dependant on key Table: STUDENT Table: REGISTRATION Table: ADVISOR
Third Normal Form (3NF) • Third Normal Form requires creation of primary key and foreign key relationships. • Tables in a certain normalization level must satisfy the requirements of previous levels.
Third Normal Form (3NF) • Fully normalized tables: Table: STUDENT Table: REGISTRATION Table: ADVISOR Table: CLASS
Fourth & Fifth Normal Form • Further normalize the table, not covered in our class.