02_IntroAccess&DM
Download
Report
Transcript 02_IntroAccess&DM
Intro to Access and Data
Management
Announcements
• Chapter 5 – Thursday
• Entropy Registration Quiz Due Date
• Extended to Weds.
• Dreamspark Registration
• Questions?
The Database Approach
Database management system (DBMS)
Minimize the following problems:
Maximize the following:
How is data organized in a DB:
Data Hierarchy
Field
Is a grouping of
Record
Is a grouping of
File (or table)
Is a grouping of
Database
Data Hierarchy (continued)
Field
Table
Database
Record
Database Management Systems
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)
Steps in Creating Databases
1. Create the Tables
Including a primary key
2. Create the Relationships between Tables
3. Enter data into the Tables
Create the Tables
Tables are how information are stored within the
database.
When creating tables, you have to define:
Field Name
Data Type
Field Size
Create the Tables - Tips
Consider the type of data you are entering to
determine what the data type and size should be.
Make sure when you setup foreign keys that they
are the same type/size as the primary
Most frequently, you will be using the text for type
Numbers are typically used for fields where
calculations will be used
Date/Time
Don’t forget to set a primary key
Create the Relationships
To create information in a database, you must
have relationships between tables.
Tips:
Close all your tables before creating relationships
Entering Data
To enter data, you need to be Datasheet View and
you enter it like any other program
Once you go to the next row, the previous row is
saved in the table.
Exercise #1 – Car Parts Store
Create a new DB called ServiceShop that
will consist of two tables.
Cars
Parts
Exercise #1 – Car Parts Store
Cars
VehicleID
VehicleName
Manufacturer
VehicleYear
VehicleType
Data_Type
Field Size
Text
Text
Text
Text
Text
5
50
50
4
20
Part
PartID
PartName
VehicleID
Cost
Data_Type
Field Size
Text
Text
Text
?
5
50
?
Exercise #1 – Create Relationships
Create the appropriate relationships for
the tables in your database.
Cars (VehicleID) -> Parts (VehicleID)
Exercise #1 – Enter Information
VehicleID
VehicleName Manufacturer VehicleYear
VehicleType
00001
Avalon
Toyota
1999
Sedan
00002
Camry
Toyota
2005
Sedan
00003
Tundra
Toyota
2010
Truck
00004
Sienna
Toyota
2014
Minivan
PartID
11111
22222
33333
PartName
Muffler
Wipers
Transmission
VehicleID
00004
00001
00002
Cost
$150.00
$10.00
$1,000.00
Project #1 – Database Creation
Remainder of class begin working on
project #1. You should be able to
complete:
Table
Creation
Relationships
Data Entry