Upload
vinuye
View
221
Download
0
Embed Size (px)
Citation preview
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 1/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
1. Launch Microsoft Access 2002
Access will open as illustrated (Right)
2. Access now features a new sidebar with useful
links. Click on the BLANK DATABASE link
fro the NEW segent of the sidebar
!. "he FILE NEW
DATABASE dialog
bo# now opens
A$ %n the FILE NAME
bo#& t'pe Computer
Sales, Repairs And Upgrades
*$ %n "he SAVE TO bo#&
select where 'ou wish to
sa+e 'our database (M'
,ocuents folder etc)
C$ Click the CREATE
button
1
A
B
C
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 2/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
A database is populated b' +arious ob-ects& soe of which are listed below$
"ables
ueries
Reports /ors
Macros
"he tables in an' database anageent s'ste (,*M) are probabl' the ost
iportant ob-ects. "hese hold all of the data within the database in a structured
anner. e shall now create our tables
TABLES TO BE CREATED:
Custoer
ob
Coponent
%n+oice
"echnician
/ollow the steps below to build the tables
4. /ro the database window&
click on the TABLES option in
the OBJECTS PANEL
,ouble click on the
CREATE TABLE IN
DESIGN VIEW option
in the ain window
5. "he "A*L3 ,3%45
%5,6 now opens
2
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 3/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
Coplete the field
naes and data
t'pes as illustrated
right
6. Click into the C7"6M3R%, field
Click on the PRIMARY KEY icon on the ain
toolbar
"his will now assign the priar' ke' to the Custoer%, field
. Click on the DISC ICON on the ain toolbar&
to propt the SAVE AS DIALOG BO! to appear
a+e the table as
CUSTOMER
Close the table
". Retrace these steps to create the rest of the tables 8 /ield naes& data t'pes etc
are detailed on the ne#t page
"A*L3 5AM3$ JOB # Make J$%ID "he 9riar' :e'
!
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 4/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
FIELD NAME: DATA
TYPE:
DESCRIPTION:
J$%ID 5uber 7ni;ue ob Reference 5uber
Custoer%, 5uber 7ni;ue Custoer Reference 5uber
ob,ate ,ate<"ie ,ate ob Carried 6ut
=alue%f*usiness Currenc' =alue 6f ob (%f *usiness Client)=alue%fConsuer Currenc' =alue 6f ob (%f Consuer)
=alueAtCost Currenc' Cost 6f ob
%tes%nob 5uber uantit' 6f Coponents %n ob
"echnician%, 5uber "echnician ho Carried 6ut ob
7pgrade >es<5o as "he ob An 7pgrade?
/ull'ste >es<5o as "he ob A ale 6f A /ull 'ste?
Repair >es<5o as "he ob A Repair?
ob5otes Meo Rearks < Coents 6n ob
"A*L3 5AM3$ COMPONENT # Make C$&'$()(*ID A5, ob%, dual 9riar'
:e's 8 Action this b' highlighting both rows at the sae tie and clicking the
9riar' :e' icon as usual. "his is also referred to as a COMPOSITE KEY
FIELD NAME: DATA
TYPE:
DESCRIPTION:
C$&'$()(*ID 5uber 7ni;ue Coponent Reference 5uber
J$%ID 5uber 7ni;ue ob Reference 5uber
,escription "e#t Coponent ,escription
Cost9rice Currenc' Cost 9rice 6f Coponent
ales9rice*usiness Currenc' ales 9rice (*usiness)ales9riceConsuer Currenc' ales 9rice (Consuer)
Coponent5otes Meo Rearks < Coents 6n Coponent
"A*L3 5AM3$ INVOICE # Make I(+$,-)ID the 9riar' :e'
FIELD NAME: DATA
TYPE:
DESCRIPTION:
I(+$,-)ID Auto5uber 7ni;ue %n+oice Reference 5uber
ob%, 5uber 7ni;ue ob Reference 5uber
Custoer%, 5uber 7ni;ue Custoer Reference 5uber %n+oice"otal Currenc' "otal =alue 6f %n+oice
%n+oice5otes Meo Rearks < Coents 6n %n+oice
"A*L3 5AM3$ TECNICIAN # Make T)-/(,-,(ID the 9riar' :e'
FIELD NAME: DATATYPE:
DESCRIPTION:
@
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 5/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
T)-/(,-,(ID 5uber 7ni;ue "echnician %.,. 5uber
"itle "e#t Mr& Mrs& Miss& Ms.
/irst5ae "e#t "echnician /irst 5ae
Last5ae "e#t "echnician Last 5ae
4ood All of our fi+e tables are now read' for the ne#t stage.
4. Close an' tables that are still open
. /ro the ain toolbar& click on the
RELATIONSIPS icon
10. "he show table dialog bo#
now opens
5. Click on the TABLES tab
6. Bighlight the CUSTOMER
table
. Click the ADD button
6ur Custoer table has now beenadded to the RELATIONSIPS
WINDOW
/ollowing the sae ethod& add the other @ tables to the relationships window
JOB
COMPONENT
TECNICIAN
INVOICE
TE RELATIONSIPS WINDOW:
"he relationship window now shows all fi+e tables 8 arrange the as illustrated
below
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 6/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
e will now create relationships between the tables 8 Making this database
RELATIONAL.
". /ro the CUSTOMER TABLE& click and drag the C3*$&)ID field
ONTO the C3*$&)ID field in the JOB TABLE
"he EDIT
RELATIONSIPS dialog bo# now opens.
Check the ENFORCE
REFERENTIAL
INTEGRITY bo#
(ee notes on ne#t page)
Check the CASCADE
DELETE RELATED
RECORDS bo#
(ee notes on ne#t page)
Click the CREATE button
ENFORCE REFERENTIAL INTEGRITY
D
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 7/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
*' checking this bo#& we are asking Microsoft Access to ensure all entries < input data
are +alid. 3#aple$ %f no custoer e#ists with an %, nuber EE& a -ob cannot be
attributed to this account.
CASCADE DELETE RELATED RECORDS
"his option is checked to ensure that when a custoer is reo+ed fro the databaseF
all related records are deleted also. "his keeps the database tid' and reo+es an'
redundant data.
. As 'ou can see fro the illustration
(right)& a ONE#TO#MANY
relationship has been created
between our two tables (6ne
custoer can ha+e an' -obs etc)
7sing the sae ethod& create further
relationships as detailed below$
JOIN TABLE: TO TABLE: BY DRAGGING: AND DROPPING
ONTO:
6* C6M96535" ob%, (/ro ob
"able)
ob%, (%n
Coponent "able)
6* %5=6%C3 ob%, (/ro ob
"able)
ob%, (%n %n+oice
"able)
"3CB5%C%A5 6* "echnician%,
(/ro "echnician
"able)
"echnician%, (%n
ob "able)
G
M(O()
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 8/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
All of our relationships ha+e now been created 8 see the re+ised relationship window
illustrated on the ne#t page
As 'ou can see& all of our relationships are ONE#TO#MANY. Close the relationships
window and sa+e the changes when propted.
NOTE: hen creating 653H"6HMA5> relationships& it is iportant that 'ou alwa's
drag the ONE side onto the MANY side 8 not the other wa' around.
Although it is not 'et populated with data 8 or an' ob-ects& we ha+e created a
relational database.
We have:
• Created a blank database
• Created tables with +arious field naes and data t'pes
• Assigned 9riar' :e's
• Assigned a Coposite :e'
• Created oneHtoHan' relationships between tables
• 3nforced Referential %ntegrit'
• Cascaded ,elete Records
• Created a relational database
I
IN SUMMARY
IN PART 2
8/12/2019 Creating a Database Solution for a Computer Outlet Part 1
http://slidepdf.com/reader/full/creating-a-database-solution-for-a-computer-outlet-part-1 9/9
PART 1ACCESS 2002 NOTES
CREATING A DATABASE SOLUTION
FOR A COMPUTER OUTLET
We will:
• 9opulate tables with data
• %ntroduce data entr' ethods
• and more...
E