220 likes | 349 Views
Define Objectives Analyze the Current Database Define Table Structures Establish Table Relationships. Define Business Rules Determine and Establish Views Review Data Integrity. The Design Process. 1. Define Objectives. Mission Statement
E N D
Define Objectives Analyze the Current Database Define Table Structures Establish Table Relationships Define Business Rules Determine and Establish Views Review Data Integrity The Design Process
1. Define Objectives • Mission Statement • A succinct statement in general terms describing the purpose of the database • New Starz Talent Agency • Mission Objectives • A series of statements describing general tasks that the user can perform with the database. • They support the mission statement and help the designer to determine the various aspects of the database • New Starz Talent Agency
Mission StatementNew Starz Talent Agency • The purpose of the New Starz Talent Agency database is to maintain the data in order to supply information that supports the engagement services we provide to our clients and the management services we provide to our entertainers. Back
Mission ObjectivesNew Starz Talent Agency • Maintain information for our clients that ask for entertainment engagements. • Maintain complete entertainer information. • Keep track of all the engagements we book. Back
2. Analyze the Current Database • Interview management and users • Find out what kind of data is being used • Find out how they are collected and handled on a daily basis • Compile list of fields and calculated fields • This list serves as a starting point for building tables, then the database
3. Define Tables Structures • Determine entities • Identify their attributes • Define tables and fields • Establish keys • Define field specifications • Make sure that a table represents one entity (subject) with no duplicate fields
4. Establish Table Relationships • Determine which tables are directly related • Determine type of relationship--one-to many, one-to-one, many-to-many • In the case of many-to-many, use a link table
5. Define Business Rules • E.g.: • Use 2-letter abbreviation for state name • shipDate must be later than orderDate • daytimePhone number is required • An agent can handle a maximum of 20 clients • An employee salary cannot be more than $100,000
6. Determine Views • Some views users need to see: • Specific information from a single table • Specific information obtained from several tables • Summaries from several tables • Create Queries • What are the questions that the user wants answered?
Queries • Which books are $25 or less? • What is the phone number of publisher Big House? • What is the phone number of Melville? • Who publishes the book Macbeth? • All books published by Big House over $20.00 • All books written by Shakespeare and their publisher
7. Review Data Integrity • At table level, make sure each record is unique. • At the field level, check all field are specifications • At relationship level, check that relationships are valid, that there are no many-to-many, etc.
Keys • Candidate Keys • Primary Keys • Foreign Keys
Candidate Keys • Field or set of fields that uniquely indentifies each record in the table • Must contain unique values • Cannot be null • Primary key will be chosen from these
“Artificial” Candidate Key • Created if none of the fields qualify as candidate key • Or, if other candidate keys are complicated • Or, for efficiency (e.g., 5-digit number takes less time to compare than a 5-digit text)
Primary Key • Chosen from Candidate Keys • Choose the “simplest” key.
Elements of a Primary Key • Uniquely identifies each record in table • Contains unique values • Cannot be null • Contains minimum number of fields necessary to define uniqueness • Not optional • Its value should not be modified, except in rare cases
Foreign Key • A Primary Key from one table becomes a Foreign key another table when that field is used to established a relationship between two tables. • While a Primary Key in a table has unique values, Foreign Key values are repeated.
Foreign Key BuildingsbldNumber PK bldFloors bldElevator bldParking RoomsrmNumber PK bldNumber FK rmType rmSize rmPone 1 N
Elements of a Foreign Key • Has the same name as the Primary Key from which it is copied (usually) • Has the same type as the Primary Key from which it is copied