Access_HW2
Access_HW2
You are given four tables of data (Table1: Books, Table2: Customers, Table3: Publishers and Table4:
Sale_Inv_No), which contain the information about a bookstore named LE CIEL BLEU. These tables
describe the following information:
• Books: Details of all books such as their ISBN, title, author of the book, year of publication,
quantity kept in the storage, minimum quantity should be reserved.
• Customers: Details about all customers such as the code of the customer, customer name and
basic personal information.
• Publishers: Details about all publishers such as publisher code, publisher name and basic
information about publishers.
• Sale_Inv_No: Details about all sales’ order such as customer code, ISBN, date of transaction,
quantity and unit price of the books.
You will use the skills learned to solve the 10 tasks below. The tasks must be done by applying MS-
Access techniques.
a. Create a new blank database and save it under the format below:
StudentFirstNameLastName_StudentID.accdb (no blank between words, first letter should be
capitalized)
e.g.: NguyenVanAn_BABAIU12345.accdb
Create four tables, define the field properties and enter the data into four tables as follows: (remember
to save your work frequently every 1-2 minute(s))
Page 1
Field Size: 30
Cust_Name (Short) Text Customer name Validation Rule: Is Not Null
Validation Text: Must enter a name here
Country where the Field Size: 30
Country (Short) Text
customer resides Indexed: Yes (Duplicates OK)
Phone number of
Phone (Short) Text Input Mask: !\(99\)\ 0000\ 0000
the customer
Field Size: 35
Validation Rule: Like "*@*" Or Is Null
Email (Short) Text Customer email Validation Text: Email address must be in
the format "user@domain"
Required: Yes
Table3_Publishers
Publ_Code Field Size: 5
(Short) Text Publisher code
(Primary Key) Indexed: Yes (No Duplicates)
Field Size: 30
Validation Rule: Is Not Null
Publ_Name (Short) Text Publisher name
Validation Text: Must enter a name here
Required: Yes
Address of the Field Size: 60
Address (Short) Text
publisher Indexed: Yes (No Duplicates)
Email (Short) Text Publisher email Field Size: 35
Table4_Sale_Inv_No
Field Size: 5
Cust_Code (Short) Text Customer code
Indexed: Yes (Duplicates OK)
Field Size: Integer
ISBN Number ISBN of the book
Indexed: Yes (Duplicates OK)
Format: Short Date (dd/mm/yy)
Validation Rule: <Date()
Date_Trans Date/Time Date of transaction
Validation Text: Must be earlier than
today’s date
Field Size: Integer
Quantity of the
Qty Number Indexed: Yes (Duplicates OK)
transaction
Required: Yes
Field Size: Single
Unit_Price Number Book unit price Indexed: Yes (Duplicates OK)
Required: Yes
c. List the ISBN, title, author, year of publication and quantity on hand of all books published since
1994 and number of items in the storage between 15 and 25.
(Take a screenshot of this query window and design view)
Page 2
d. List the ISBN, title, year of publication, publisher code and publisher name of all books contains
the word “Business” published before 1992 or contains the word “Database” published after
1992.
(Take a screenshot of this query window and design view)
e. For all publishers in which we have book items, list the code, name of the publisher and the number
different of book items published by that publisher (5marks)
(Take a screenshot of this query window and design view)
f. List all details of all customers by entering a first letter of their name (i.e., enter D to display
Dwight Cole).
(Take a screenshot of this query window when entering letter “D” and design view)
g. List name, phone number and email address of all customers whose last name got at least 5
characters and the last character is an ‘e’ (i.e., Marque, Clive, Michelle).
(Take a screenshot of this query window and design view)
i. List all details of all invoice(s) in a given date which is prompted by the user (i.e. Enter a date:
26/04/2017).
(Take a screenshot of this query window and design view)
j. List customer name, transaction dates, quantity, unit price and total amount for each transaction
date (header Total Amount, quantity x unit price) of the customer’s name Sean Losche. Sort in
descending order.
(Take a screenshot of this query window and design view)
Page 3
Table 1. Books
ISBN Title Author Year Qty_On_Hand Min_Stock_Level Publ_Code
3504 How to create relational database Downing 1996 24 10 P1001
3530 Database business applications Burrows 1993 19 10 P1004
3568 Linear algebra Anderson 1999 15 10 P1002
3625 Design and management of database Downing 1978 20 10 P1003
3646 Relational database principles Ritchie 1987 19 10 P1002
3673 Introduction to e-commerce Patrick 1994 18 10 P1001
3689 Introductory Java Parsons 1996 27 10 P1003
3718 Information system management McEliece 1992 14 10 P1003
3745 Principle of marketing Ashley 1997 17 10 P1004
3770 Probabilities for business Dier 1999 21 10 P1002
3796 Statistics and probabilities Boschard 1989 23 10 P1001
Table 2. Customers
Cust_Code Cust_Name Country Phone Email
C1001 Sean Losche Argentina (03) 1234 5678 [email protected]
C1002 Michelle Hills United Kingdom (05) 5631 9265 [email protected]
C1003 Dwight Cole United Kingdom (05) 3247 4328 [email protected]
C1004 Clive Lynch Ireland (04) 6489 4960 [email protected]
C1005 Marque Diaz USA (01) 4325 5033 [email protected]
Table 3. Publishers
Publ_Code Publ_Name Address Email
P1001 Diamonti 234 King Ave, Rome [email protected]
P1002 Plattenhard 1047 Paradox Street, Berlin [email protected]
P1003 Andre 22 Jordan Bld, Lisbon
P1004 Mathematica 401 Castellan, Madrid
Page 4
Table 4. Sale_Inv_No
Cust_Code ISBN Date_Trans Qty Unit_Price
C1001 3504 15/03/2017 15 27
C1001 3646 26/04/2017 31 28
C1001 3673 19/05/2017 30 34
C1001 3745 23/06/2017 10 30
C1002 3568 15/03/2017 25 19
C1002 3673 26/04/2017 15 34
C1002 3718 19/05/2017 16 26
C1002 3796 23/06/2017 15 35
C1003 3530 15/03/2017 13 21
C1003 3625 26/04/2017 19 30
C1003 3689 19/05/2017 16 24
C1003 3770 23/06/2017 20 28
C1004 3530 15/03/2017 10 21
C1004 3568 26/04/2017 25 19
C1004 3646 19/05/2017 17 28
C1004 3796 23/06/2017 18 35
C1005 3504 15/03/2017 15 27
C1005 3673 26/04/2017 20 34
C1005 3745 19/05/2017 11 30
C1005 3796 23/06/2017 20 35
Page 5