Database Design (3) IS 240 – Database Management Lecture #12 – 2004-03-30 Prof. M. E. Kabay, PhD, CISSP Norwich University

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Mathematical Preliminaries
Chapter 1: The Database Environment
Chapter 7 System Models.
The Relational Model and Normalization (3) IS 240 – Database Management Lecture # Prof. M. E. Kabay, PhD, CISSP Norwich University
The Relational Model and Normalization (1)
Foundations of Relational Implementation (2) IS 240 – Database Management Lecture #14 – Prof. M. E. Kabay, PhD, CISSP Norwich University
Introduction to Database Processing IS 240 – Database Management Lecture #1 – Prof. M. E. Kabay, PhD, CISSP Norwich University
Database Design (1) IS 240 – Database Management Lecture #10 – Prof. M. E. Kabay, PhD, CISSP Norwich University
Foundations of Relational Implementation (1) IS 240 – Database Management Lecture #13 – Prof. M. E. Kabay, PhD, CISSP Norwich University
Application Design (2) Database – IS 240 Lecture #23 – M. E. Kabay, PhD, CISSP Dept of Computer Information Systems Norwich University
The Relational Model and Normalization (2) IS 240 – Database Management Lecture # Prof. M. E. Kabay, PhD, CISSP Norwich University
DB Application Design (1) IS 240 – Database Management Lecture #16 – Prof. M. E. Kabay, PhD, CISSP Norwich University
1 Copyright © 2004 M. E. Kabay. All rights reserved. Database Design (2) IS 240 – Database Management Lecture #11 – Prof. M. E. Kabay, PhD,
ATS 5A - 1 The Art of Tech Support John Abbott College How to Work with Vendor Support M. E. Kabay, PhD, CISSP Director of Education, NCSA President, JINBU.
Introduction to Database Development (1) IS 240 – Database Management Lecture #3 – Prof. M. E. Kabay, PhD, CISSP Norwich University
Managing Multi-User Databases (2) IS 240 – Database Management Lecture #19 – Prof. M. E. Kabay, PhD, CISSP Norwich University
SQL IS 240 – Database Management Lecture #15 – Prof. M. E. Kabay, PhD, CISSP Norwich University
E-R Model (1) IS 240 – Database Management Lecture #5 – Prof. M. E. Kabay, PhD, CISSP Norwich University
Working with MS-ACCESS IS 240 – Database Management Lecture #2 – Assoc. Prof. M. E. Kabay, PhD, CISSP Norwich University
Chapter 1 The Study of Body Function Image PowerPoint
Author: Graeme C. Simsion and Graham C. Witt Chapter 11 Logical Database Design.
10 Copyright © 2005, Oracle. All rights reserved. Dimensions.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
FACTORING Think Distributive property backwards Work down, Show all steps ax + ay = a(x + y)
Addition Facts
Year 6 mental test 5 second questions
Relational data integrity
Conceptual / semantic modelling
1 Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Around the World AdditionSubtraction MultiplicationDivision AdditionSubtraction MultiplicationDivision.
ZMQS ZMQS
1 CIFTlab1.2 Software for Clinical Diagnostic Laboratories 1.
Chapter 18 Methodology – Monitoring and Tuning the Operational System Transparencies © Pearson Education Limited 1995, 2005.
Data Structures: A Pseudocode Approach with C
Database Modeling Past and Present
Chapter 6 Data Design.
Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
XML and Databases Exercise Session 3 (courtesy of Ghislain Fourny/ETH)
HNDComputing – DeMontfort University  DeMontfort University 2011 Handling Many to Many relationships wk5 Database Design ConceptsDatabase Design Concepts.
Developing ER-Diagram
Squares and Square Root WALK. Solve each problem REVIEW:
the Entity-Relationship (ER) Model
Lecture plan Outline of DB design process Entity-relationship model
Executional Architecture
Chapter 5 Test Review Sections 5-1 through 5-4.
Addition 1’s to 20.
25 seconds left…...
Test B, 100 Subtraction Facts
Stephen C. Hayne 1 Database System Components The Database and the DBMS.
Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques
Week 1.
We will resume in: 25 Minutes.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 12 View Design and Integration.
Chapter 15 A Table with a View: Database Queries.
PSSA Preparation.
Chapter 11 Describing Process Specifications and Structured Decisions
Foundations of Data Structures Practical Session #7 AVL Trees 2.
1 PART 1 ILLUSTRATION OF DOCUMENTS  Brief introduction to the documents contained in the envelope  Detailed clarification of the documents content.
1 © Prentice Hall, 2002 Chapter 4: The Enhanced E-R Model and Business Rules Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Management Information Systems, 10/e
Database Design Sections 6 & 7 Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies and Recursive relationships.
Rationale Databases are an integral part of an organization. Aspiring Database Developers should be able to efficiently design and implement databases.
1 Database Design Sections 6 & 7 First Normal Form (1NF), Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies.
Presentation transcript:

