Moshtix Case Study High Distinction assignment By Annie Tran.

Slides:



Advertisements
Similar presentations
WHAT D IS RAW, UNPROCESSED FACTS AND FIGURES COLLECTED, STORED AND PROCESSED BY COMPUTERS.
Advertisements

MSc IT UFCE8K-15-M Data Management Prakash Chatterjee Room 2Q18
Database design by Sarah Huynh.
1 Constraints, Triggers and Active Databases Chapter 9.
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
COMP 3715 Spring 05. Working with data in a DBMS Any database system must allow user to  Define data Relations Attributes Constraints  Manipulate data.
SQL Lecture 10 Inst: Haya Sammaneh. Example Instance of Students Relation  Cardinality = 3, degree = 5, all rows distinct.
Database Systems: Design, Implementation, and Management Tenth Edition
Accounting System Design
Introduction to Structured Query Language (SQL)
Cs3431 Constraints Sections 6.1 – 6.5. cs3431 Example CREATE TABLE Student ( sNum int, sName varchar (20), prof int, CONSTRAINT pk PRIMARY KEY (snum),
Maintenance Modifying the data –Add records –Delete records –Update records Modifying the design –Add fields into tables –Remove fields from a table –Change.
Introduction to Structured Query Language (SQL)
RELATIONSHIP  THE WAY TABLES ARE RELATED  A TABLE MUST PARTICIPATE IN AT LEAST ONE RELATIONSHIP  IN A BINARY RELATIONSHIP TWO ENTITIES PARTICIPATE 
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
5 Chapter 5 Structured Query Language (SQL1) Revision.
1 SYSTEMS DESIGN Pertemuan 13 s.d 20 Matakuliah: A0554/Analisa dan Perancangan Sistem Informasi Akuntansi Tahun: 2006.
A Guide to MySQL 7. 2 Objectives Understand, define, and drop views Recognize the benefits of using views Use a view to update data Grant and revoke users’
Introduction to Structured Query Language (SQL)
Implementing an REA Model in a Relational Database
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 7 Introduction to Structured Query Language (SQL)
Database Systems Relational Model Concepts Toqir Ahmad Rana Database Management Systems 1 Lecture 17.
Helen Spiropoulos Benjamin Mills Nicoleta Bikrogiannis Jessica El-chaar.
The ZhangLamHoyts Case Study De Wen Zhong Vincent Tang Distinction Assignment, Autumn 2007.
Chapter 6: Integrity and Security Thomas Nikl 19 October, 2004 CS157B.
©Silberschatz, Korth and Sudarshan6.1Database System Concepts Chapter 6: Integrity and Security Domain Constraints Referential Integrity Assertions Triggers.
The 2 nd Hand Student Book Database Jon Havier High Distinction Assignment, Autumn 2007.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
The Carnie_MyCareer Case Study Peter Ebeid Dane Harris Stephanie Ho Chris Zaharia Distinction Assignment, Autumn 2007 Presented by.
STA TRAVEL AUSTRALIA Rumana Islam HD Assignment 3, Autumn 2007.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
PLUG IT IN 3 Fundamentals of Relational Database Operations.
“National Electoral Division Profiles” Case Study Vincent Tang High Distinction Assignment, Autumn 2007.
Assignements. CSC343: Intro. to Databases2 Exercise 1 Superkeys: Candidate keys: Primary key:
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
What we’ve learnt Doc 5.69 Doc 5.70 Section 1-3. A simple database Related objects Tables hold the data Forms, reports, queries to access the data.
Nitin Singh/AAO RTI ALLAHABAD 1 SQL Nitin Singh/AAO RTI ALLAHABAD 2 OBJECTIVES §What is SQL? §Types of SQL commands and their function §Query §Index.
Recap of SQL Lab no 8 Advance Database Management System.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Creating Databases for web applications [Complete presentations] More SQL Class time: discuss final projects. Do posting if you have not done it.
© 2002 by Prentice Hall 1 Database Processing with Microsoft Access David M. Kroenke Database Concepts 1e Appendix A.
Database Processing with Microsoft Access Appendix DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Dec 8, 2003Murali Mani Constraints B term 2004: lecture 15.
Constraints cis 407 Types of Constraints & Naming Key Constraints Unique Constraints Check Constraints Default Constraints Misc Rules and Defaults Triggers.
1 SQL - II Data Constraints –Applying data constraints Types of data constraints –I/O constraints The PRIMARY KEY constraints The FOREIGN KEY constraints.
7 1 Constraints & Triggers Chapter Constraints and triggers? Constraints: Certain properties that the DBMS is required to enforce –E.g. primary.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
SQL – Structured Query Language
SQL LANGUAGE and Relational Data Model TUTORIAL Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
ITEC 3220A Using and Designing Database Systems Instructor: Prof. Z. Yang Course Website: 3220a.htm
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
Database Principles Autumn 2007 High Distinction Assignment REBEL Sport Online Author: Joseph Diver.
Session 1 Module 1: Introduction to Data Integrity
1 MySQL and SQL. 2 Topics  Introducing Relational Databases  Terminology  Managing Databases MySQL and SQL.
Logical Database Design and the Relational Model.
Description and exemplification use of a Data Dictionary. A data dictionary is a catalogue of all data items in a system. The data dictionary stores details.
Jenny Jirathammakul High Distinction Assignment Database Principles Autumn, 2007 Melbourne City Toyota.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
SCUHolliday - coen 1789–1 Schedule Today: u Constraints, assertions, triggers u Read Sections , 7.4. Next u Embedded SQL, JDBC. u Read Sections.
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
Chapter 6 Many-to Many Relationship. Agenda AutoNumber Many-to-many relationship Cascaded updating and deleting Auto Lookup Parameter query Total query.
THE DATABASE OF MSY TECHNOLOGY PTY. LTD PRODUCT Ronald Diningrat High Distinction Assignment Autumn 2007.
CS580 Advanced Database Topics
The TicketekCase Study
Relational Database Design
CPSC-608 Database Systems
Presentation transcript:

Moshtix Case Study High Distinction assignment By Annie Tran

MOSHTIX-How it applies to the real world This website involves booking tickets for a variety of events in different states across Australia. Users can either purchase their moshcard at a Moshtix outlet and register their details on the site or they can purchase tickets online or through phone using a credit card. They can also register as a member without previously ordering any tickets. On the website, events can be searched by date, venue, category (e.g. Live music, festivals) or by keyword.

Moshtix website

ENTITY RELATIONSHIP DIAGRAM Member memberID memberName member memberMobile memberGender memberDateofBirth CreditCard creditCardName creditCardNumber creditCardType creditCardCVV creditCardExpiry Event eventID eventName eventVenue* eventDate eventTime eventType eventSaleCloseDate eventSaleCloseTime eventPrice bookingFee eventSoldOutClosed Venue venueName venueAddress venueContact PostageContact postageID memberID* postageAddress postageSuburb postageCountry postageState postagePostcode Booking bookingID memberID* eventID* ticketType quantity entryMethod moshcardNumber

Single-to-many relationship Event eventID eventName eventVenue* eventDate eventTime eventType eventSaleCloseDate eventSaleCloseTime eventPrice bookingFee eventSoldOutClosed Venue venueName venueAddress venueContact One venue can book for many different events

Single-to-many relationships venuenameVenueaddressvenuecontact Amplifier Barrear 383 Murray St Perth WA (08) The Basement29 Reiby Place Sydney NSW (02) eventIDeventNameeventVenueOther 1Celibate Rifles & Cosmic Psychos Amplifier Bar… 2Mick Hart The Basement… Primary key Foreign key

Many-to-many relationship This ERD shows that in a many-to-many relationship, many members can attend many different events that are booked under Moshtix. However, only one person can book into a single event. Also, only one booking is made for one event. Member memberID memberName member memberMobile memberGender memberDateofBirth Event eventID eventName eventVenue* eventDate eventTime eventType eventSaleCloseDate eventSaleCloseTime eventPrice bookingFee eventSoldOutClosed Booking bookingID memberID* eventID* ticketType quantity entryMethod eventPrice bookingFee moshcardNumber

Many-to-many relationship eventIDeventNam e eventVenueOther 1Celibate Rifles & Cosmic Psychos Amplifier Bar… 2Mick Hart The Basement… memberidmemberNa me Etc. 1Annie Tran… 2Rachel Le… bookingIDmemberIDeventiIDEtc. 117… 245… 354…

QUERIES-Simple Query Find all shows that are playing at the Metro Theatre SELECT eventName, eventVenue FROM moshtix_event WHERE eventVenue = 'Metro Theatre’; eventname | eventvenue Dinosaur Jr Over 18s | Metro Theatre Dinosaur Jr All Ages | Metro Theatre Gotye All Ages | Metro Theatre

QUERIES-Natural Join Find the names of all people attending the Dinosaur Jr All Ages concert SELECT memberName FROM moshtix_member NATURAL JOIN moshtix_booking where eventID = ‘10’; membername Annie Tran Rebecca Giang

QUERIES-Cross Product Find the names of all people attending the Dinosaur Jr All Ages concert. SELECT memberName FROM moshtix_member, moshtix_booking WHERE moshtix_member.memberID = moshtix_booking.memberID AND moshtix_booking.eventID = ‘10’; membername Annie Tran Rebecca Giang

QUERIES-Group By GROUP BY clause must include a built in function e.g. COUNT, SUM, AVG If any column is used in the SELECT statement, it must be used in the GROUP BY statement. Find the number events in each venue SELECT eventVenue, count(*) FROM moshtix_event GROUP BY eventVenue ORDER BY eventVenue eventvenue | count Amplifier Bar | 1 Bombay Rock Townsville | 1 Factory Theatre | 1 Hopetoun Hotel | 1 Manly Fishos | 1 Metro Theatre | 3 Rubys Lounge | 1 Spectrum | 1 The Basement | 1 The Gaelic | 2 The Vanguard | 2

QUERIES-Group By with HAVING Find dates with more than one event held on the same day SELECT eventDate, eventName, count(*) FROM moshtix_event GROUP BY eventDate HAVING count(*) >1 ORDER BY eventDate eventdate | count | | | | 2

QUERIES-Sub Query Find the earliest event/s booked through Moshtix SELECT eventName, eventDate FROM moshtix_venue WHERE eventDate <=ALL (SELECT eventDate FROM moshtix_event); eventname | eventdate Celibate Rifles & Cosmic Psychos | The Red Paintings |

QUERIES-Self Joins Find all users that are booking for events at the Spectrum and the Vanguard SELECT bkg1.bookingid, eve1.eventvenue,eve1.eventname, bkg1.memberid, bkg2.bookingid, eve2.eventvenue, eve2.eventname, bkg2.memberid FROM moshtix_booking bkg1, moshtix_booking bkg2, moshtix_event eve1, moshtix_event eve2 WHERE eve1.eventvenue = 'Spectrum' and eve2.eventvenue = 'The Vanguard' and bkg1.eventid = eve1.eventid and bkg2.eventid = eve2.eventid; order by bkg1.bookingid;

QUERIES-Self Joins bookin gid eventvenueeventnam e mem berid bookin gid eventvenueeventnam e memb erid 9SpectrumSpectrum 3rd Birthday 510The VanguardJamie Hutchings 6 9SpectrumSpectrum 3rd Birthday 515The VanguardIce Cream Hands 3 13SpectrumSpectrum 3rd Birthday 410The VanguardJamie Hutching 6 13SpectrumSpectrum 3rd Birthday 415The VanguardIce Cream Hands 3

Check Statements These statements place a great emphasis on data integrity. They are constraints which are used to validate data entered into the attribute. It verifies any existing condition. If the data does not abide by the specified constraint, an error statement is generated. CONSTRAINT di_table_moshtix_member_memberGender CHECK (memberGender IN ('M','F')), CONSTRAINT di_table_moshtix_member_memberDateofbirth CHECK (memberDateofbirth >= ‘01-Jan-1907’) Any data below this constraint is not considered as valid data Shows which data statements can only be used in the attribute. In this statement, the user can only enter ‘F’ or ‘M’ as valid data

Action statements CREATE TABLE moshtix_booking ( bookingID INTEGER NOT NULL, memberID INTEGER NOT NULL, eventID INTEGER NOT NULL *Insert other attributes* CONSTRAINT moshtix_booking_pk PRIMARY KEY (bookingID), CONSTRAINT moshtix_booking_fk_mid FOREIGN KEY (memberID) REFERENCES moshtix_member ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT moshtix_booking_fk_eid FOREIGN KEY (eventID) REFERENCES moshtix_event ON DELETE CASCADE ON UPDATE CASCADE, This will restrict the user from deleting the information from the member table without deleting anything from the booking table This will allow the user to delete/update any entry made to the booking and the event table.

CREATE A VIEW Create a view to find what events stop selling their tickets on ‘07/07/2007’ CREATE VIEW EVENT (name, dateclose, timeclose) AS SELECT eventName, eventSaleCloseDate, eventSaleCloseTime FROM moshtix_event WHERE eventSaleCloseDate = ‘07-Jul- 2007’; CREATE VIEW

Use of a view Find what events stop selling their tickets on ‘07/07/2007’ name | dateclose | timeclose Dallas Crane | 07-Jul-2007 | 06:00PM Dinosaur Jr Over 18s | 07-Jul-2007 | 05:00PM