Beattie Finalreport

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Book Database Project

tie
Jovan Beattie

at
Be
n
va
Jo
of
ty
er
op
Pr

IST 659 Data Administration Concepts and


Database Management

Spring 2023
Contents
Summary ....................................................................................................................................................... 3
Data Model.................................................................................................................................................... 3
Conceptual Model ......................................................................................................................................... 5
Logical Model ................................................................................................................................................ 6
Database Script ............................................................................................................................................. 7
Creation of Database Tables...................................................................................................................... 7
Creation of Additional Table Constraints ................................................................................................ 10
Insertion of Mock Data for Database Testing .......................................................................................... 11
Creation of Views .................................................................................................................................... 14
Creation of Transaction Safe Stored Procedures..................................................................................... 15

tie
Testing of Stored Procedures .................................................................................................................. 17

at
Drop Procedures ..................................................................................................................................... 19

Be
Data Questions and Answers: ..................................................................................................................... 21
Application Mock-Up................................................................................................................................... 23
n
va
Conclusion and Reflection........................................................................................................................... 25
Jo
of
ty
er
op
Pr
Summary
Project Description
This project is an extension of a personal project of mine to develop a small publishing business.
In order to begin handling the logistics of such an undertaking, a robust database will be
necessary to store information regarding books, authors, sales, and reviews. This is not the final
form of said database; rather, this is an attempt by someone who has no experience in coding or
IT management to develop a “first draft” database that can be developed upon in the future.

Data Model
Entities

tie
Author: An author is an individual that has written a book that has been published under our
publishing business. The most important information to record about each author is their

at
contact information, such as their address, phone and email.

Be
Book: A book is a piece of written media that has been produced by an author. Necessary
n
information that must be stored includes its title, author, ISBN, language, price and more.
va
Jo

Vendor: A vendor is any company or other entity that our books are sold through. This can
include online bookstores or physical bookstores.
of

Users A user is a placeholder entity for a person who has signed up for our website to purchase
ty

books or leave a review on a book. The actual website is in development, so this is more of a
er

representative entity that demonstrates we will have a system of tracking the contact
op

information and transaction history of users who engage with our service.
Pr

Sale: A sale is a record of a quantity of books being sold through a vendor to a user. Book price
is already recorded in a separate book table, so this is merely the record of how many of each
book has been sold.
Reviewer: While every review will be left by a user, not all users will leave reviews. This is a
separate entity that encapsulates users who have left a review and will generate separate tables
to record review data. Users may leave a rating between 0 and 5 and can write a text review to
accompany it.
Ratings: This entity is the record of ratings for each book, which includes the number of ratings
and the average rating.
Relationships Stakeholders
A book must have one author. CEO and Upper Management
An author may have many books. Authors
A book may have zero to many sales. Vendors
A sale must have one or many books. Users
Database Developers
A vendor may have zero to many sales.
Web Developers
A sale must have one vendor.
A user may have zero to many sales.
A sale must have one user.
A book may have zero to many ratings.
A rating must have one book.
A reviewer may have one to many ratings.
A rating must have one reviewer.

tie
Expectations

at
This project should result in the following outcomes:

Be
1. A database structure that can support the storage of relevant information about books,
n
authors, vendors, sales, and reviews.
va
2. The ability to answer questions regarding data stored in the database, such as:
Jo

a. What is the author contact information for each book stored in the database?
b. What are the total sales of each book?
of

c. What is the total amount of money made by each author?


ty

d. What is the average rating of each author based on their book sales?
er

e. What is the name of the vendor that sold each book?


op
Pr
Conceptual Model

Pr
op
er
ty
of
Jo
va
n
Be
at
tie
Logical Model

Pr
op
er
ty
of
Jo
va
n
Be
at
tie
Database Script
Creation of Database Tables

tie
at
Be
n
va
Jo
of
ty
er
op
Pr
Pr
op
er
ty
of
Jo
va
n
Be
at
tie
tie
at
Be
n
va
Jo

*During the development


process these lines were used
of

to ensure the tables were


properly created, but are now
ty

unnecessary and commented


er

out.
op
Pr
Creation of Additional Table Constraints
*Constraints include
various foreign key
restraints to prevent
duplicate values or
values not already
represented in other
tables and check
constraints to prevent
improper values.

tie
at
Be
n
va
Jo
of
ty
er
op
Pr
Insertion of Mock Data for Database Testing

tie
at
Be
n
va
Jo
of
ty
er
op
Pr
Resulting Tables
Pr
op
er
ty
of
Jo
va
n
Be
at
tie
Pr
op
er
ty
of
Jo
va
n
Be
at
tie
Creation of Views

tie
at
*Originally these were going to be tables, but I thought that these would be more useful as views since their

Be
values are based on the combination of values from other tables.
n
Resulting Views
va
Jo
of
ty
er
op
Pr
Creation of Transaction-Safe Stored Procedures

tie
at
Be
n
va
Jo
of
ty
er
op
Pr
Pr
op
er
ty
of
Jo
va
n
Be
at
tie
tie
at
Be
Testing of Stored Procedures n
va
*Adds website to existing author.
Jo
of
ty
er
op
Pr

*Adds new book.


*Adds new vendor.

tie
*Adds new sale.

at
Be
n
va
Jo
of
ty
er
op
Pr

*Adds new review.


Drop Procedures

Pr
op
er
ty
of
Jo
va
n
Be
at
tie
Pr
op
er
ty
of
Jo
va
n
Be
at
tie
Data Questions and Answers
1. What is the author contact information for each book stored in the database?

tie
at
2. What are the total sales of each book?

Be
n
va
Jo
of
ty
er
op
Pr

3. What is the total amount of money made by each author?


4. What is the average rating of each author based on their book sales?

tie
at
Be
n
va
Jo

5. What is the name of the vendor that sold each book?


of
ty
er
op
Pr
Application Mock-Up
Main Database Access Screen

tie
at
Be
n
va
Jo
of
ty
er
op
Pr
Example Data Entry Screen

tie
at
Be
n
va
Jo
of
ty
er
op
Pr
Conclusion and Reflection

Developing this database has been very insightful into the process of storing and
managing information. While the online lectures have been very informative,
actually getting my hands metaphorically dirty and trying to wrangle with
database concepts in real time helped build my understanding of them. I was
somewhat intimidated by the prospect of this project initially, but I’m happy I was
able to create something that I feel is a good first step along this journey. It was
especially interesting to work with SQL, which seems to be a more straightforward
scripting language, and therefore a good entry point for someone like myself with
little coding experience. Working with code and seeing tables come to fruition was

tie
a pleasant experience.

at
Be
Overall, I believe that this project was a great opportunity to begin my deeper dive
n
into IT management fundamentals.
va
Jo
of
ty
er
op
Pr

You might also like