Database Design (3) IS 240 – Database Management Lecture #12 – Prof. M. E. Kabay, PhD, CISSP Norwich University

2 Topics Subtypes Trees Networks Bill of Materials Surrogate Keys Null Values

3 Subtypes (1) Consider a currency-trading operation Theres a counter for walk-in anonymous clients Need only date, time, currency_in, rate, currency_out, fee; customer_ID is set to 0. People who use the service often can become regular customers and receive a monthly statement of all transactions In addition to info above, need name, customer_ID, address etc. Corporate customers have a corporate_ID and a list of authorized users Their monthly report includes a total_fees field that gives the aggregated total for all users

4 Subtypes (2) Show diagrams for the relations above as subtypes of customer Why not lump all the customers into a single relation?

5 Subtypes (2*) Show diagrams for the relations above as subtypes of customer Why not lump all the customers into a single relation? Customers Walk-inRegular IndividualCorporate

6 Subtypes (3) Show the tables you could create to represent the situation described above

7 Subtypes (3*) Show the tables you would create to represent the situation described above Cust_IDCust_info 0Walk-in 1name1 Individual Customers Cust_IDDate_etc 0… 1… Individual Transactions Corp_IDCorp_info 100corp1 200corp2 Corporate Customers Corp_IDEmpno 100emp1 200emp2 Corporate Employees Corp_IDEmpnoDate_etc 100emp1… 200emp2… Corporate Transactions

8 Trees Many systems involve hierarchical 1:N relations Administrative hierarchies Department, directorate, division, unit… Polychotomous classifications of various kinds Kingdom, phylum, class, order, family… Every element in tree is a node Top level of classification: root Parent nodes have child nodes in a branch A child node can have one and only one parent

9 Trees (contd) How can you represent the relationships in a tree? Consider a system for tracking students in college dormitories: College Dormitory Floor Room Student

10 Networks In simple networks an entity may have more than one parent The parent entities have M:N relations to the child entities Give an example of a network using doctors, nurses and patients in a health-care system

11 Network: Doctors, Nurses, Patients Draw the health-care example you have developed

12 Network: Doctors, Nurses, Patients* Draw the health-care example you have developed DoctorNursePatient Doctor-PatientNurse-Patient

13 Bill of Materials In manufacturing systems, many components may contain many parts Trying to model these relations caused headaches in the early years of DBMS design Why? Solution: treat the relation as recursive Every element is described in its own table Every relationship is described by the container and the contained elements Structure thus very simple – now draw it!

14 Bill of Materials Design

15 Bill of Materials Design* Kroenke p. 173

16 Surrogate Keys To link two relations in a relationship table, we need unique IDs What if the key we use when designing a relation is not in fact unique? What happens to our tables? What if the keys we use are very long? What about efficiency?

17 Surrogate Keys (contd) DBMS can supply a system-assigned unique identifier Typically a simple number Takes little room Easy to use in indexing Prevents duplication of keys How do we use these unique identifiers in our relationship table? Show an example with doctor/patient What is the main disadvantage of this surrogate key technique?

18 Null Values What are the possible meanings of a field that has not been filled in by a user (a null or empty field)? For inappropriate values (e.g., gender-specific attributes), should you always use subtypes? Can also assign a blank value ab initio Change blank to N/A or UNKNOWN if necessary Must handle these values in code (why?)

19 HOMEWORK Review Chapter 6 of Kroenke Prepare for next class by applying SQ3R to chapter 8 of Kroenke. REQUIRED: By Tuesday 6 April, complete and hand in answers to review questions 6.25 through 6.36 for 24 points. OPTIONAL: Also by Tuesday 6 April, for an extra 2 points each, complete any or all of Projects 6A, 6B or 6C. (More homework possibilities for extra credit on next page)

20 HOMEWORK (contd) For a 2 extra points each, complete any or all of the FiredUp projects A through D on pp To submit B you must first do A To submit D you must first do C

21 DISCUSSION