0 évaluation0% ont trouvé ce document utile (0 vote)
66 vues9 pages
The document describes how to create a relational database in Microsoft Access 2002 to manage a computer outlet. It involves:
1. Creating 5 tables to store customer, job, component, invoice, and technician data. Primary keys are assigned to each table.
2. Relationships are built between the tables, including one-to-many relationships between customers and jobs, jobs and components/invoices, and technicians and jobs. Referential integrity and cascading deletes are configured.
3. This establishes the database structure to later populate with data and relationships to manage the computer outlet operations.
Description originale:
database solution
Titre original
Creating a Database Solution for a Computer Outlet Part 1
The document describes how to create a relational database in Microsoft Access 2002 to manage a computer outlet. It involves:
1. Creating 5 tables to store customer, job, component, invoice, and technician data. Primary keys are assigned to each table.
2. Relationships are built between the tables, including one-to-many relationships between customers and jobs, jobs and components/invoices, and technicians and jobs. Referential integrity and cascading deletes are configured.
3. This establishes the database structure to later populate with data and relationships to manage the computer outlet operations.
The document describes how to create a relational database in Microsoft Access 2002 to manage a computer outlet. It involves:
1. Creating 5 tables to store customer, job, component, invoice, and technician data. Primary keys are assigned to each table.
2. Relationships are built between the tables, including one-to-many relationships between customers and jobs, jobs and components/invoices, and technicians and jobs. Referential integrity and cascading deletes are configured.
3. This establishes the database structure to later populate with data and relationships to manage the computer outlet operations.
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 PART 1 ACCESS 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 (,*M0) are probabl' the ost iportant ob-ects. "hese hold all of the data within the database in a structured anner. 1e shall now create our tables TABLES TO BE CREATED: Custoer 2ob 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 ,30%45 1%5,61 now opens
2 PART 1 ACCESS 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 C70"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 0a+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'
! PART 1 ACCESS 2002 NOTES CREATING A DATABASE SOLUTION FOR A COMPUTER OUTLET FIELD NAME: DATA TYPE: DESCRIPTION: J$%ID 5uber 7ni;ue 2ob Reference 5uber Custoer%, 5uber 7ni;ue Custoer Reference 5uber 2ob,ate ,ate<"ie ,ate 2ob Carried 6ut =alue%f*usiness Currenc' =alue 6f 2ob (%f *usiness Client) =alue%fConsuer Currenc' =alue 6f 2ob (%f Consuer) =alueAtCost Currenc' Cost 6f 2ob %tes%n2ob 5uber .uantit' 6f Coponents %n 2ob "echnician%, 5uber "echnician 1ho Carried 6ut 2ob 7pgrade >es<5o 1as "he 2ob An 7pgrade? /ull0'ste >es<5o 1as "he 2ob A 0ale 6f A /ull 0'ste? Repair >es<5o 1as "he 2ob A Repair? 2ob5otes Meo Rearks < Coents 6n 2ob "A*L3 5AM3$ COMPONENT # Make C$&'$()(*ID A5, 2ob%, 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 2ob Reference 5uber ,escription "e#t Coponent ,escription Cost9rice Currenc' Cost 9rice 6f Coponent 0ales9rice*usiness Currenc' 0ales 9rice (*usiness) 0ales9riceConsuer Currenc' 0ales 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 2ob%, 5uber 7ni;ue 2ob 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$ TEC.NICIAN # Make T)-/(,-,0(ID the 9riar' :e' FIELD NAME: DATA TYPE: DESCRIPTION:
@ PART 1 ACCESS 2002 NOTES CREATING A DATABASE SOLUTION FOR A COMPUTER OUTLET T)-/(,-,0(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 4oodA All of our fi+e tables are now read' for the ne#t stage. 4. Close an' tables that are still open 1. /ro the ain toolbar& click on the RELATIONS.IPS 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 been added to the RELATIONS.IPS WINDOW /ollowing the sae ethod& add the other @ tables to the relationships window JOB COMPONENT TEC.NICIAN INVOICE T.E RELATIONS.IPS WINDOW: "he relationship window now shows all fi+e tables 8 arrange the as illustrated below
C PART 1 ACCESS 2002 NOTES CREATING A DATABASE SOLUTION FOR A COMPUTER OUTLET 1e will now create relationships between the tables 8 Making this database RELATIONAL. ". /ro the CUSTOMER TABLE& click and drag the C23*$&)4ID field ONTO the C23*$&)4ID field in the JOB TABLE "he EDIT RELATIONS.IPS dialog bo# now opens. Check the ENFORCE REFERENTIAL INTEGRITY bo# (0ee notes on ne#t page) Check the CASCADE DELETE RELATED RECORDS bo# (0ee notes on ne#t page) Click the CREATE button ENFORCE REFERENTIAL INTEGRITY
D PART 1 ACCESS 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. 1. 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: 26* C6M96535" 2ob%, (/ro 2ob "able) 2ob%, (%n Coponent "able) 26* %5=6%C3 2ob%, (/ro 2ob "able) 2ob%, (%n %n+oice "able) "3CB5%C%A5 26* "echnician%, (/ro "echnician "able) "echnician%, (%n 2ob "able)
G M0(5 O() PART 1 ACCESS 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: 1hen 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 PART 1 ACCESS 2002 NOTES CREATING A DATABASE SOLUTION FOR A COMPUTER OUTLET We will: 9opulate tables with data %ntroduce data entr' ethods and more...