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

  Identify the behaviors that created this environment

Identify the behaviors that created this environment. What behaviors would change this into a nurturing climate?

  Exchange commission edgar database

Select a publicly traded corporation for which you would like to work or are currently working. Research the corporation on its own Website, the public filings on the Securities and Exchange Commission EDGAR database and any other sources you can ..

  How difficult would it be to implement your plan

You are managing an e-mail consolidation and upgrade for your organization, and you are focusing on implementing the process of schedule and cost control.

  Print a character and a total

What percentage of time will a 20 MIPS processor spend in the busy wait loop of 65-character line printer when it takes 3 m-sec to print a character and a total of 457 instructions need to be executed to print 65 character lines?

  Develop view for sum of number ordered multiplied by price

Develop a view named OrdTot. It comprises the order number and order total for each order presently on file. (Order total is sum of the number ordered multiplied by quoted price.

  Assume that the database system in your organization has

write a 200- to 300-word short-answer response for the followingsuppose that the database system within your

  Design an information system for grades, review &management

Design an information system for grades, review and management to be used by faculty, department administration and students.

  Modify oracle table data using the correct sql statements

Explain how you could delete the IT department without deleting all the employees who work for that department.

  Create the structure of a table

Create an index on the table "Players", indexing on "Team".

  What level of concurrency is best supported by mimd computer

Could someone please explain to me what are the three levels of concurrency in programs?

  Distinguish the role of databases and database management

Distinguish the role of databases and database management systems in the context of enterprise systems

  What difficulties did you encountered and how did you

write a 200- to 300-word short-answer response for the followingwhat difficulties did you encountered and how did you

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