SlideShare a Scribd company logo
1 of 18
MIS 02336: Advanced Database Management; Assignment 2 (SQL)
Kieran Crean 916069627
Alex Dickinson 916069420
Jimmy Hiltwine 916072712
Joe Miller 916078856
Alex Pileggi 916105398
4/30/2015
Table of Contents
1.1 Summary
1.2 Introduction
1.3 Business / Enterprise Rules
1.4 ERD Diagram
1.5 Relations
1.6 Implementation Details
1.7 Database Manipulation & Control
1.8 Notation of E-R Diagrams
1.9 Conclusion
1.10 Recommendations
1.11 End Matter
1.1 Summary
This database is to review the effectiveness of the newly hired general manager. This
manager was hired on January 1st and all of the information presented will be in relation to his
managerial review in response to his first six months of employment. Prior to his employment,
our new manager said he wanted to fix a list of things about this park and they were as follows:
standardize prices to find the most profitable, create a customer loyalty and retention program,
efficiently log all maintenance performed on every attraction, and above all else create the best
experience possible at an amusement park.
His first order of business was to standardize all prices to know exactly what rides were
most profitable and what he could possibly charge more or less for in the future depending on the
attraction’s popularity. Secondly, our general manager created a customer incentive program
through running queries to see if our visitors haven’t traveled to Adventure Place in a certain
amount of time. With this information he can see the last date a customer had visited the park
and add them to a personalized email blast that makes the customer feel they are valued by our
company. The maintenance schedule had originally been a problem for Adventure Place because
before the new year, employees were not required to log their maintenance performances and
there was no official way to check that these rides were checked before the start of every day.
Before our new general manager, rides would shut down throughout the day and would not be
operational until the next business day; but now that we know all rides are being serviced, we are
confident there will not be any down-time throughout our business day.
1.2 Introduction
We are experiencing a rotation of managerial staff. The new general manager has been
hired from an investment firm and has no previous amusement park experience but is very
interested to learn. Adventure Place has been losing a lot of money recently because the
customers do not feel they are valued by us and rides have been breaking down constantly. He
has created a checklist of things he wants to have accomplished before his six-month review that
will take place on June 1st. These will include: flattened prices, a customer rewards program, and
a full revamp of our maintenance on all of our attractions. He guarantees this will fix all of the
problems Adventure Place has been experiencing.
1.3 Business / Enterprise Rules
1. Each Visitor that comes to Adventure Place must purchase at least one ticket through the
Ticket Booth.
2. Each Visitor will be asked to supply their Zip Code and Email address.
3. The Ticket Booth will sell the tickets to each Visitor. An ID number will be generated for
each new visitor that comes. An OrderID will hold all of the information pertaining to the
one specific attraction transaction. An OrderID must have at least one AttractionID, but
can have more, and also only one VisitorID can be associated with an OrderID.
4. Each Attraction requires the Visitor to have at least one ticket to ride one time.
5. At least one Maintenance Staff member must be on the Maintenance Schedule for each
day, but each Maintenance Staff member may only service one ride per day.
6. Each entry in the Maintenance Schedule will contain: its own Maintenance ID, the
Maintenance Staff member working on the attraction, the ID number of the attraction, the
starting and ending time of the maintenance and a description of the job being done.
7. Each entry in the Attraction Schedule will contain: its own Shift ID, the Attraction Staff
member working on the attraction, the ID number of the attraction and the starting and
ending time of the shift.
8. Every attraction must be serviced and inspected each day by at least one member of the
Maintenance Staff, but could be serviced by more than one member of the Maintenance
Staff.
1.4 Entity – Relationship Diagram
1.5 Relations
● Visitor - Ticket Booth (One to Many)
● Ticket Booth - Attraction (One to One)
● Attraction - Maintenance Schedule (One to Many)
● Attraction - Attraction Schedule (One to Many)
● Attraction Schedule - Attraction Staff(One to Many)
● Maintenance Schedule - Maintenance Staff (One to Many)
1.6 Implementation Details
1.6.1 Visitor Table
CREATE TABLE `Visitor` (
`VisitorID` int(11) NOT NULL,
`LastName` varchar(25) NOT NULL,
`FirstName` varchar(25) NOT NULL,
`ZIP` char(5) DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL,
`Date_Last_Visited` date NOT NULL,
PRIMARY KEY (`VisitorID`));
1.6.2 TicketBooth Table
CREATE TABLE `TicketBooth` (
`OrderID` int(11) NOT NULL,
`VisitorID` int(11) NOT NULL,
`AttractionID` varchar(5) NOT NULL,
`PurchaseDate` date NOT NULL,
`Quantity` int(10) DEFAULT NULL,
`Total` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`OrderID`,`AttractionID`,`VisitorID`),
KEY `TicketBooth_Visitor_FK` (`VisitorID`),
KEY `TicketBooth_Attraction_FK` (`AttractionID`),
CONSTRAINT `TicketBooth_Attraction_FK` FOREIGN KEY (`AttractionID`)
REFERENCES `Attraction` (`AttractionID`) ON DELETE CASCADE ON UPDATE
CASCADE,
CONSTRAINT `TicketBooth_Visitor_FK` FOREIGN KEY (`VisitorID`) REFERENCES
`Visitor` (`VisitorID`) ON DELETE NO ACTION);
1.6.3 Attraction Table
CREATE TABLE `Attraction` (
`AttractionID` varchar(5) NOT NULL,
`Name` varchar(15) NOT NULL,
`Description` varchar(150) NOT NULL,
`Price` decimal(12,2) NOT NULL,
PRIMARY KEY (`AttractionID`));
1.6.4 AttractionSchedule Table
CREATE TABLE `AttractionSchedule` (
`ShiftID` varchar(5) NOT NULL,
`AttractionID` varchar(5) NOT NULL,
`StaffID` int(11) NOT NULL,
`Time_Start` datetime DEFAULT NULL,
`Time_End` datetime DEFAULT NULL,
PRIMARY KEY (`ShiftID`),
KEY `AttractionSchedule_MaintenanceStaff_FK` (`StaffID`),
KEY `AttractionSchedule_Attraction_FK` (`AttractionID`),
CONSTRAINT `AttractionSchedule_Attraction_FK` FOREIGN KEY (`AttractionID`)
REFERENCES `Attraction` (`AttractionID`) ON DELETE CASCADE ON UPDATE
CASCADE,
CONSTRAINT `AttractionSchedule_MaintenanceStaff_FK` FOREIGN KEY (`StaffID`)
REFERENCES `AttractionStaff` (`StaffID`) ON DELETE CASCADE ON UPDATE
CASCADE);
1.6.5 AttractionStaff Table
CREATE TABLE `AttractionStaff` (
`StaffID` int(11) NOT NULL,
`LastName` varchar(25) NOT NULL,
`FirstName` varchar(25) NOT NULL,
`YearOfHire` int(4) NOT NULL,
PRIMARY KEY (`StaffID`));
1.6.6 MaintenanceSchedule Table
CREATE TABLE `MaintenanceSchedule` (
`MaintenanceID` int(11) NOT NULL,
`AttractionID` varchar(5) NOT NULL,
`MaintenanceStaffID` int(11) NOT NULL,
`Time_Start` datetime DEFAULT NULL,
`Time_End` datetime DEFAULT NULL,
`Description` varchar(200) DEFAULT NULL,
PRIMARY KEY (`MaintenanceID`),
KEY `MaintenanceSchedule_MaintenanceStaff_FK` (`MaintenanceStaffID`),
KEY `MaintenanceSchedule_Attraction_FK` (`AttractionID`),
CONSTRAINT `MaintenanceSchedule_Attraction_FK` FOREIGN KEY (`AttractionID`)
REFERENCES `Attraction` (`AttractionID`) ON DELETE CASCADE ON UPDATE
CASCADE,
CONSTRAINT `MaintenanceSchedule_MaintenanceStaff_FK` FOREIGN KEY
(`MaintenanceStaffID`) REFERENCES `MaintenanceStaff` (`MaintenanceStaffID`)
ON DELETE CASCADE ON UPDATE CASCADE);
1.6.7 MaintenanceStaff Table
CREATE TABLE `MaintenanceStaff` (
`MaintenanceStaffID` int(11) NOT NULL,
`LastName` varchar(25) NOT NULL,
`FirstName` varchar(25) NOT NULL,
`YearOfHire` int(4) NOT NULL,
PRIMARY KEY (`MaintenanceStaffID`));
1.7 Database Manipulation and Control
1.7.1 Customer Loyalty System
SELECT Email, FirstName, LastName, Date_Last_Visited
FROM Visitor
WHERE Date_Last_Visited <'2015-01-31'
ORDER BY Date_Last_Visited;
1.7.2 Revenues
SELECT TB.AttractionID, Name, Sum(Total) AS AttractionRevenue
FROM TicketBooth TB
INNER JOIN Attraction A ON TB.AttractionID=A.AttractionID
WHERE PurchaseDate BETWEEN ‘2015-01-01’ AND ‘2015-03-31’
GROUP BY AttractionID
ORDER BY AttractionRevenue DESC;
1.7.3 Maintenance
SELECT A.AttractionID, MS.MaintenanceStaffID, MS.FirstName, MS.LastName,
M.Description, M.Time_Start, M.Time_End
FROM MaintenanceStaff MS
INNER JOIN MaintenanceSchedule M ON
MS.MaintenanceStaffID=M.MaintenanceStaffID
INNER JOIN Attraction A ON M.AttractionID=A.AttractionID
WHERE A.AttractionID='RC01';
SELECT FirstName, LastName, YearOfHire
FROM MaintenanceStaff
WHERE EXISTS(SELECT MaintenanceStaffID,AttractionID FROM MaintenanceSchedule WHERE
MaintenanceSchedule.MaintenanceStaffID=MaintenanceStaff.MaintenanceStaffID AND
AttractionID='RC01');
1.7.4 Visitor Preference
SELECT COUNT(DISTINCT(VisitorID)) AS UniqueVisitors, AVG(Quantity) AS AverageQuantity
FROM TicketBooth;
SELECT TB.AttractionID,A.Name,COUNT(DISTINCT VisitorID) AS UniqueVisitors, AVG(Quantity)
AS AverageTicketsPurchased
FROM TicketBooth TB INNER JOIN Attraction A ON TB.AttractionID=A.AttractionID
WHERE PurchaseDate BETWEEN '2015-01-01' AND '2015-03-31'
GROUP BY AttractionID
ORDER BY UniqueVisitors DESC;
1.7.5 Customer Rewards
SELECT DISTINCT TB.VisitorID, V.FirstName, V.LastName, V.Zip, SUM(Quantity) AS Quantity,
SUM(Total) AS Total
FROM TicketBooth TB
INNER JOIN Visitor V ON TB.VisitorID=V.VisitorID
GROUP BY TB.OrderID
ORDER BY Total DESC
LIMIT 10;
1.7.6 Employee Schedule
CREATE VIEW Attraction_Schedule_4_27AS
SELECT AT.AttractionID,Name, AT.StaffID,FirstName, LastName, Time_Start,Time_End
FROM AttractionSchedule AT INNER JOIN AttractionStaff ATSON AT.StaffID=ATS.StaffIDINNER JOIN AttractionA WHERE
AT.AttractionID=A.AttractionID
AND Time_Start LIKE '2015-04-27%'
ORDER BY AttractionID, Time_End;
1.8 Notation of E-R Diagrams
Each visitor has to buy at least one ticket to enter the park, but one ticket can be bought
by one or many customers. The ticket booths relate to one specific attraction and one attraction
can only be associated with one specific admission with a single ticket. Rides must be serviced
once a day by one or more maintenance workers, and attractions must also be manned by one or
more attraction staff. The schedule of attraction staff is determined by a specific identifier to
their shift number and each staff member can only have one specific number for a specific task.
1.9 Conclusion
The implementation of this database was very important to effectively grade the
performance of our new general manager. The information he presented us told us exactly what
we needed to know in reference to what attractions our visitors were most interested in and how
we can better plan for the future. His customer loyalty program was a great success and we are
seeing more repeat customers than ever before, according to the data we were provided. Finally,
we have not had more than a few hours that an attraction has been down and we could not say
that before our current general manager. The maintenance schedule that was created has solved
so many problems we were having and we will no longer lose money because a ride has to be
shut down for the day. It is our pleasure to say that we have extended the employment of our
general manager and we have many plans for our future. With his help, we want to expand
Adventure Place by adding more attractions and doubling our staff within the next five years. We
have made a lot of progress in the past six months and we have nothing but confidence for the
future as our business has been completely turned around.
1.10 Recommendations
We have few recommendations to make since the database project clearly outlined many
of the problems Adventure Place was having. First of all, we will change the price of the general
admission depending on the attraction our visitors will want to use. The prices will have separate
variations of dollars or cents to either make more profit on some attractions or create more
interest for other rides because of their discounted prices. We plan to keep up with, and
constantly try and improve our customer loyalty program because we wouldn’t be as successful
as we are today without our loyal visitors. Our plan is to revamp the maintenance schedule for
the future and make it more detailed so anyone can read it and possibly understand how to
maintenance our rides. This may be a concern for future employees who are not experienced as
our current workers, but we would like to have documentation related to certain maintenance
routines so anyone can search for the type of maintenance they are trying to perform and will be
able to teach themselves. Finally, we will constantly be monitoring the amount of visitors we
have and the tickets we sell through our new database system. We owe all of our success to our
general manager and will build upon the foundation he has provided us.

