Write commands to insert rows in each of the hotel database

Assignment Help Other Subject
Reference no: EM133507568

Databases

Assessment: SQL scripts

Task description:

In Assessment 1, we analysed the core concepts, principles and skills required for understanding the kinds of techniques that may be used to model data, and an ability to develop a concise conceptual model that represents a given universe of discourse.

This assessment will involve the creation of several SQL queries in order to convert the data that is stored in a database into information that can be processed and understood by a human decision-maker.

You will use your knowledge from the lectures together with the techniques practiced in the tutorial sessions and apply both a set of tasks that refer to the SQL representation of a relational database. You will also make a critical reflection about the role of ethics in the use of data from the perspective of data management systems.

Learning Outcome 1: Apply standard querying techniques to the retrieval and manipulation of data.
Learning Outcome 2: Generate effective, ethical and culturally sensitive solutions to database management.
Learning Outcome 3: Apply visual and written communication techniques to explain how the proposed design and solution meets data management needs.

Task 1
You are required to create a database for a fictitious Online Shoe Store called 'WalkthisWay' (think Williams Shoes or Novo) for Task 1. Write an SQL script that builds a database to match the relational model below. These SQL statements in the script must be provided in the correct order. The solution will be demonstrated in one or more MySQL screen snapshots that include the Execute SQL tab SQL code and the results of the executed statements.

Note: Primary keys are denoted by bold and underline and foreign keys are in italics The 'WalkthisWay' relational model:
Store (storeld sName, sAddress, sPostCode)
StoreEmployee (empld, eName, eAddress, ePostCode, eEmail, eMobPh, eStartDate, storeld) Customer (custld, cName, cMobilePh, cEmail, cBirthDate)
Order (orderld oDate, total, GST, deliveryAddress, orderStatus, custld)
OrderDetail (orderid, prodld, quantity, retail Price)
Payment (payld, type, amount, pDate, bankTransactNo, orderid)
Product (prodld, size, colour, style, qtyOnHand, reorderQty, retailPrice, suplrld) ProductSupplier (prodld, supA14)

Supplier (skiplrld, suplrName, suplrAddress, suplrPostCode, suplrEmail, supIrMobPh) FOREIGN KEYS
• StoreEmployee(storeld) references Store (storeld)
• 'Order'(custld) references Customer(custld)
• OrderDetail(orderld) references Order(orderld)
• OrderDetail(prodld) references Product(prodld)
• Payment(orderld) references Order(orderld)
• Product(suplrld) references Supplier(suplrld)
• ProductSupplier(prodld) references Product(prodld)
• ProductSupplier(suplrld) references Supplier(suplrld)
Other Constraints and Remarks
• All primary and foreign key attributes are strings (not text) comprising seven digits.
• All PostCodes are strings comprising four digits.
• INTEGER type must be used for total, GST, quantity, retailPrice, qtyOnHand, reorderQty, and amount.
• TEXT type must be used for all other attributes.
• sName, eName, cName, suplrName must contain a value (you will need to add values to these attributes)
• MY SQL has order as a keyword, to create this table you will need to use the backward quotation mark as shown 'Order'.

