Question: (Using sql developer )Query Formulation Part 1 Problems (25%) 1. List the city, state, and zip codes in the customer table. Your output should not

(Using sql developer )Query Formulation Part 1 Problems (25%)

1. List the city, state, and zip codes in the customer table. Your output should not have duplicates. (5 points)

2. List the name, department, phone number, and email address of employees with a phone number beginning with 5-. (5 points)

3. List all columns of the resource table with a rate between 10 and 15 including the end points 10 and 15. Sort the result by rate. (5 points)

4. List the event requests with a status of Approved or Denied and an authorized date in July or August 2018. Include the event number, authorization date, and status in the output. In Oracle, you surround a date constant with single quotes. Use the default date format as shown in textbook Chapter 4. Text constants in Oracle are case sensitive. *** Change to updating values in one table without need to reference the other table. (5 points)

5. List the location number and name of locations that are part of the Basketball arena. Your query must not use the facility number (F101) of the basketball arena in the WHERE clause. Pretend that the user knows only the facility name, not the facility number. Thus, the WHERE clause should not have a condition involving the facility number compared to a constant (F101). Text constants in Oracle are case sensitive. *** Change to delete location rows without need to reference Faciity table. *** (5 points)

Query Formulation Part 2 Problems (50%)

6. For each event plan, list the plan number, count of the event plan lines, and sum of the number of resources assigned. For example, plan number P100 has 4 lines and 7 resources assigned. You only need to consider event plans that have at least one line. (10 points) 7. For event requests, list the event number, event date (eventrequest.dateheld), and count of the event plans. Only include event requests in the result if the event request has more than one related event plan with a work date in December 2018. (10 points)

8. List the plan number, event number, work date, and activity of event plans meeting the following two conditions: (1) the work date is in December 2018 and (2) the event is held in the Basketball arena. Your query must not use the facility number (F101) of the basketball arena in the WHERE clause. Pretend that the user knows only the facility name, not the facility number. Text constants in Oracle are case sensitive. Thus, the WHERE clause should not have a condition involving the facility number compared to a constant (F101). (10 points)

9. List the event number, event date, status, and estimated cost of events where there is an event plan managed by Mary Manager and the event is held in the basketball arena in the period October 1 to December 31, 2018. Your query must not use the facility number (F101) of the Basketball arena or the employee number (E101) of Mary Manager in the WHERE clause. Pretend that the user knows only the facility name and employee name, not the facility number and employee number. Thus, the WHERE clause should not have conditions involving the facility number or employee number compared to constant values. Text constants in Oracle are case sensitive. (10 points)

10. List the plan number, line number, resource name, number of resources (eventplanline.numberfld), location name, time start, and time end where the event is held at the Basketball arena, the event plan has activity of activity of Operation, and the event plan has a work date in the period October 1 to December 31, 2018. Your query must not use the facility number (F101) of the Basketball arena in the WHERE clause. Thus, the WHERE clause should not have a condition involving the facility number compared to a constant (F101). Text constants in Oracle are case sensitive. (10 points)

Database Modification Problems (25%)

Modify the contents of your database according to the following problems. For each problem, paste your SQL statement in the word processing document that you began with Part 1.

1. Insert a new row into the Facility table with facility name Swimming Pool. (5 points)

2. Insert a new row in the Location table related to the Facility row in modification problem 1. The new row should have Gate for the location name. (5 points)

3. Insert a new row in the Location table related to the Facility row in modification problem 1. The new row should have Locker Room for the location name. (5 points)

4. Change the location name for all locations of the swimming pool facility. The new location name should be Door. You should use the facility number of the swimming pool in your UPDATE statement. (5 points)

5. Delete the swimming pool facility and all related locations. When deleting the locations, you should use the facility number of the swimming pool in your DELETE statement. (Hint: when deleting a parent and related rows in a child table, the RESTRICT action (default in Oracle SQL) requires deletion of the child rows in a separate statement before deleting the related parent row in a separate DELETE statement.) (5 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!