SlideShare a Scribd company logo
1 of 14
CS1100: Access Lab 1
Creating and Querying Databases
To complete this assignment you must submit an electronic
copy to Blackboard by the due date.
You will be creating your own database, so there is no starter
file for this lab. In this lab you are
asked to create a new database for inventory management of a
small computer reseller, populate
the database with sample data and formulate queries to retrieve
data.
Creating the Database
The founding of WizBang Computers, LLC is the dream of
Jason Dunn, a long time computer
enthusiast. He finally has enough business customers to make
his side venture a full time job. His
goal is to build WizBang into the premier reseller and servicer
of business computers for small to
mid-size firms. As his sales of custom-built PCs have taken off,
Jason realizes that he needs a
better inventory management tool than the Excel spreadsheet he
has been using thus far.
However, Jason is too busy providing on-site support services
for his clients and therefore has
hired you to build an Access database for WizBang that will
allow him to track his inventory,
customer contacts, and orders. Eventually, the data will not only
help him manage his inventory
better, but also provide insight into sales for better sales
forecasting and inventory planning.
Planning the Tables
A database development effort starts with an analysis of the
data that needs to be stored.
Commonly a data model is constructed to assist with this effort.
So far, the following tables have
been identified as being important:
Table Name Content
Contacts Information about customers
Products Information about products available for sale
Orders Information about orders placed by customers
ZipCodes Cities and states and their associated zip code
LineItems Lists of products and the orders in which they were
ordered
1. Start Microsoft Access and create a blank database by
selecting “Blank database” from
the list of available templates.
2. Name your database using the following naming rule:
Orders_Lastname,
e.g., Orders_Smith
LabA1 CS1100
2 of 8
3. Note the location of the database (remember the folder in
which it was saved; most likely
the Documents folder.) Lastly, click on Create to create the
database. Note that data is
automatically saved as soon as you change something in Access;
there is no separate
Save mechanism.
4. Access will automatically create your first table under the
temporary name “Table1”.
Before you can rename the table, we need to first define its
columns (i.e., its data content)
and then close the table. We will start by creating the Contacts
table as follows:
a. Switch to table design, by clicking on the Design View icon.
When prompted,
save the table under the name “Contacts”.
b. Define the fields of the Contacts table as follows:
c. Now create the Products table by selecting the Create tab
and clicking on Table.
Once again, switch to the Design View by clicking on the
Design View icon.
When prompted, save the table under the name “Products”.
Define the table as
follows:
d. Follow the same process to create the Orders, LineItems,
and ZipCodes tables.
The definitions of the tables are below:
LabA1 CS1100
3 of 8
e. When done, close all of your tables, by clicking the right
mouse button on any of
the table tabs and selecting “Close All”. You will be prompted
to save the tables.
Choose “Yes” for all of them.
Populating the Database
Now that the database has been created, we need to put data into
the database. This is often done
by loading an Excel table containing data into the database or
by writing a nice user interface
that users can use to type in the data. In our case, we will
populate the data by using the Access
table data entry tool.
1. Let’s start by adding a few of our contacts’ information into
the Contacts table. Double-
click on the Contacts table in the Tables browser. That will
bring up the table entry sheet.
Here’s what it should look like:
2. Enter the following data into the table sheet view. Note that
you DO NOT enter any
value for the ContactID field. That field is an auto number field
that is automatically
filled in by Access.
LabA1 CS1100
4 of 8
Note that we don’t store where the customer lives; we only store
the zip code. The actual city
and state is stored in the ZipCodes tables which this table
references.
As the fourth contact enter your own name, address, and phone
number. To protect your
privacy, you may add a fictitious address and phone but you
must enter your correct
name and you must provide some kind of address. (Your zip
code should be added to
the zip code table as well.)
3. Follow the same procedure to continue with your data entry
by adding the following data
to the other tables:
This table is important as it establishes which customer placed
which order. For example,
order number 1 was placed by contact 1 (Peter Levoy) on
4/1/2011. In fact, Peter also
placed orders 2 and 4, while orders 3, 5, and 6 were all placed
by contact 2 (Jane Wu).
What exactly was ordered as part of each order, how much of it,
and how much was
actually charged to the customer is stored in the LineItems
table. We do this so that there
is no redundantly stored information in our database. Here is the
LineItems table:
LabA1 CS1100
5 of 8
Establishing Relationships
In order for our queries to be properly executed by Access, we
need to tell Access how we have
linked the information in the different tables. For example,
Contacts and ZipCodes are linked. So
are Orders and Contacts, as well as LineItems with Orders and
Products.
To define the relationships, we need to close all of our tables in
the table view and then switch to
the Database Tools view.
Once you click on the Relationships tool, you get a list of tables
for which you can establish
relationships. Select all of them and then click Add and then
Close. You can also add each table
one by one.
LabA1 CS1100
6 of 8
Now we are ready to create the relationships. To do so, click on
the field of one table that points
to another table and then drag the line towards the other table
and drop if off over the field that is
the linked field. For example, to create the relationship between
Contacts and ZipCodes, click
on the ZipCode field of the ZipCodes table and then drop that
field off on top of the ZipCode
field of the Contacts table. It’s important that it is done in that
order! You will then see a line
between the linked fields.
Establish the following relationships:
• ContactID in Contacts to ContactID in Orders
• ZipCode in ZipCodes to ZipCode in Contacts
• ProductID in Products to ProductID in LineItems
• OrderID in Orders to OrderID in LineItems
Here’s the resulting relationship model:
LabA1 CS1100
7 of 8
The database is now fully defined and populated with a little bit
of data. Now we are ready to do
some sample queries.
Querying the Database
To create a query, select the Create tab and then pick the Query
Design tool. Close the resulting
dialog without picking any tables.
To create each query, drag the needed tables into the query
designer and then drag the
appropriate fields into the columns list. Specify any GROUP BY
or WHERE clauses as needed.
Name each query with the pattern: QLastnameX, where
Lastname is your last name and X is
the question number, e.g., QSmith1.
1. Create a query that lists all of the customers’ first and last
names regardless of
whether they placed an order or not. Hint: Your name must
appear in the result.
2. Create a query that lists all of the customers’ first and last
names plus their address
with the street, city, state, and zip code. The result should
contain all customers
regardless of whether they placed an order or not.
LabA1 CS1100
8 of 8
3. Create a query that lists the Order IDs of all of the orders
placed by “Jane Wu”.
Use the information given (first and last name) and not
ContactID. Remove any
duplicates.
4. Create a query that lists the PriceCharged for Windows 7.
List the ProductID,
ProductName and PriceCharged. (Note that PriceCharged is
different from RetailPrice.)
5. Create a query that lists what products were ordered on
4/19/2011. List the last name
of the customer, the order date, product id and product name.
Remove any duplicates.
6. Create a query that lists all the first and last names of all
customers who placed at
least one order. Remove any duplicates.
7. Create a query that lists all the products that have a retail
price of more than $100.
List the product ID and the product name and the retail price.
8. Create a query that retrieves the name (first and last),
address, city, state, and zip code
of the contact with ID=4 (or whichever contact ID is your own
name.)
Grading Rubric
This rubric is intended to guide graders in their evaluation of
the students’ submissions.
Criterion Discussion Grading
Tables not correct All tables must have the correct
names and attributes (columns or
fields)
-5% for each table that is
incorrectly named (including
spelling mistakes)
-5% for each table that contains
an attribute with the incorrect
name or datatype
Queries produce correct
output and are designed
correctly
Each query must produce the
correct result.
-5% for each query that does not
produce correct result or is not
designed to produce correct
output for all data possibilities
Relationships not correct All relationships must be defined
correctly and connect the right
attributes, i.e., primary
key/foreign key pairs
-2% for each incorrect
relationship
Data not correct All data must be entered as
specified
-1% for each record or field that
is not correctly entered
Queries not named correctly Queries should be named as
QLastnameX, where Lastname is
the student’s last name and X is the
query number.
-10%
CS1100 Access Lab 1  Creating and Querying Database.docx