Task 2 - Group
We have provided you with the Hotel database (Filename: IFN554 Hotel 2352 v2.sql. you can download from 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.

The script is based on the following relational schema:
• Hotel (hotelNo. hotelName, city)
• Room (roomNo, hotelNo roomType, price)
• Guest (guestNo, guestName, guestAddress)
• Booking (hotelNo _guestNo, dateFrom. dateTo, roomNo)
Note: Primary keys are denoted by bold and underline. Foreign keys are denoted by italics and maybe part of a primary key.
Write an SQL script for querying data for the following information.

1. List the hotelNo, type and price of each room that is a suite or family with price more than $90. Order the result by type, hotelNo, and price .
2. List the hotelNo which has 2 or more family rooms .
3. How many different guests visited the Accor Hotel? .
4. What is the total income from bookings for the Ritz Hotel?.
5. List all the guests' names who have visited more than 2 times .

Task 3 Group
Perform the following tasks.
1. Write a command to create an index on guestName of the Guest table.
2. Create a user with the name "Jane" @ local host with password new_password
3. Create a user with the name "Alex" @ local host with password old_password. Mark the password expired so that the user must choose a new one at the first connection to the server.
4. Create a view called GView showing Guest No and Guest Name and Grant permission to Jane to select this view [1 mark) Note: Both parts are necessary for a correct answer.
5. Display a list of users
6. Grant Select, Insert to Alex on table Hotel [0.5 marks)
7. Show Grants on table Hotel to Alex
8. Remove Select and Insert privileges on hotel from Alex and Show grants

Task 4 - Individual Perform the following tasks.
Perform the following tasks (Make up your own hotel and guest names etc.).
1. Write commands to insert rows in each of the Hotel database tables.
2. Write a command to delete the row you inserted in the table Guest.
3. Write a command to update the price of all rooms by 25%.
4. Write a command to create a view to list the information (hotelName, roomType and the total number of rooms booked) of the hotels which are in the city Longreach.

Task 5  - Individual Perform the following task.
Using the following table structure, identify all functional dependencies and then decompose this table into a set of 3NF relations.
Assumptions:
In the following table, these assumptions can be made:
• there are no multivalued.
• any invoice numbers (invoicelD) may reference more than one.
• any given product is supplied by a single supplier, but a supplier can supply many products.

Task 6  - Individual Perform the following task.
Data is everywhere. Organisations have access to your personal data. Reflect on the many data breaches that have happened worldwide. Some of the most noted ones include Medibank. Optus and even QUT. How have the many data breaches impacted you and your sharing of personal data?
Write 300 - 500 words on how an organisation should secure its data. What actions can it take to prevent loss of data through unauthorized actions? What can you do to protect your data? What actions have you taken, or will you take in the future?

Consider the following aspects in your discussion:
• Data collection and storage. what can you do to secure your data?
• What can an organisation do to ensure it uses only what is allowable?
• What disclosures or disclaimers should an organisation consider when requesting data from its clients?
• Think about the usage of data. What is considered ethical and what would not be considered ethical use of data?
• What are some of the results when data requirements such as security access and sharing are not considered?

Reference no: EM133507568

Questions Cloud

Research and develop your plan and justification : Research and develop your plan and justification. Address your plan from the business impact, budgeting, personnel, and systems perspectives.
What are the reasons behind the failures in the case : What are the reasons behind the failures in the case of the chosen company? What could the chosen company have done differently to prevent this problem from
Impacts of relevant branch of criminal justice system : What are the potential impacts of the departmental policy recommendations on the public and the relevant branch of criminal justice system on juvenile crime.
Discuss the concepts of the instrument measurements : Describe the similarities and differences of reliability and validity within the context of quantitative business research. Identify the instrument utilized
Write commands to insert rows in each of the hotel database : Write commands to insert rows in each of the Hotel database tables and Write a command to delete the row you inserted in the table Guest
What is an example of a time when setting a specific goal : What is an example of a time when setting a specific goal has motivated you to accomplish something that you don't think you would have accomplished otherwise?
What target market should annie focus on going forward : What target market should Annie's focus on going forward ? - What is the best new products strategy for Annie's?
Describe the selected behavior causes distress : Distress: Describe the extent to which the selected behavior causes distress as characterized by mental or emotional imbalance.
Explain what psychological and behavioral factors play : Explain what psychological and behavioral factors play a role in 'homegrown' individuals becoming radicalized and conducting terrorist attacks within their own

Reviews

Write a Review

Other Subject Questions & Answers

  What role does the classroom teacher play in intervention

What role does the classroom teacher play in intervention and assessment of struggling readers? Consider both identification and intervention in your response.

  How will the case or policy help improve education for ells

From your required readings, choose one Supreme Court case or one educational policy pertaining to English language learners (ELLs). In a 500-750 word essay.

  How does pay for performance improve quality care

How does pay for performance (P4P) improve quality care? Briefly discuss the value-based purchasing program? How do value-based purchasing (VBP) programs.

  What is project-based learning

What do you think are the three most important components in a lesson plan and why did you select them? What is project-based learning

  In the nature via nurture issue

In the nature via nurture issue, nature refers to __________.

  Enhance children auditory skills

Language can be used for a variety of purposes. Name and describe four. Describe four key ways a teacher can create a rich environment.

  Fourteenth amendment

Which statement about the Fourteenth Amendment is NOT true?

  How healthcare issue is being address in other organization

Provide a brief summary of the two articles you reviewed from outside resources on the national healthcare issue/stressor. Explain how the healthcare.

  The transformational theory into the workplace

What are some of the characteristics of a leader who implements the transformational theory into the workplace?

  Discuss extent of violence in the workplace

Discuss the extent of violence in the workplace and various factors that make certain workplaces potentially high risk/hazardous for violence.

  Summarize the Court arguments

Summarize the Court's arguments for deciding that Officer Maria Trevizo's frisk of Lemon Johnson was reasonable

  Differences between popular and scholarly sources used

Explain at least five differences between popular and scholarly sources used in research. Explain at least five visual cues from the peer-reviewed, scholarly source that were not evident in the popular source.

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