More Related Content

Similar to Jallow_Report

Daily expenses tracker project ppt7.pptx
Daily expenses tracker project ppt7.pptxDaily expenses tracker project ppt7.pptx
Daily expenses tracker project ppt7.pptxssusere6f5a11
 
Slot Yield Presentation 2015
Slot Yield Presentation 2015Slot Yield Presentation 2015
Slot Yield Presentation 2015richlehman
 
Houston Presentation, April 2, 2014, Modified
Houston Presentation, April 2, 2014, ModifiedHouston Presentation, April 2, 2014, Modified
Houston Presentation, April 2, 2014, ModifiedJames F. McCarthy
 
Dynamics 365 Field Service - Hidden Gems
Dynamics 365 Field Service - Hidden GemsDynamics 365 Field Service - Hidden Gems
Dynamics 365 Field Service - Hidden GemsAli Khan
 
MY HOTEL OR CASINO LABOR COST OPTIMIZATION AUDIT - A Professional Service Of...
MY HOTEL OR CASINO LABOR COST OPTIMIZATION AUDIT -  A Professional Service Of...MY HOTEL OR CASINO LABOR COST OPTIMIZATION AUDIT -  A Professional Service Of...
MY HOTEL OR CASINO LABOR COST OPTIMIZATION AUDIT - A Professional Service Of...Robert R. DeMonsi, Jr.
 