More Related Content

Similar to CS1100 Access Lab 1 Creating and Querying Database.docx

Part 2Provider Database (MS Access)Use the project descriptio.docx
Part 2Provider Database (MS Access)Use the project descriptio.docxPart 2Provider Database (MS Access)Use the project descriptio.docx
Part 2Provider Database (MS Access)Use the project descriptio.docxdunnramage
 
- Database Design and ImplementationProducts on Sale Database fo.docx
- Database Design and ImplementationProducts on Sale Database fo.docx- Database Design and ImplementationProducts on Sale Database fo.docx
- Database Design and ImplementationProducts on Sale Database fo.docxgertrudebellgrove
 
Exp19_Access_Ch02_Capstone - International Foodies 1.0Projec.docx
Exp19_Access_Ch02_Capstone - International Foodies 1.0Projec.docxExp19_Access_Ch02_Capstone - International Foodies 1.0Projec.docx
Exp19_Access_Ch02_Capstone - International Foodies 1.0Projec.docxdelciegreeks
 
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docxPart 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docxhoney690131
 
CIS 3100 - Database Design and ImplementationScoring Rubric.docx
CIS 3100 - Database Design and ImplementationScoring Rubric.docxCIS 3100 - Database Design and ImplementationScoring Rubric.docx
CIS 3100 - Database Design and ImplementationScoring Rubric.docxmccormicknadine86
 
