Surname:
Instructor:
Course:
Date:
A. Tables: Create at least four tables that will display the data that is important to the store
owners. Identify the primary and foreign keys that are necessary to relate the tables. Include
screenshots that show the tables you created.
Surname 2
Surname 3
B. Import Data: Use SQL statements to import the data into the tables you just created. You will
come up with each of your data sets yourself. You should have at least five records for each
table. Include screenshots that show the populated tables annotated with the SQL statements that
you used.
1.
2.
SELECT * FROM `books`;
3.
SELECT * FROM `bookstore`;
Surname 5
4.
SELECT `ordernum`, `customername`, `customeremail`, `phonnumber`, `customerID` FROM`c
ustomer`;
5.
SELECT `zipcode`, `order_date`, `employeeName`, `address`, `phonnumber`, `hire_date`, `emp
loyeeID` FROM `employee`;
Surname 6
6.
SELECT `orderamt`, `order_date`, `orderdetails`, `pymmethod`, `order_no` FROM `order_`;
7.
SELECT `productprice`, `productdesc`, `productID`, `productname` FROM `product`;
Surname 7
C. Queries: After you have populated the tables, write queries to extract the data to answer the
owner’s questions. Include screenshots that show each query and the corresponding query
results.
d. Which are the most popular products besides books that are sold in each store?
SELECT ProductID
FROM OrderHistory
WHERE ProductID NOT IN (SELECT BookID FROM Books);
2. Report
Although some parts of the report will be completed before or during the creation of the
database, the report as a whole will be written after you have created the database.
A. Overview: Provide a concise overview of the problem you are solving and the database that
you created to address the problem.
In this particular project what is required is to design and create a database for Book ‘R’
Us, which is a small private bookstore. The current system available is using Microsoft Excel
spreadsheets which are not convenient to the store data storage and input due to the fact that the
store has expanded its branches. The store owner has opened a second store known as Great
Books USA hence a more efficient method is required. Access database will be the best solution
to the store owner, which will provide inventory tracking system and customers records serving
both stores and also avail a centralized management system to the store directors. The
mechanism will be of useful during book publisher discount are on offer to certain ordered
books.
B. Justification: Analyze the business information storage problem you are solving. Why is the
database the appropriate solution to the problem?
Microsoft excel has different features compared to database access. For instance data
input in access is more efficient as it offers convenient platform to key in more details in orders,
customers, and inventory update which will help the management keep track on them. And the
storage issue will be addressed also as access provide a wider range of data storage compared to
Microsoft excel. Access will proved the store managers with store details on every activity at a
one glance unlike excel you will have to go through every data input
Surname 9
C. Benefits: What benefits in data management does the database you created have over a file
system like the one the stores were previously using? What features and functions does a
database have that a file system does not?
The new designed Microsoft access will combine all the related store record that the
management need into one master system providing with an ease management strategy for the
stores. The data entry will have relationships that will accumulate to one functional system that
provides accurate and definite results hence the store will grow. Furthermore the SQL tables
will aid in cross checking the tables for which can be useful in marketing efforts.
D. Features: Describe each of the major features of the database you created. Why are these
features required?
Books- this table will consist of ISBN as the primary key while the attributes are
Inventory- Item category code is the primary key, and the attributes include <store_id>,
<quantity>
Book store- store_id is the primary key and the attribute is <address>
Order details- order_id is the primary key attributes are <store_id>, <customer_id>,
Order master- customer_id is the primary key while the attributes include <address>,
Employee- the primary key is employee_id, and the attributes are, <fname>, <lname>,
Merchandise- product_id as the primary key, while <product_desc>, and <price> as the
ERD
Surname 11
G. Relational Model: Develop a relational model that is logical and complies with the
requirements in your ERD.
Product
Surname 12
Customer
Column Name Data Type Allow Nulls Index
CustomerNo Integer No Primary Key(PK)
CustomerName Varchar(50) No
CustomerAddress Varchar(50) No
CustomerCity Varchar(50) No
CustomerState Char(2) No
CustomerZip Char(5) Yes
CustomerEmail Varchar(50) No
Order
Column Name Data Type Allow Nulls Index
OrderNo Integer No Primary Key(PK)
CustomerNo Integer No Foreign Key(FK)
OrderDate Date No
ItemsOrdered Varchar(50) No
CustomerDetails_CustomerNo Varchar(50) No
Orders_CustomerDetails Varchar(50) no
Supplier
Column Name Data Type Allow Nulls Index
SupplierNo Integer No Primary Key(PK)
Name Varchar(50) No
SupplierAddress Varchar(50) No
SupplierCity Varchar(50) No
SupplierState Char(2) No
SupplierZip Char(5) Yes
Title Varchar(50) No Foreign Key(FK)
NumberSupplied Integer No
Surname 13
Dependency Diagram
CUSTOMER table:
The CustomerCity, CustomerState and CustomerZip are dependent on the address thus a table is
based on the address.
Table C_ADDRESS
CustomerAddress CustomerCity CustomerState CustomerZip
PRODUCT table:
In the table PRODUCT the PublishDate is dependent on the Publisher so we need a table based
on the publisher
Table: PUBLISHER
PublisherId PublisherName Title PublishDate DateSold
ORDERS table:
Surname 14
Table: CUSTOMERORDERDETAILS
CustomerNo ItemsOrdered CustomerDetails_CustomerNo
Relational Schema