IFN 554 Assessment 2 Assignment Help

 

Response Sheet 

IFN554 Databases 

Semester 2SEM5C 2024

IFN 554 Assessment 2

SQL

All students will need to submit a PDF file of their responses.
 

Student Name

Student Number

Tutorial Group:

Student Declaration

By submitting this assignment, I am aware of the University rule that a student must not act in a manner which constitutes academic dishonesty as stated and explained in the QUT Manual of PoliciesandProcedures.Iconfirmthatthisworkrepresentsmyindividualefforts.Ideclare  that it does not contain plagiarized material.

 

FullNameStudentNo.Signature
   


Complete the following tasks and note your responses. Reminder – all snapshots must be clear and readable

Task 1 [6 marks] 

In this task you are required to write an SQL script that builds a database to match the relational model below. Your database should be named “Heavenly Department Store”.

The SQL statements in the script must be provided in the correct order. 

Heavenly Department Store relational model is as follows:

Note: Primary keys are denoted by bold and underline and foreign keys are in italics

  • Supply (SupplierNr, ItemNr, QtyNr)
  • Use (ItemNr, DeptCode)
  • Item (ItemNr, ItemName, CountryMade) 

    Note: 1.1 ItemNr or Name both possible PK using ItemNr as preferred PK

 

  • Supplier(SupplierNr, SupplierName, FaxNr, SupplierCountry)

    Note: 1.1 SupplierNr or FaxNr or SupplierName are all possible PK using SupplierNr as preferred PK

FOREIGN KEYS

  • Supply(SupplierNr) references Supplier(SupplierNr)
  • Supply(ItemNr) references Item (ItemNr)
  • Use (ItemNr) references Item (ItemNr)

Other Constraints and Remarks

  • All primary and foreign key attributes that you use are strings (not text) comprising eight digits (8).
  • INTEGER type must be used for QtyNr is mandatory and must be greater than 0.
  • TEXT type must be used for all other attributes.
  • SupplierName and ItemName must contain a value (you will need to add values to these attributes)

(Insert snapshots of tables and values here)

Task 2 [14 marks]

Wehaveprovidedyou withtheHoteldatabase(Filename:IFN554_5C_Hotels.sqlyoucandownloadfrom Canvas) to be used with MySQL Workbench. You must use this database in MySQL Workbench to extract the necessary information as per the following query requirements. 

 

Note:AlltasksrequiringSQLmustprovideasascreensnapshotoftheexecuteSQLtab in MySQL Workbench that includes all sections. Snapshots must be readable

  • SQL Query code
    • Result Grid (table, view, update, new information etc.). The teaching team must be able to see the successful execution of the code
    • Action Output result
    • Schemas (where necessary)

In your database - a booking commences at 2 pm (check in) and finishes at 10 am the following day (check out). Example: A booking for 3 nights is made on Tuesday 8th August with a check-in date of Thursday 10th August from 2pm and a check-out time of Sunday 13th August at 10 am.

 

 WriteanSQLscriptforqueryingdataforthefollowing information.
2a.List the hotelNo which has 2 or more single rooms [2 marks]
2a responseInsert code and result snapshot here
2b.How many different guests visited the Meriton Hotel? [2 marks]
2b. responseInsert code and result snapshot here
2c.

What is the total income from bookings for the Meriton Hotel? 

[3 marks]

2c. responseInsert code and result snapshot here
2d.List the guests’ names who have visited more than 2 times [3 marks]
2d responseInsert code and result snapshot here
2e.For each hotel, list the room type, for each room type list the number of each room type and the number with bookings [4 marks]
2e. responseInsert code and result snapshot here

Task 3 [5 marks] – Individual

Perform the following tasks.

 

3a.Write a command to create an index on hotel name and show the results [1 mark]
3a. responseInsert code and result snapshot here
3b.

Create a user with the name ‘Mickey’ @ local host with password ‘iloveORM’ and force the user to update the password [01 mark]. 

Show the results. [1 mark]

3b. responseInsert code and result snapshot here
3c.Create a view called HotelSummaryView – list the hotelNo, type and price of each room. Order the result by hotelNo, room type and price [1 mark]

3c.

response

Insert code and result snapshot here
3d.Grant permissions to select and read this view . Show results[1 mark]
3d. responseInsert code and result snapshot here
3e.Revoke permissions and show results [1 mark]
3e. responseInsert code and result snapshot here

Task 4 [5 marks]

Perform the following tasks continue using the Hotel database provided.

 

4a.Update the prices of all single rooms by 5% and show results [1 mark]
4a. responseInsert code and result snapshot here
4b.Insert 2 rows of new data in the table Guest and Booking [2 marks]
4b. responseInsert code and result snapshot here
4c. Delete one of the rows your inserted into the Guest table [2 marks]
4c response(Insert snapshot here)

Task 5 [10 marks] 

Using the following table structure, identify all functional dependencies and then decompose this table into a set of 3NF relations.The table is in 0NF so please apply all rules accordingly.

 

Assumptions:

  • Product Price is Per Unit
  • There are not multivalues

 

 

Order No

Order Time

(dd/mm/yyyy/hh:mm)

Cust DOB (dd/mm/yyyy)Total (AUD$)Item #Order ProdOrder Qty

Customer

No

Customer

Name

Product

No.

Product NameSupplier

Prod

RRP (AUD$)

Age
105/11/2023 15:0001/11/19626001P45673007James BondP4567WristwatchSeiko20062
2305/12/2023 15:0001/11/19503601T12451024Sean ConneryT1245CufflinksHarrods2074
2305/12/2023 15:0001/11/19503602P12991024Sean ConneryP1299Tie ClipHarrods12074
2305/12/2023 15:0001/11/19503603T13041024Sean ConneryT1304ShoesSketchers22074

Insert response here All tables must be in 3NF.

Task 6 [10 marks]

The use of Generative AI such as ChatGPT is not permitted for this task. QUT policy states the following: “If you submit an assessment “that has been produced or modified, wholly or in part, by an artificial intelligence tool, algorithm, or computer generator where such actions are not authorised in the assessment task”, this may be treated as a breach of our Academic Integrity Policy and appropriate penalties imposed.

This task is a reflective task. You are required to answer the question below in your own words. Your answer should be your opinions, experience and personal perspective. Your response should be supported by research to validate your viewpoints. Provide in text referencing where appropriate. Your response should be between 400 and 600 words not including references.

Question: 

How does the use of Electronic Health Records (EHRs) impact your privacy and confidentiality as a patient? What measures do you think modern EHealth should take to protect your information? How do you want your data managed?  What actions are taken or should be taken to ensure your data is protected and used in an appropriate and authorised manner?

Insert response here 

 

Example invalid form file feedback

Join our 150К of happy users

Get original papers written according to your instructions and save time for what matters most.