Professional Documents
Culture Documents
m
er as
had worked, along with the hourly rate increased by 20%. Your query should only display the
co
eH w
ATTRACT_NO, HOUR_RATE and the HOUR_RATE with the 20% increase.
o.
SELECT DISTINCT A.ATTRACT_NO, H.HOUR_RATE, (H.HOUR_RATE * 120 / 100) AS
rs e
ou urc
HOUR_RATE_INCREASED_BY_20 FROM ATTRACTION AS A INNER JOIN HOURS AS H
ON A.ATTRACT_NO = H.ATTRACT_NO;
o
E5.1 Write a query to display all unique employees that exist in the HOURS table;
aC s
H.EMP_NUM = E.EMP_NUM;
E5.2 Display the employee numbers of all employees and the total number of hours they
ed d
have worked.
ar stu
E5.3. Show the attraction number and the minimum and maximum hourly rate for each
Th
attraction.
SELECT A.ATTRACT_NO, MIN(H.HOUR_RATE), MAX(H.HOUR_RATE) FROM
ATTRACTION AS A INNER JOIN HOURS AS H ON A.ATTRACT_NO = H.ATTRACT_NO
GROUP BY A.ATTRACT_NO; // Error
E5.4 Write a query to show the transaction numbers and line prices (in the SALES_LINE
table) that are greater than €50.
SELECT TRANSACTION_NO, LINE_PRICE FROM SALES_LINE WHERE LINE_PRICE > 50;
E5.5 Display all information from the SALES table in descending order of the sale date
This study source was downloaded by 100000820852645 from CourseHero.com on 11-16-2021 10:55:16 GMT -06:00
https://www.coursehero.com/file/78944140/dbdocx/
SELECT * FROM SALES ORDER BY SALE_DATE DESC;
E6.1 Use the cross join to display all rows in the EMPLOYEE and HOURS tables. How
many rows were returned?
SELECT * FROM EMPLOYEE CROSS JOIN HOURS; /* The number of results is the
number of rows from EMPLOYEE multiplies by the number of rows from HOURS =
77*/
E6.2 Write a query to display the attraction number, employee first and last names and
the date they worked on the attraction. Order the results by the date worked.
SELECT H.ATTRACT_NO, E.EMP_FNAME, E.EMP_LNAME, H.DATE_WORKED FROM
EMPLOYEE AS E INNER JOIN HOURS AS H ON E.EMP_NUM = H.EMP_NUM ORDER BY
m
er as
H.DATE_WORKED;
co
eH w
E6.3 Display the park names and total sales for Theme Parks who are located in the
o.
country ‘UK’ or ‘FR’. rs e
ou urc
SELECT TP.PARK_NAME, SUM(SL.LINE_PRICE) FROM THEMEPARK AS TP INNER JOIN
SALES AS S ON S.PARK_CODE = TP.PARK_CODE INNER JOIN SALES_LINE AS SL ON
o
E6.4 Write a query to display the names of attractions that currently have not had any
employees working on them.
ed d
This study source was downloaded by 100000820852645 from CourseHero.com on 11-16-2021 10:55:16 GMT -06:00
https://www.coursehero.com/file/78944140/dbdocx/
Powered by TCPDF (www.tcpdf.org)