Write required sql statements to query the database

Assignment Help Database Management System
Reference no: EM13963742

Aims:

• To analyse and comprehend a given ER diagram and Relational Data Structures;

• To implement a database based on the given ER diagram and Relational Data Structures;

• To write required SQL statements to query the database; and

• To write SQL statements to manipulate the data in the database.

Creating and Using a Database for Discerning Event Organisers (DEO)

Assignment Specification

Discerning Event Organisers (DEO) now require an implementation of the design made in Assignment 1 so that they can see how the system would operate. You have had discussions with the client about the perceived inadequacies of the referencing information and have suggested that these keys should be changed to allow for a more expansive list of options in the future. The client however is happy with the number and type of codes they can use but when you suggest then that some of this reference information might be more conveniently physically implemented using constraints on columns they insist on using the logical design presented to them. You therefore have settled on the logical ER diagram and corresponding relational data structures from assignment1 with some minor changes. This documentation is included at the end of this document.

You are now required to demonstrate a working database system by creating, inserting and querying the data. You should create your database according to the documentation provided. Make sure that your implementation is consistent with this design, i. e., your table names, field names, and data types are according to the specifications provided in this document. The implementation phase includes writing SQL statements to create a database and its tables, populating the tables with appropriate test data and writing a number of queries to create reports that can be used by the management team. You have been provided with a script - ITECH1006_5006_Assignment2_Summer_Semester_2015_201527_Some_Starting_Inserts.sql - with some test data inserts - SUPPLIER and corresponding ADDRESS and ADDRESS_TYPE records as well as some SUPP_PROD, PRODUCT, PROD_TYPE and EVENT_ORDER_ITEM records. You need to incorporate this information into your database and complete the insertion of other data (there should be at least five records in each of the tables where possible).

Implementation of the Database and Manipulation of the Data

You are required to perform the followings tasks:

1. Create a text file named Create_<StudentID>.sql (for example, Create_3087654.sql) that will contain SQL statements to:

I. Create a database named DEODB_<StudentID>;

II. Create all of the tables for the database according to the Relational Data Structures given at the end of this document.

2. Create a text file named Insert_<StudentID>.sql that will contain SQL statements to:

I. Insert at least five records in each of the tables. The test data inserted into the table must ensure that each of the queries, specified in Task 4, outputs at least one record.

3. Create a text file named Query_<StudentId>.sql that will contain all the queries to satisfy the following:

I. Display a list of all food type products sorted in descending order according to their product description. Display the product description, product type and product code.

II. Find the addresses whose street details have more than one word and the last word is six characters long and ends with a ‘ue'. Display the street details, city and address type in ascending order according to the street details.

III. Display a list of all those customers with a delivery address. List the customer id, customer name, customer email, customer phone, customer contact name, the delivery address location and the description of the type of address. Make sure you output the delivery address as one column or field only and sort in descending order according to the customer name.

IV. List the details of the earliest event DEO recorded/serviced. Show the event_id, event location, customer name, attendees, event date and time of that event.

V. Show a list of all products and their suppliers where the product price is greater than $500.00 or the cost is less than or equal to $10.00. Display the product id, product description, product type, product type description, price, cost, supplier id and business name.

VI. List the staff members who have earned more than $200 so far working for DEO. List the staff member's name, phone number, TFN, hourly rate, type and the total money earned. Show the list sorted by the total money earned with highest earning employee first.

VII. List the details - event_id, cust_id, location, event type, attendees, event date and time and event duration - and the total price charged for all products supplied per event for all events.

VIII. Find the staff member(s) - listing the staff member's name, phone number, TFN, hourly rate, type and type description - whose pay rate is greater than the average pay rate of all staff.

IX. List the government level - government level and government description - for which there are no customer records as well as the school level - school level and description - for which there are no customer records. Make sure you only have one listing as output.

X. Using a correlated sub-query and the NOT EXISTS special operator, either list the number of or list all the details of the supplier product records from the supplier product table that have not been used in any event order.

4. Create a text file named Transaction_<StudentId>.sql that will perform the following tasks. For each item, I and II, all changes must be a single unit of work. Insert additional data in the tables appropriately if needed:

I. A new customer decides to ask DEO to provide catering services for their jubilee birthday. You first need to add their customer record with the following details:

i. The customer is St. Stephen's College, 230 Brinkman Way, Fortuna, VIC 3678 a catholic secondary college;

ii. Their postal address is PO Box 878 Fortuna Mail Centre, Fortuna, VIC 3679;

