Tuesday, February 1, Management of Information Systems: Mini-3 Spring 2000
Tuesday, February 1, Agenda Announcements Technology Byte Presentations Designing and Creating Databases (Cont’d) Brief Review of Database Design Principles Using MS Access 2000 to Create Relational Databases Writing Queries for Relational Databases Using MS Access 2000 to Write Queries for Relational Databases
Tuesday, February 1, Announcements Technology Byte Presentations Today (2/1): Section A: DeathSpiral.Com, E-Sixpack Section B: Jeree’s Kids, Hot TaMaLes Thursday (2/3): Section A: Digital Agents, Hyperlinks Section B: Alwin & the Chipmunks, Cash Money Brothers IT Exercise I Graded/Returned Comments
Tuesday, February 1, Announcements Schedule modifications There will be NO handout on Internet, Intranets, Extranets Today we will continue with Database topics We will discuss Chapter 6 on Thursday (2/3) IT Exercise II due no later than midnight this Friday, 2/4/00 Submit one set of answers for your team You can to me as an MS Word attachment or submit as hard copy
Tuesday, February 1, Announcements Technology Byte Report Due on no later than midnight this Friday, 2/4/00 Submit as a web page linked to your team’s home page that you had created in the first IT exercise
Tuesday, February 1, Technology Byte Presentations Section A: DeathSpiral.Com E-Sixpack Section B: Jeree’s Kids Hot TaMaLes
Tuesday, February 1, Creating Relational Databases: Brief Review What is a relational database Going from a “flat” file to a relational database…..
Tuesday, February 1, A Traditional “Flat” File
Tuesday, February 1, Relational DataBase Faculty Table Dept Table Course Table
Tuesday, February 1, How to get from a flat file to a relational database? Identify Entities (Tables) Identify Attributes (Fields) Normalize Entities Identify Relationships between Normalized Entities Identify Primary and Foreign Keys
Tuesday, February 1, EXAMPLE #1: Department DB Data include: n Department Name n Department Chair n Department Address n Department Phone n Faculty ID # n Faculty Name n Faculty Rank n Course Name n Course # n Course Credits n Course Enrollment Capacity
Tuesday, February 1, Step#1: Pull out repeating groups (First Normal Form) Step#1: Pull out repeating groups (First Normal Form) FROM: Department (Dept-Name, Dept-Chair, Dept-Addr, Dept-Phone, Fac-ID, Fac-Name, Fac-Rank, Course-Name, Course#, Course-Cred, Course-Cap) TO: Department (Dept-Name, Dept-Chair, Dept-Addr, Dept-Phone) Faculty-Course (Fac-ID, Fac-Name, Fac-Rank, Course-Name, Course#, Course-Cred, Course-Cap)
Tuesday, February 1, Step#2: Pull out facts about a portion of the key (Second Normal Form) Step#2: Pull out facts about a portion of the key (Second Normal Form) Doesn’t apply here?
Tuesday, February 1, Step#3: Pull out facts about a non-key attribute (Third Normal Form) Step#3: Pull out facts about a non-key attribute (Third Normal Form) FROM: Faculty-Course (Fac-ID, Fac-Name, Fac-Rank, Course-Name, Course#, Course-Cred, Course-Cap) TO: Faculty (Fac-ID, Fac-Name, Fac-Rank) Course (Course-Name, Course#, Course-Cred, Course-Cap)
Tuesday, February 1, Normalized Relations for this Data Department (Dept-Name, Dept-Chair, Dept-Addr, Dept- Phone) Faculty (Fac-ID, Fac-Name, Fac-Rank, Fac-Dept) Course (Course-Name, Course#, Course-Cred, Course-Cap, Course-Fac)
Tuesday, February 1, From Normalized Relations to an Entity Relationship Diagram each normalized relation becomes an entity identifier of each normalized relation becomes the primary key secondary identifier of each normalized relation becomes a foreign key Characteristics of each normalized relation determine relationship between entities
Tuesday, February 1, Entity Relationship Diagram Example #1 Department Course Faculty (Fac-ID, Fac-Name, Fac-Rank, Fac-Dept) (Dept-Name, Dept-Chair, Dept-Addr, Dept-Phone) (Course#, Course-Name, Course-Cred, Course-Cap, Course-Fac)
Tuesday, February 1, From an ERD to a Database in MS Access 2000 Adding Tables, Relationships and Data By hand Importing from spreadsheet Important! Must use normalized tables, relationships and data when creating the database in MS Access Illustration for Example 1 See Data for IT Exercise II and MS Access Tips 1
Tuesday, February 1, Retrieving Data from Databases Selecting Relations Joining Relations Projecting columns (fields) from the joined relation Selecting rows (records) from the joined relation
Tuesday, February 1, Retrieving Data from Databases (Cont’d) Deriving new attributes Indexing/sorting rows (records) Calculating totals Presenting data
Tuesday, February 1, Writing Queries in MS Access 2000 See MS Access Tips 2 Simple queries Grouping, summing & sorting fields Selecting data Calculated fields Displaying/not displaying fields Make vs. Select Table queries Illustrative Examples
Tuesday, February 1, Designing Databases: Another Example Normalizing and creating an ERD for the Sales Report Data
Tuesday, February 1, EXAMPLE #2: Sales Report Data Data includes: n Sales Person # n Sales Person Name n Sales Area n Customer Name n Customer Number n Warehouse Number n Warehouse Location n Sales Amount
Tuesday, February 1, Step#1: Pull out repeating groups (First Normal Form) Step#1: Pull out repeating groups (First Normal Form) FROM: SalesReport (SalesPerson#, SalesPerson-Name, Sales-Area, Customer#, Customer-Name, Warehouse#, Warehouse-Location, Sales-Amount) TO: SalesPerson (SalesPerson#, SalesPerson-Name, Sales-Area) SalesPerson-Customer (SalesPerson#, Customer#, Customer-Name, Warehouse#, Warehouse-Location, Sales-Amount)
Tuesday, February 1, Step#2: Pull out facts about a portion of the key (Second Normal Form) Step#2: Pull out facts about a portion of the key (Second Normal Form) FROM: SalesPerson-Customer (SalesPerson#, Customer#, Customer-Name, Warehouse#, Warehouse-Location, Sales-Amount) TO: Sales (SalesPerson#, Customer#, Sales-Amount) Customer-Warehouse (Customer#, Customer-Name, Warehouse#, Warehouse-Location)
Tuesday, February 1, Step#3: Pull out facts about a non-key attribute (Third Normal Form) Step#3: Pull out facts about a non-key attribute (Third Normal Form) FROM: Customer-Warehouse (Customer#, Customer-Name, Warehouse#, Warehouse-Location) TO: Customer (Customer#, Customer-Name) Warehouse (Warehouse#, Warehouse-Location)
Tuesday, February 1, Normalized Relations for this Data Sales (SalesPerson#, Customer#, Sales-Amount) SalesPerson (SalesPerson#, SalesPerson-Name, Sales-Area) Customer (Customer#, Customer-Name, Warehouse#) Warehouse (Warehouse#, Warehouse-Location)
Tuesday, February 1, Entity Relationship Diagram Example SalesPerson Customer Warehouse Sales (SalesPerson#, Customer#, Sales-Amount) (SalesPerson#, SalesPerson-Name, Sales-Area) (Customer#, Customer-Name, Warehouse#) (Warehouse#, Warehouse-Location)