Part 2Provider Database (MS Access)For a review of the complete r.docx
Part 2Provider Database (MS Access)For a review of the complete r.docxPart 2Provider Database (MS Access)For a review of the complete r.docx
Part 2Provider Database (MS Access)For a review of the complete r.docxherbertwilson5999
 
Product Supplier59,58,8,2.50CIS 3100 - Database Desig.docx
Product Supplier59,58,8,2.50CIS 3100 - Database Desig.docxProduct Supplier59,58,8,2.50CIS 3100 - Database Desig.docx
Product Supplier59,58,8,2.50CIS 3100 - Database Desig.docxstilliegeorgiana
 
Access2003
Access2003Access2003
Access2003mrh1222
 
Access2003
Access2003Access2003
Access2003tanik363
 
10359485
1035948510359485
10359485kavumo
 
Part 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxPart 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxdanhaley45372
 
Part 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxPart 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxherbertwilson5999
 
Acccesss notes
Acccesss notesAcccesss notes
Acccesss notesart02
 
access1.ppt
access1.pptaccess1.ppt
access1.pptmayada34
 
Access Basics 01
Access Basics 01Access Basics 01
Access Basics 01Lets try
 
Access2007 part1
Access2007 part1Access2007 part1
Access2007 part1jigeno
 
CIS 310 ACCESS AssignmentObjective of this assignment is to pr.docx
CIS 310 ACCESS AssignmentObjective of this assignment is to pr.docxCIS 310 ACCESS AssignmentObjective of this assignment is to pr.docx
CIS 310 ACCESS AssignmentObjective of this assignment is to pr.docxclarebernice
 

Similar to CS1100 Access Lab 1 Creating and Querying Database.docx (20)

Part 2Provider Database (MS Access)Use the project descriptio.docx
Part 2Provider Database (MS Access)Use the project descriptio.docxPart 2Provider Database (MS Access)Use the project descriptio.docx
Part 2Provider Database (MS Access)Use the project descriptio.docx
 
- Database Design and ImplementationProducts on Sale Database fo.docx
- Database Design and ImplementationProducts on Sale Database fo.docx- Database Design and ImplementationProducts on Sale Database fo.docx
- Database Design and ImplementationProducts on Sale Database fo.docx
 
Exp19_Access_Ch02_Capstone - International Foodies 1.0Projec.docx
Exp19_Access_Ch02_Capstone - International Foodies 1.0Projec.docxExp19_Access_Ch02_Capstone - International Foodies 1.0Projec.docx
Exp19_Access_Ch02_Capstone - International Foodies 1.0Projec.docx
 
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docxPart 1 - Microsoft AccessView GlossaryUse Access to create a.docx
Part 1 - Microsoft AccessView GlossaryUse Access to create a.docx
 
CIS 3100 - Database Design and ImplementationScoring Rubric.docx
CIS 3100 - Database Design and ImplementationScoring Rubric.docxCIS 3100 - Database Design and ImplementationScoring Rubric.docx
CIS 3100 - Database Design and ImplementationScoring Rubric.docx
 
Part 2Provider Database (MS Access)For a review of the complete r.docx
Part 2Provider Database (MS Access)For a review of the complete r.docxPart 2Provider Database (MS Access)For a review of the complete r.docx
Part 2Provider Database (MS Access)For a review of the complete r.docx
 
