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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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