What are Fields?

Download Report

Transcript What are Fields?

Relational Database & Key Fields
[email protected]
Before We Start !!!
Do You Understand the Following ?
Environments Where a Database is used
What is a Database?
What are Tables?
What is a record made up of?
What are Fields?
What are Field Types?
What is a Key Field?
What are Queries?
Why do we use Forms?
What is a Report?
Create Database/Queries and Reports
A Simple Database
Database name = people
Table is called Friends which holds many records
No Key Field
1 Table
Lastname
Firstname
Record
Phone Number
Email
Street
City
Prov
Postal code
Fields
Pieces of information
That make up a persons
Record.
A Simple Database
Database name = people
Table is called Friends which holds many records
ACCNO
Adding a Key Field will make
Each record unique.
Lastname
Firstname
Record
Phone Number
Email
Street
City
Prov
Postal code
Fields
Pieces of information
That make up a persons
Record.
Video Store
Customer Table
Video Table
custnum
ID (access creates)
Last_name
custnum
First_name
Street
Video name
City
Date_rented
Prov
Return_date
PC
One to many Relationship
One customer can have many video rentals
Relational Database
Video Store
Customer Table
Video Table
100
1 100 ZORRO
23-May-2011 25-May-2011
Smith
2 100 RENO
25-May-2011 27-May-2011
John
3 100 Torpedo
26-May-2011 28-May-2011
123 some ave
4 100 Earth
28-May-2011 29-May-2011
Sault ste. marie
5 100 Home
29-May-2011 31-May-2011
ontario
6 100 Planets
29-May-2011 31-May-2011
P6B 4G8
One record in the CUSTOMER table
can own many records in the video table
One to many Relationship
One customer can have many video rentals
Relational Database
What Do You Have in Your Wallet?
That Represent You In a Database
We Need to Discuss
“Key Fields”
In a Master File…What makes each record unique?
Database Name = Video Store
Customer Table
Key Field
Videos Rented Table
Custno
Custno
LastName
FirstName
Street
City
Pc
VCR’s RENTED Table
Custno
Video Name
Date Rented
VCR Serial #
Date Rented
Return Date
Return Date
Deposit Amount
Provice
Phone
Birth Date
Each Piece of Information in a Table called a FIELD
All the fields make up 1 record
You can have different Field Types - Text Field
Number Fields
Date Fields
Related Tables
Daily Transactions
Foreign key
accno
Master Table
date
accno(key)
type(ws
or dp)
last
amount
first
RSP Table
accno
date
amount
rate
street
city
pc
sin#
bdate
Loans Table
accno
date
amount
int rate
One to Many
Relationship
Another Scenario
Another Scenario
Customer Table
Key Field
Gas Appliances In Home
Custno
Serial Number
LastName
Custno
FirstName
Street
City
Pc
Work Done
Key Field
Serial Number
Date Installed
Date
Repair person
Work Done
Type of Equipment
Charge
Provice
Phone
Birth Date
One Customer in the Customer Table
can
Have many appliances in the appliance table
each appliance
Can Have many service calls
Appliances
Work Done