Product Supplier59,58,8,2.50CIS 3100 - Database Desig.docx
Product Supplier59,58,8,2.50CIS 3100 - Database Desig.docxProduct Supplier59,58,8,2.50CIS 3100 - Database Desig.docx
Product Supplier59,58,8,2.50CIS 3100 - Database Desig.docx
 
Access2003
Access2003Access2003
Access2003
 
Access2003
Access2003Access2003
Access2003
 
10359485
1035948510359485
10359485
 
Part 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxPart 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docx
 
Part 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docxPart 2Provider Database (MS Access)Use the project description HE.docx
Part 2Provider Database (MS Access)Use the project description HE.docx
 
Acccesss notes
Acccesss notesAcccesss notes
Acccesss notes
 
access1.ppt
access1.pptaccess1.ppt
access1.ppt
 
Access Basics 01
Access Basics 01Access Basics 01
Access Basics 01
 
1. access
1. access1. access
1. access
 
Access2007 part1
Access2007 part1Access2007 part1
Access2007 part1
 
CIS 310 ACCESS AssignmentObjective of this assignment is to pr.docx
CIS 310 ACCESS AssignmentObjective of this assignment is to pr.docxCIS 310 ACCESS AssignmentObjective of this assignment is to pr.docx
CIS 310 ACCESS AssignmentObjective of this assignment is to pr.docx
 
Ms Access
Ms AccessMs Access
Ms Access
 
Databases
DatabasesDatabases
Databases
 

More from faithxdunce63732

Assignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxAssignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxfaithxdunce63732
 
Assignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxAssignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxfaithxdunce63732
 
Assignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxAssignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxfaithxdunce63732
 
Assignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxAssignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxfaithxdunce63732
 
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxAssignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxfaithxdunce63732
 
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxAssignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxAssignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxfaithxdunce63732
 
Assignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxAssignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxfaithxdunce63732
 
Assignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxAssignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxAssignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxAssignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxfaithxdunce63732
 
Assignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxAssignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxfaithxdunce63732
 
Assignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxAssignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxfaithxdunce63732
 
Assignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxAssignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxfaithxdunce63732
 
Assignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxAssignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxfaithxdunce63732
 
Assignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxAssignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxfaithxdunce63732
 
Assignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxAssignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxfaithxdunce63732
 
Assignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxAssignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxfaithxdunce63732
 
Assignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxAssignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxfaithxdunce63732
 
Assignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxAssignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxfaithxdunce63732
 

More from faithxdunce63732 (20)

Assignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docxAssignment DetailsScenario You are member of a prisoner revie.docx
Assignment DetailsScenario You are member of a prisoner revie.docx
 
Assignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docxAssignment DetailsScenario You are an investigator for Child .docx
Assignment DetailsScenario You are an investigator for Child .docx
 
Assignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docxAssignment DetailsScenario You are a new patrol officer in a .docx
Assignment DetailsScenario You are a new patrol officer in a .docx
 
Assignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docxAssignment DetailsScenario Generally, we have considered sexual.docx
Assignment DetailsScenario Generally, we have considered sexual.docx
 
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docxAssignment DetailsPower’s on, Power’s Off!How convenient is.docx
Assignment DetailsPower’s on, Power’s Off!How convenient is.docx
 
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docxAssignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
Assignment DetailsIn 1908, playwright Israel Zangwill referred to .docx
 
Assignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docxAssignment DetailsPart IRespond to the following.docx
Assignment DetailsPart IRespond to the following.docx
 
Assignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docxAssignment DetailsPlease discuss the following in your main post.docx
Assignment DetailsPlease discuss the following in your main post.docx
 
Assignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docxAssignment DetailsPennsylvania was the leader in sentencing and .docx
Assignment DetailsPennsylvania was the leader in sentencing and .docx
 
Assignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docxAssignment DetailsPart IRespond to the followingReview .docx
Assignment DetailsPart IRespond to the followingReview .docx
 
Assignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docxAssignment DetailsPart IRespond to the following questio.docx
Assignment DetailsPart IRespond to the following questio.docx
 
Assignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docxAssignment DetailsPart IRespond to the following questions.docx
Assignment DetailsPart IRespond to the following questions.docx
 
Assignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docxAssignment DetailsOne thing that unites all humans—despite cultu.docx
Assignment DetailsOne thing that unites all humans—despite cultu.docx
 
Assignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docxAssignment DetailsMN551Develop cooperative relationships with.docx
Assignment DetailsMN551Develop cooperative relationships with.docx
 
Assignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docxAssignment DetailsInfluence ProcessesYou have been encourag.docx
Assignment DetailsInfluence ProcessesYou have been encourag.docx
 
Assignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docxAssignment DetailsIn this assignment, you will identify and .docx
Assignment DetailsIn this assignment, you will identify and .docx
 
Assignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docxAssignment DetailsFinancial statements are the primary means of .docx
Assignment DetailsFinancial statements are the primary means of .docx
 
Assignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docxAssignment DetailsIn this assignment, you will identify a pr.docx
Assignment DetailsIn this assignment, you will identify a pr.docx
 
Assignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docxAssignment DetailsHealth information technology (health IT) .docx
Assignment DetailsHealth information technology (health IT) .docx
 
Assignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docxAssignment DetailsDiscuss the followingWhat were some of .docx
Assignment DetailsDiscuss the followingWhat were some of .docx
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 

CS1100 Access Lab 1 Creating and Querying Database.docx

  • 1. CS1100: Access Lab 1 Creating and Querying Databases To complete this assignment you must submit an electronic copy to Blackboard by the due date. You will be creating your own database, so there is no starter file for this lab. In this lab you are asked to create a new database for inventory management of a small computer reseller, populate the database with sample data and formulate queries to retrieve data. Creating the Database The founding of WizBang Computers, LLC is the dream of Jason Dunn, a long time computer enthusiast. He finally has enough business customers to make his side venture a full time job. His goal is to build WizBang into the premier reseller and servicer of business computers for small to mid-size firms. As his sales of custom-built PCs have taken off, Jason realizes that he needs a better inventory management tool than the Excel spreadsheet he has been using thus far. However, Jason is too busy providing on-site support services for his clients and therefore has
  • 2. hired you to build an Access database for WizBang that will allow him to track his inventory, customer contacts, and orders. Eventually, the data will not only help him manage his inventory better, but also provide insight into sales for better sales forecasting and inventory planning. Planning the Tables A database development effort starts with an analysis of the data that needs to be stored. Commonly a data model is constructed to assist with this effort. So far, the following tables have been identified as being important: Table Name Content Contacts Information about customers Products Information about products available for sale Orders Information about orders placed by customers ZipCodes Cities and states and their associated zip code LineItems Lists of products and the orders in which they were ordered 1. Start Microsoft Access and create a blank database by selecting “Blank database” from the list of available templates.
  • 3. 2. Name your database using the following naming rule: Orders_Lastname, e.g., Orders_Smith LabA1 CS1100 2 of 8 3. Note the location of the database (remember the folder in which it was saved; most likely the Documents folder.) Lastly, click on Create to create the database. Note that data is automatically saved as soon as you change something in Access; there is no separate Save mechanism. 4. Access will automatically create your first table under the temporary name “Table1”. Before you can rename the table, we need to first define its columns (i.e., its data content) and then close the table. We will start by creating the Contacts table as follows: a. Switch to table design, by clicking on the Design View icon. When prompted, save the table under the name “Contacts”. b. Define the fields of the Contacts table as follows:
  • 4. c. Now create the Products table by selecting the Create tab and clicking on Table. Once again, switch to the Design View by clicking on the Design View icon. When prompted, save the table under the name “Products”. Define the table as follows: d. Follow the same process to create the Orders, LineItems, and ZipCodes tables. The definitions of the tables are below: LabA1 CS1100 3 of 8 e. When done, close all of your tables, by clicking the right mouse button on any of the table tabs and selecting “Close All”. You will be prompted to save the tables. Choose “Yes” for all of them.
  • 5. Populating the Database Now that the database has been created, we need to put data into the database. This is often done by loading an Excel table containing data into the database or by writing a nice user interface that users can use to type in the data. In our case, we will populate the data by using the Access table data entry tool. 1. Let’s start by adding a few of our contacts’ information into the Contacts table. Double- click on the Contacts table in the Tables browser. That will bring up the table entry sheet. Here’s what it should look like: 2. Enter the following data into the table sheet view. Note that you DO NOT enter any value for the ContactID field. That field is an auto number field that is automatically filled in by Access. LabA1 CS1100 4 of 8
  • 6. Note that we don’t store where the customer lives; we only store the zip code. The actual city and state is stored in the ZipCodes tables which this table references. As the fourth contact enter your own name, address, and phone number. To protect your privacy, you may add a fictitious address and phone but you must enter your correct name and you must provide some kind of address. (Your zip code should be added to the zip code table as well.) 3. Follow the same procedure to continue with your data entry by adding the following data to the other tables: This table is important as it establishes which customer placed which order. For example, order number 1 was placed by contact 1 (Peter Levoy) on 4/1/2011. In fact, Peter also placed orders 2 and 4, while orders 3, 5, and 6 were all placed by contact 2 (Jane Wu). What exactly was ordered as part of each order, how much of it, and how much was actually charged to the customer is stored in the LineItems table. We do this so that there
  • 7. is no redundantly stored information in our database. Here is the LineItems table: LabA1 CS1100 5 of 8 Establishing Relationships In order for our queries to be properly executed by Access, we need to tell Access how we have linked the information in the different tables. For example, Contacts and ZipCodes are linked. So are Orders and Contacts, as well as LineItems with Orders and Products. To define the relationships, we need to close all of our tables in the table view and then switch to the Database Tools view.
  • 8. Once you click on the Relationships tool, you get a list of tables for which you can establish relationships. Select all of them and then click Add and then Close. You can also add each table one by one. LabA1 CS1100 6 of 8 Now we are ready to create the relationships. To do so, click on the field of one table that points to another table and then drag the line towards the other table and drop if off over the field that is
  • 9. the linked field. For example, to create the relationship between Contacts and ZipCodes, click on the ZipCode field of the ZipCodes table and then drop that field off on top of the ZipCode field of the Contacts table. It’s important that it is done in that order! You will then see a line between the linked fields. Establish the following relationships: • ContactID in Contacts to ContactID in Orders • ZipCode in ZipCodes to ZipCode in Contacts • ProductID in Products to ProductID in LineItems • OrderID in Orders to OrderID in LineItems Here’s the resulting relationship model: LabA1 CS1100 7 of 8
  • 10. The database is now fully defined and populated with a little bit of data. Now we are ready to do some sample queries. Querying the Database To create a query, select the Create tab and then pick the Query Design tool. Close the resulting dialog without picking any tables. To create each query, drag the needed tables into the query designer and then drag the appropriate fields into the columns list. Specify any GROUP BY or WHERE clauses as needed. Name each query with the pattern: QLastnameX, where Lastname is your last name and X is the question number, e.g., QSmith1. 1. Create a query that lists all of the customers’ first and last names regardless of whether they placed an order or not. Hint: Your name must
  • 11. appear in the result. 2. Create a query that lists all of the customers’ first and last names plus their address with the street, city, state, and zip code. The result should contain all customers regardless of whether they placed an order or not. LabA1 CS1100 8 of 8 3. Create a query that lists the Order IDs of all of the orders placed by “Jane Wu”. Use the information given (first and last name) and not ContactID. Remove any duplicates. 4. Create a query that lists the PriceCharged for Windows 7. List the ProductID, ProductName and PriceCharged. (Note that PriceCharged is different from RetailPrice.) 5. Create a query that lists what products were ordered on 4/19/2011. List the last name of the customer, the order date, product id and product name. Remove any duplicates.
  • 12. 6. Create a query that lists all the first and last names of all customers who placed at least one order. Remove any duplicates. 7. Create a query that lists all the products that have a retail price of more than $100. List the product ID and the product name and the retail price. 8. Create a query that retrieves the name (first and last), address, city, state, and zip code of the contact with ID=4 (or whichever contact ID is your own name.) Grading Rubric This rubric is intended to guide graders in their evaluation of the students’ submissions. Criterion Discussion Grading Tables not correct All tables must have the correct names and attributes (columns or fields) -5% for each table that is incorrectly named (including spelling mistakes) -5% for each table that contains an attribute with the incorrect name or datatype
  • 13. Queries produce correct output and are designed correctly Each query must produce the correct result. -5% for each query that does not produce correct result or is not designed to produce correct output for all data possibilities Relationships not correct All relationships must be defined correctly and connect the right attributes, i.e., primary key/foreign key pairs -2% for each incorrect relationship Data not correct All data must be entered as specified -1% for each record or field that is not correctly entered Queries not named correctly Queries should be named as QLastnameX, where Lastname is the student’s last name and X is the query number. -10%