Designing and building a database application

Designing and building a database application/ Software Engineering

Overview

For this assignment you will implement and query a database from a supplied ER Diagram and Schema. You will be required to write the SQL statements to create the database structures, to fill the database with data and to run queries on the data.

Learning Outcomes Assessed

The following course learning outcomes are assessed by completing this assessment:

– A1. design and implement a relational database using a database management system

– A2. utilise a query language tools and techniques to obtain data and information from a database

– K5. describe relational algebra and its relationship to Structured Query Language (SQL)

– S1. interpret entity-relationship diagrams to implement a relational database

– S2. demonstrate skills in designing and building a database application using a commercially available database management system development tool

– S3. use a query language for data manipulation

Assessment Details

FHTS Incorporated has provided you with a standard solution for the conceptual data model (the ER diagram). You have been commissioned to continue your role (in your capacity as a Database Management System consultant) and to write the SQL statements to create the database and its tables, add data, and to provide SQL solutions to some of their everyday queries. The database should be created based on the ER diagram provided at the end of this document. Some sample data are also provided to be used for inserting data into tables. However, you are also required to insert sufficient data to test the reports given below.

To implement the database

– Translate the ER diagram provided into a relational schema using the correct notations and standards for this course. It should include:

– Table names

– Attribute names and field types (as required by XAMPP)

– Primary and foreign keys identified

– Create a text file called nnnnnnnn-create.sql (where nnnnnnnn is your student number). The file should include:

– The SQL statements to create a database called FHTSnnnnnnnn (where nnnnnnnn is your student ID – e.g. FHTS30011111)

– The SQL statements to create the tables, including their primary keys, foreign keys and the relationships of the tables.

– Create a text file called nnnnnnnn_insert.sql (where nnnnnnnn is your student number). The file should include:

– The SQL statements to load sufficient data into each table you have created to test the queries given below. Sample data has been provided, but you will need to include further data to test the requirements. You should add at least one record to the existing test data for each table.

– You are required to include your name as one of the customers, (you can provide fake address details), but you MUST have your name and give your student id as the phone number.

– Create a text file called nnnnnnnn_query.sql (where nnnnnnnn is your student number). The file should include the SQL statements necessary to display the following reports:

– List all details of all the records in the customer table, sorted by their Last name in descending order.

– List all the customers by their first name and last name in one column, (ensuring a space between the names), with an appropriate title, followed by their phone number and then followed by the name and phone number of the company they work for. Sort this list by the company name in ascending order.

– List the first name, last name and email address of all customers.who are either/or both VIP or Frequent Flyers. (hint, check the fields with “yes” or “no”), Also list the CustVIP and CustFreqFlyer fields, changing their titles to “VIP” and “Frequent Flyer” respectively.

– List all of the VIP customers, with their first name and last name joined in the title, as “VIP Customer”, followed by their years as a customer, and the money they have spent as a customer of FHTS. Hint, look at the sub type.

– List all frequent flyer customers who have made a booking, giving their first and last names, the number of frequent flyer points they have, followed by their frequent flyer rate points, then followed by a column that gives their frequent flyer discount. i.e for each frequent flyer customer on a booking perform the multiplication between their frequent flyer points and their respective frequent flyer rate per points, which is found in the FREQ_FLYER_DISCOUNT table. (This query will entail a number of joins). Also give the last column an appropriate name. Don’t worry about duplicates found from the query, this is due to multiple bookings.

– List the staffId, first name and last name of all staff members who are supervisors, also including the ID and last name of each staff member who reports to them.

– Delete the customer Tim Canterbury.

– Change customer Rachael Bernard name to Rachael Jones.

– List all bookings that have flights to the United States. Include the Booking ID, Customer ID, FlightID, Flight Number, booking date and flight booking date,in the output. (Can you see any errors in the data for the bookings?)

– List all the bookings that don’t contain flights to the United States. This time just list the Booking ID and Customer ID. Use the previous query as a sub-query here.

– Insert a new flight for Air France with the flight number “AF513”. It will depart from the Melbourne airport with a destination to London Heathrow airport. Its departure date is set for 29th September 2016 and its arrival is set for the next day, 30th September 2016. It has a large flight capacity 520 passengers. The fixed flight fee will be $180. The distance is approximately 16,927 km.

– List all accommodation details for sites connected to locations with airports that have the last word “International” in its name.

Your documentation should include:

– A title page clearly stating your name and student ID and your tutor’s name.

– A copy of the relational schema you have developed from the ER diagram provided.

– A copy of the three files you are required to create included in the document (ie nnnnnnnn_create.sql, nnnnnnnn_insert.sql and nnnnnnnn_query.sql).

– Full APA referencing of any resources you have used to complete your submission

Assessment Criteria and Marking Overview Tasks

1. Presentation
– Cover page indicating student name and number and tutor name.
– Page numbers included in report
– Index giving page numbers of various sections
– Overall presentation of the report
– Full APA referencing of all materials used and full disclosure of assistance from all sources including tutors and other students.

2 Revised Schema
– Any assumptions explained
– All tables included
– Data types correct
– Primary and foreign keys indicated and referenced correctly

3. Create Statements
– File runs with no error messages
– Database created correctly
– All tables created correctly
– All primary and foreign keys created correctly
– Any deletion anomalies corrected

4. Insert Statements
– File runs with no error messages
– Default data is inserted correctly
– Additional data for testing is inserted
– Student’s name and number are included in customer file

5. SQL statements

Q a
– Correct syntax
– Correct table used
– Correct use of sorting statement

Q b
– Correct syntax
– Correct tables used
– Where statement correctly formulated and correct using of sorting statements

Q c
– Correct syntax
– Correct tables used
– Where statement correctly formulated

Q d
– Correct syntax
– Correct table used
– Where statement correctly formulated
– Correct indication of desired values

Q e
– Correct syntax and fields used
– Correct tables used
– Correct derived field and calculations
– Where statement correctly formulated

Q f
– Correct syntax
– Correct table used
– Correct use of the primary and foreign keys connections
– Correct answer given in the correct order

Q g
– Correct syntax
– Correct table used
– Correct result for deletion

Q h
– Correct syntax
– Correct table used
– Correct result for update

Q i
– Correct syntax
– Correct tables used
– Where statement correctly formulated
– Output formatted correctly

Q j
– Correct syntax
– Correct use of the sub-query
– Where statement correctly formulated
– Output formatted correctly

Q k
– Correct syntax
– Correct table used
– Inserts done in correct order with correct results

Q l
– Correct syntax
– Correct tables used
– Correct use of the wild card string and comparison
– Output formatted correctly

Order from us and get better grades. We are the service you have been looking for.