Intro to Access and Data Management
Announcements
• No Class – Monday
• Chapter 5 – Wednesday
• Access Tutorial & DB Creation - Friday
The Database Approach
Database management system (DBMS)
Minimize the following problems:
Maximize the following:
1. Data redundancy2. Data isolation3. Data inconsistency
1. Data security2. Data integrity3. Data independence
How is data organized in a DB:Data Hierarchy
Field
Record
File (or table)
Database
Is a grouping of
Is a grouping of
Is a grouping of
Data Hierarchy (continued)
Field
RecordDatabase
Table
Database Management Systems
Database management system (DBMS)
Focus of this course: Relational database model Related Tables (Primary Keys Important) Data dictionary
How do you request data? Structured Query Language (SQL) - keywords
Query by Example (QBE) – forms/templates
Relational DB Effectiveness: Normalization
Normalization (most streamlined DB)
Minimum redundancy
Maximum data integrity
Best processing performance
Normalized data occurs when attributes in the table depend only on the primary key.
Exercise #1 – Online Shopping DB
Create a new DB called OnlineShopping that will consist of three tables.
CustomersOrdersProducts
Exercise #1 – Online Shopping DB
Customers Data_Type Field Size
CustomerID Text 5FirstName Text 50LastName Text 100Address Text 150City Text 30State Text 2PostalCode Text Input Mask PhoneNum Text Input Mask
Products Data_Type Field Size
ProductID Text 5ProductName Text 50Category Text 50Cost ?
Orders Data_Type
Field Size
OrderNo ? CustomerID ? ?ProductID ? ?OrderDate ?
Exercise #1 – Online Shopping DB
Create the appropriate relationships for the tables in your database.
Customers -> OrderProducts -> Order
Exercise #1 – Online Shopping DB
Enter information into tables.
CustomersCustomerID FirstName LastName Address CIty State PostalCode PhoneNumber
1111 Michael Jordan 123 Anywhere Rd Wilmington NC 28401 (910) 555-5555
2222 Larry Bird 456 Somewhere St French Lick IN 47432 (812) 555-5555
3333 Irvin Johnson 789 Nowhere Ave Los Angeles CA 90001 (213) 555-5555
ProductsProductID ProductName Category Cost
00001 Basketball Sporting Goods $25.00
00002 Shorts Apparel $20.00
00003 Shoes Apparel $75.00
Orders
OrderNo CustomerID ProductID OrderDate
1 1111 00002 9 /18/2012
2 2222 00001 9 /18/2012
3 3333 00003 9 /18/2012
4 1111 00001 9 /20/2012
autonumber
Exercise #1 – Online Shopping DB
Create a query to answer the following question:
What is the total amount spent on all orders by each customer?