1.Which one of the following is the estimated rate (i.e., percen.docx
1.Which one of the following is the estimated rate (i.e., percen.docx1.Which one of the following is the estimated rate (i.e., percen.docx
1.Which one of the following is the estimated rate (i.e., percen.docxfredellsberry
 
Expanding Your Sales Funnel with SAS
Expanding Your Sales Funnel with SASExpanding Your Sales Funnel with SAS
Expanding Your Sales Funnel with SASMichael Mina
 
Aligned Supply Chain Metrics
Aligned Supply Chain MetricsAligned Supply Chain Metrics
Aligned Supply Chain MetricsElaine Twomey
 
Running Head ATC’S 6.0 & 7.02Running Head ATC’S 6.0 & 7..docx
Running Head ATC’S 6.0 & 7.02Running Head ATC’S 6.0 & 7..docxRunning Head ATC’S 6.0 & 7.02Running Head ATC’S 6.0 & 7..docx
Running Head ATC’S 6.0 & 7.02Running Head ATC’S 6.0 & 7..docxsusanschei
 
Business Plan - Term Project
Business Plan - Term ProjectBusiness Plan - Term Project
Business Plan - Term ProjectKevin Swenson
 
Move Out of Excel and into a Pre-Lead Workspace by Dan Donin
Move Out of Excel and into a Pre-Lead Workspace by Dan DoninMove Out of Excel and into a Pre-Lead Workspace by Dan Donin
Move Out of Excel and into a Pre-Lead Workspace by Dan DoninSalesforce Admins
 
management information system on resort
management information system on resortmanagement information system on resort
management information system on resortSachin Kulkarni
 
Capstone presentation(1)
Capstone presentation(1)Capstone presentation(1)
Capstone presentation(1)Saumya Jain
 
Mis Team E
Mis Team EMis Team E
Mis Team Eryadhz
 

Similar to Jallow_Report (20)

Daily expenses tracker project ppt7.pptx
Daily expenses tracker project ppt7.pptxDaily expenses tracker project ppt7.pptx
Daily expenses tracker project ppt7.pptx
 
Slot Yield Presentation 2015
Slot Yield Presentation 2015Slot Yield Presentation 2015
Slot Yield Presentation 2015
 
Chapter 8.pdf
Chapter 8.pdfChapter 8.pdf
Chapter 8.pdf
 
Houston Presentation, April 2, 2014, Modified
Houston Presentation, April 2, 2014, ModifiedHouston Presentation, April 2, 2014, Modified
Houston Presentation, April 2, 2014, Modified
 
Dynamics 365 Field Service - Hidden Gems
Dynamics 365 Field Service - Hidden GemsDynamics 365 Field Service - Hidden Gems
Dynamics 365 Field Service - Hidden Gems
 
MY HOTEL OR CASINO LABOR COST OPTIMIZATION AUDIT - A Professional Service Of...
MY HOTEL OR CASINO LABOR COST OPTIMIZATION AUDIT -  A Professional Service Of...MY HOTEL OR CASINO LABOR COST OPTIMIZATION AUDIT -  A Professional Service Of...
MY HOTEL OR CASINO LABOR COST OPTIMIZATION AUDIT - A Professional Service Of...
 
1.Which one of the following is the estimated rate (i.e., percen.docx
1.Which one of the following is the estimated rate (i.e., percen.docx1.Which one of the following is the estimated rate (i.e., percen.docx
1.Which one of the following is the estimated rate (i.e., percen.docx
 
Expanding Your Sales Funnel with SAS
Expanding Your Sales Funnel with SASExpanding Your Sales Funnel with SAS
Expanding Your Sales Funnel with SAS
 
Aligned Supply Chain Metrics
Aligned Supply Chain MetricsAligned Supply Chain Metrics
Aligned Supply Chain Metrics
 
V 54.0 sw air & master doers 8 1 10
V 54.0 sw air & master doers 8 1 10 V 54.0 sw air & master doers 8 1 10
V 54.0 sw air & master doers 8 1 10
 
Running Head ATC’S 6.0 & 7.02Running Head ATC’S 6.0 & 7..docx
Running Head ATC’S 6.0 & 7.02Running Head ATC’S 6.0 & 7..docxRunning Head ATC’S 6.0 & 7.02Running Head ATC’S 6.0 & 7..docx
Running Head ATC’S 6.0 & 7.02Running Head ATC’S 6.0 & 7..docx
 
TeamSixBP
TeamSixBPTeamSixBP
TeamSixBP
 
Business Plan - Term Project
Business Plan - Term ProjectBusiness Plan - Term Project
Business Plan - Term Project
 
Move Out of Excel and into a Pre-Lead Workspace by Dan Donin
Move Out of Excel and into a Pre-Lead Workspace by Dan DoninMove Out of Excel and into a Pre-Lead Workspace by Dan Donin
Move Out of Excel and into a Pre-Lead Workspace by Dan Donin
 
management information system on resort
management information system on resortmanagement information system on resort
management information system on resort
 
Bng hrms
Bng hrmsBng hrms
Bng hrms
 
Insurance management system report on visual basic
Insurance management system report on visual basicInsurance management system report on visual basic
Insurance management system report on visual basic
 
Resume
ResumeResume
Resume
 
Capstone presentation(1)
Capstone presentation(1)Capstone presentation(1)
Capstone presentation(1)
 
Mis Team E
Mis Team EMis Team E
Mis Team E
 

Jallow_Report

  • 1. MIS 02336: Advanced Database Management; Assignment 2 (SQL) Kieran Crean 916069627 Alex Dickinson 916069420 Jimmy Hiltwine 916072712 Joe Miller 916078856 Alex Pileggi 916105398 4/30/2015
  • 2. Table of Contents 1.1 Summary 1.2 Introduction 1.3 Business / Enterprise Rules 1.4 ERD Diagram 1.5 Relations 1.6 Implementation Details 1.7 Database Manipulation & Control 1.8 Notation of E-R Diagrams 1.9 Conclusion 1.10 Recommendations 1.11 End Matter
  • 3. 1.1 Summary This database is to review the effectiveness of the newly hired general manager. This manager was hired on January 1st and all of the information presented will be in relation to his managerial review in response to his first six months of employment. Prior to his employment, our new manager said he wanted to fix a list of things about this park and they were as follows: standardize prices to find the most profitable, create a customer loyalty and retention program, efficiently log all maintenance performed on every attraction, and above all else create the best experience possible at an amusement park. His first order of business was to standardize all prices to know exactly what rides were most profitable and what he could possibly charge more or less for in the future depending on the attraction’s popularity. Secondly, our general manager created a customer incentive program through running queries to see if our visitors haven’t traveled to Adventure Place in a certain amount of time. With this information he can see the last date a customer had visited the park and add them to a personalized email blast that makes the customer feel they are valued by our company. The maintenance schedule had originally been a problem for Adventure Place because before the new year, employees were not required to log their maintenance performances and there was no official way to check that these rides were checked before the start of every day. Before our new general manager, rides would shut down throughout the day and would not be operational until the next business day; but now that we know all rides are being serviced, we are confident there will not be any down-time throughout our business day. 1.2 Introduction We are experiencing a rotation of managerial staff. The new general manager has been hired from an investment firm and has no previous amusement park experience but is very interested to learn. Adventure Place has been losing a lot of money recently because the customers do not feel they are valued by us and rides have been breaking down constantly. He has created a checklist of things he wants to have accomplished before his six-month review that will take place on June 1st. These will include: flattened prices, a customer rewards program, and a full revamp of our maintenance on all of our attractions. He guarantees this will fix all of the problems Adventure Place has been experiencing. 1.3 Business / Enterprise Rules
  • 4. 1. Each Visitor that comes to Adventure Place must purchase at least one ticket through the Ticket Booth. 2. Each Visitor will be asked to supply their Zip Code and Email address. 3. The Ticket Booth will sell the tickets to each Visitor. An ID number will be generated for each new visitor that comes. An OrderID will hold all of the information pertaining to the one specific attraction transaction. An OrderID must have at least one AttractionID, but can have more, and also only one VisitorID can be associated with an OrderID. 4. Each Attraction requires the Visitor to have at least one ticket to ride one time. 5. At least one Maintenance Staff member must be on the Maintenance Schedule for each day, but each Maintenance Staff member may only service one ride per day. 6. Each entry in the Maintenance Schedule will contain: its own Maintenance ID, the Maintenance Staff member working on the attraction, the ID number of the attraction, the starting and ending time of the maintenance and a description of the job being done. 7. Each entry in the Attraction Schedule will contain: its own Shift ID, the Attraction Staff member working on the attraction, the ID number of the attraction and the starting and ending time of the shift. 8. Every attraction must be serviced and inspected each day by at least one member of the Maintenance Staff, but could be serviced by more than one member of the Maintenance Staff.
  • 5. 1.4 Entity – Relationship Diagram 1.5 Relations ● Visitor - Ticket Booth (One to Many) ● Ticket Booth - Attraction (One to One) ● Attraction - Maintenance Schedule (One to Many) ● Attraction - Attraction Schedule (One to Many)
  • 6. ● Attraction Schedule - Attraction Staff(One to Many) ● Maintenance Schedule - Maintenance Staff (One to Many) 1.6 Implementation Details 1.6.1 Visitor Table CREATE TABLE `Visitor` ( `VisitorID` int(11) NOT NULL, `LastName` varchar(25) NOT NULL, `FirstName` varchar(25) NOT NULL, `ZIP` char(5) DEFAULT NULL, `Email` varchar(100) DEFAULT NULL, `Date_Last_Visited` date NOT NULL, PRIMARY KEY (`VisitorID`));
  • 7. 1.6.2 TicketBooth Table CREATE TABLE `TicketBooth` ( `OrderID` int(11) NOT NULL, `VisitorID` int(11) NOT NULL, `AttractionID` varchar(5) NOT NULL, `PurchaseDate` date NOT NULL,
  • 8. `Quantity` int(10) DEFAULT NULL, `Total` decimal(10,2) DEFAULT NULL, PRIMARY KEY (`OrderID`,`AttractionID`,`VisitorID`), KEY `TicketBooth_Visitor_FK` (`VisitorID`), KEY `TicketBooth_Attraction_FK` (`AttractionID`), CONSTRAINT `TicketBooth_Attraction_FK` FOREIGN KEY (`AttractionID`) REFERENCES `Attraction` (`AttractionID`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `TicketBooth_Visitor_FK` FOREIGN KEY (`VisitorID`) REFERENCES `Visitor` (`VisitorID`) ON DELETE NO ACTION); 1.6.3 Attraction Table CREATE TABLE `Attraction` ( `AttractionID` varchar(5) NOT NULL, `Name` varchar(15) NOT NULL, `Description` varchar(150) NOT NULL, `Price` decimal(12,2) NOT NULL, PRIMARY KEY (`AttractionID`));
  • 9. 1.6.4 AttractionSchedule Table CREATE TABLE `AttractionSchedule` ( `ShiftID` varchar(5) NOT NULL, `AttractionID` varchar(5) NOT NULL, `StaffID` int(11) NOT NULL, `Time_Start` datetime DEFAULT NULL, `Time_End` datetime DEFAULT NULL, PRIMARY KEY (`ShiftID`), KEY `AttractionSchedule_MaintenanceStaff_FK` (`StaffID`), KEY `AttractionSchedule_Attraction_FK` (`AttractionID`), CONSTRAINT `AttractionSchedule_Attraction_FK` FOREIGN KEY (`AttractionID`) REFERENCES `Attraction` (`AttractionID`) ON DELETE CASCADE ON UPDATE CASCADE,
  • 10. CONSTRAINT `AttractionSchedule_MaintenanceStaff_FK` FOREIGN KEY (`StaffID`) REFERENCES `AttractionStaff` (`StaffID`) ON DELETE CASCADE ON UPDATE CASCADE); 1.6.5 AttractionStaff Table CREATE TABLE `AttractionStaff` ( `StaffID` int(11) NOT NULL, `LastName` varchar(25) NOT NULL, `FirstName` varchar(25) NOT NULL, `YearOfHire` int(4) NOT NULL, PRIMARY KEY (`StaffID`));
  • 11. 1.6.6 MaintenanceSchedule Table CREATE TABLE `MaintenanceSchedule` ( `MaintenanceID` int(11) NOT NULL, `AttractionID` varchar(5) NOT NULL, `MaintenanceStaffID` int(11) NOT NULL, `Time_Start` datetime DEFAULT NULL, `Time_End` datetime DEFAULT NULL, `Description` varchar(200) DEFAULT NULL, PRIMARY KEY (`MaintenanceID`), KEY `MaintenanceSchedule_MaintenanceStaff_FK` (`MaintenanceStaffID`), KEY `MaintenanceSchedule_Attraction_FK` (`AttractionID`), CONSTRAINT `MaintenanceSchedule_Attraction_FK` FOREIGN KEY (`AttractionID`) REFERENCES `Attraction` (`AttractionID`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `MaintenanceSchedule_MaintenanceStaff_FK` FOREIGN KEY (`MaintenanceStaffID`) REFERENCES `MaintenanceStaff` (`MaintenanceStaffID`) ON DELETE CASCADE ON UPDATE CASCADE);
  • 12. 1.6.7 MaintenanceStaff Table CREATE TABLE `MaintenanceStaff` ( `MaintenanceStaffID` int(11) NOT NULL, `LastName` varchar(25) NOT NULL, `FirstName` varchar(25) NOT NULL, `YearOfHire` int(4) NOT NULL, PRIMARY KEY (`MaintenanceStaffID`));
  • 13. 1.7 Database Manipulation and Control 1.7.1 Customer Loyalty System SELECT Email, FirstName, LastName, Date_Last_Visited FROM Visitor WHERE Date_Last_Visited <'2015-01-31' ORDER BY Date_Last_Visited;
  • 14. 1.7.2 Revenues SELECT TB.AttractionID, Name, Sum(Total) AS AttractionRevenue FROM TicketBooth TB INNER JOIN Attraction A ON TB.AttractionID=A.AttractionID WHERE PurchaseDate BETWEEN ‘2015-01-01’ AND ‘2015-03-31’ GROUP BY AttractionID ORDER BY AttractionRevenue DESC; 1.7.3 Maintenance SELECT A.AttractionID, MS.MaintenanceStaffID, MS.FirstName, MS.LastName, M.Description, M.Time_Start, M.Time_End FROM MaintenanceStaff MS INNER JOIN MaintenanceSchedule M ON MS.MaintenanceStaffID=M.MaintenanceStaffID INNER JOIN Attraction A ON M.AttractionID=A.AttractionID WHERE A.AttractionID='RC01';
  • 15. SELECT FirstName, LastName, YearOfHire FROM MaintenanceStaff WHERE EXISTS(SELECT MaintenanceStaffID,AttractionID FROM MaintenanceSchedule WHERE MaintenanceSchedule.MaintenanceStaffID=MaintenanceStaff.MaintenanceStaffID AND AttractionID='RC01'); 1.7.4 Visitor Preference SELECT COUNT(DISTINCT(VisitorID)) AS UniqueVisitors, AVG(Quantity) AS AverageQuantity FROM TicketBooth; SELECT TB.AttractionID,A.Name,COUNT(DISTINCT VisitorID) AS UniqueVisitors, AVG(Quantity) AS AverageTicketsPurchased FROM TicketBooth TB INNER JOIN Attraction A ON TB.AttractionID=A.AttractionID WHERE PurchaseDate BETWEEN '2015-01-01' AND '2015-03-31' GROUP BY AttractionID ORDER BY UniqueVisitors DESC; 1.7.5 Customer Rewards
  • 16. SELECT DISTINCT TB.VisitorID, V.FirstName, V.LastName, V.Zip, SUM(Quantity) AS Quantity, SUM(Total) AS Total FROM TicketBooth TB INNER JOIN Visitor V ON TB.VisitorID=V.VisitorID GROUP BY TB.OrderID ORDER BY Total DESC LIMIT 10; 1.7.6 Employee Schedule
  • 17. CREATE VIEW Attraction_Schedule_4_27AS SELECT AT.AttractionID,Name, AT.StaffID,FirstName, LastName, Time_Start,Time_End FROM AttractionSchedule AT INNER JOIN AttractionStaff ATSON AT.StaffID=ATS.StaffIDINNER JOIN AttractionA WHERE AT.AttractionID=A.AttractionID AND Time_Start LIKE '2015-04-27%' ORDER BY AttractionID, Time_End; 1.8 Notation of E-R Diagrams Each visitor has to buy at least one ticket to enter the park, but one ticket can be bought by one or many customers. The ticket booths relate to one specific attraction and one attraction can only be associated with one specific admission with a single ticket. Rides must be serviced once a day by one or more maintenance workers, and attractions must also be manned by one or more attraction staff. The schedule of attraction staff is determined by a specific identifier to their shift number and each staff member can only have one specific number for a specific task. 1.9 Conclusion The implementation of this database was very important to effectively grade the performance of our new general manager. The information he presented us told us exactly what we needed to know in reference to what attractions our visitors were most interested in and how
  • 18. we can better plan for the future. His customer loyalty program was a great success and we are seeing more repeat customers than ever before, according to the data we were provided. Finally, we have not had more than a few hours that an attraction has been down and we could not say that before our current general manager. The maintenance schedule that was created has solved so many problems we were having and we will no longer lose money because a ride has to be shut down for the day. It is our pleasure to say that we have extended the employment of our general manager and we have many plans for our future. With his help, we want to expand Adventure Place by adding more attractions and doubling our staff within the next five years. We have made a lot of progress in the past six months and we have nothing but confidence for the future as our business has been completely turned around. 1.10 Recommendations We have few recommendations to make since the database project clearly outlined many of the problems Adventure Place was having. First of all, we will change the price of the general admission depending on the attraction our visitors will want to use. The prices will have separate variations of dollars or cents to either make more profit on some attractions or create more interest for other rides because of their discounted prices. We plan to keep up with, and constantly try and improve our customer loyalty program because we wouldn’t be as successful as we are today without our loyal visitors. Our plan is to revamp the maintenance schedule for the future and make it more detailed so anyone can read it and possibly understand how to maintenance our rides. This may be a concern for future employees who are not experienced as our current workers, but we would like to have documentation related to certain maintenance routines so anyone can search for the type of maintenance they are trying to perform and will be able to teach themselves. Finally, we will constantly be monitoring the amount of visitors we have and the tickets we sell through our new database system. We owe all of our success to our general manager and will build upon the foundation he has provided us.