iii. The general contacts for the school are either email - [email protected] or school phone number - 03 4676 8973;

iv. The contact for the school is the headmaster, Mr. Stephen Doublee, whose email is [email protected] and mobile phone 0448768876

II. You now need to enter details about the event:

i. It will be held in the college gymnasium with 200 expected guests;

ii. At this stage the date and time of the event are the 30th March 2016 at 7:00pm;

iii. It is expected the event will go for four hours.

You would then probably go through a process of adding an order, event order items and adding staff members to service the event, including appointing an event manager, but you will not be asked to do that for this assignment.

You are required to adhere to the following output formatting conventions:

• All monetary values should be printed with a dollar symbol ($) or at least the heading should contain that symbol and all durations should be displayed with the suffix ‘hrs' or have that included in the heading;

• You must use consistent and legible formatting in laying out your SQL queries; and

• You should include (brief) comments for your queries.

Attachment:- Assignment.rar

Reference no: EM13963742

Questions Cloud

What is desorption given to ranges of the repulsive force : A piano tuner strikes and holds down the key on a piano that should produce a sound of frequency 440 Hz. At the same time he sounds a tuning fork that is known to have a frequency of 440 Hz. The resulting sound heard by the piano tuner fluctuates ..
What was starbucks strategy when howard schultz launch it : What was Starbucks's strategy when Howard Schultz first launched it? How should Starbucks define its target market and position after its decline in 2007
Determining the network breakdowns : Suppose that network breakdowns occur randomly and independently of each other on an average rate of three per month. (a) What is the probability that there will be just one network breakdown during December? Interpret.
What is the energy of the photons in the light from a diode : Calculate the number of half-wavelengths in a ruby laser operating at a wavelength of 694.3 nm in air, given that the ruby rod, silvered on the ends, is exactly 10.0 cm long
Write required sql statements to query the database : Analyse and comprehend a given ER diagram and Relational Data Structures - implement a database based on the given ER diagram and Relational Data Structures;
Daily proportion of major automobile : The daily proportion of major automobile accidents across the United States can be treated as a random variable having a beta distribution with α = 6 and β = 4. Find the probability that, on a certain day, the percentage of major accidents is less..
What is the voltage in the chamber at full scale deflection : What exposure (in Roentgen) does full scale deflection correspond to? What absorbed dose in air, and tissue, does it correspond to?
Where does the energy associated with the absorption go : Or is the transmitted part perpendicular to these strands? Where does the energy associated with the absorption go?
What is the most important thing to remember : What is the most important thing to remember when it comes to limits in Calc?

Reviews

Write a Review

Database Management System Questions & Answers

  Explain a minimum of three 3 heuristics to optimize

your supervisors and customers are very impressed with the database you have put together. however there is still that

  What physical and logical topologies are recommend

Draw a simple floor plan for New Cenrury Wellness group and include the placement of all network nodes including the placement of a server, and network equipment. How many ports will your switch need to accommodate?

  Create documentation describing the principles

Create documentation describing the principles and importance of normalization in relation to this project and the process by which this project was normalized.

  Write candidate keys and referential integrity constraints

Transform the tables into one or more tables in BCNF. Write the primary keys, candidate keys, and referential integrity constraints.

  Performance of a distributed database

How can replication help the performance of a distributed database and in what situations can replication hurt the performance of a distributed database?

  Draw a context diagram and a level-0 dfd

develop the report having each task clearly numbered togetherwith your answer. You are also expected to write an introduction and conclusion for this report.In performing the following tasks, you have to strictly follow all diagramming rules used ..

  Analysis of the sales numbers to management

Create a graph or chart that compares the data in a meaningful way, i.e. compare regions by month, compare products by month, etc. Create a spreadsheet formatted to present your analysis of the sales numbers to management.

  Question 1 the systems analyst proposes the subsequent two

question 1. the systems analyst proposes the subsequent two relationships between the flight and pilot entities what

  Questions related to normalization

Determine the steps in the development of an effective Entity Relationship Model (ERM) Diagram and determine the possible iterative steps / factors that one must consider in this process with consideration of the HR core functions and responsibili..

  Create state transition diagram to describes student states

Create a state transition diagram that describes typical student states and how they change based on specific actions and events.

  Limitations of the relational model

Identify and describe three limitations of the relational model and recommend strategies to overcome these limitations.

  Discuss the main characteristics of the database approach

Please submit at least 250 words for this portion of the discussion forum. Discuss the main characteristics of the database approach and how it differs from traditional file systems. With what other computer system software does a DBMS interact

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd