Presentation is loading. Please wait.

Presentation is loading. Please wait.

5. Database Design Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis Using Spreadsheets 1.

Similar presentations


Presentation on theme: "5. Database Design Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis Using Spreadsheets 1."— Presentation transcript:

1 5. Database Design Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis Using Spreadsheets 1

2 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 2

3 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 3

4 Data Normalization Must know before starting the design! Different levels of normalization determines how good your table design is. Relational model revisit: 4

5 First Normal Form (1NF) E.g., Create tables to describe the students, advisors and registration information as below: 5 StudentNoAdvisorAdvRoomClass1Class2Class3 1022Jones412101-07143-01159-02 4123Smith216201-01101-07214-01

6 First Normal Form (1NF) First Normal Form: No repeating fields Table: REGISTRATION 6 StudentNoAdvisorAdvRoomClassNo 1022Jones412101-07 1022Jones412143-01 1022Jones412159-02 4123Smith216201-01 4123Smith216101-07 4123Smith216214-01 Problem - If we change the room of Jones, we must change it in several places.

7 Second Normal Form (2NF) Second Normal Form: Eliminate redundant data Table: REGISTRATION Table: STUDENT_ADVISOR 7 ClassNoStudentNo 101-071022 143-011022 159-021022 201-014123 101-074123 214-014123 StudentNoAdvisorAdvRoom 1022Jones412 4123Smith216 Problem - If we remove one advisor, we will lose a student.

8 Third Normal Form (3NF) Third Normal Form: Eliminate data not dependant on key Table: STUDENT Table: REGISTRATION Table: ADVISOR 8 ClassNoStudentNo 101-071022 143-011022 159-021022 201-014123 101-074123 214-014123 StudentNoAdvisor 1022Jones 4123Smith AdvisorAdvRoom Jones412 Smith216

9 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. 9

10 Third Normal Form (3NF) Fully normalized tables: Table: STUDENT Table: REGISTRATION Table: ADVISOR Table: CLASS 10 ClassIDStuID 11 21 31 42 12 52 StudentNoAdvID 110221 241232 AdvIDAdvisorAdvRoom 1Jones412 2Smith216 ClassIDClassNoTitle 1101-07Java Programming 2143-01Databases 3159-02Excel Spreadsheets 4201-01Web Development 5214-01Data Mining

11 Fourth & Fifth Normal Form Further normalize the table, not covered in our class. 11


Download ppt "5. Database Design Lingma Acheson Department of Computer and Information Science IUPUI CSCI N207 Data Analysis Using Spreadsheets 1."

Similar presentations


Ads by Google