In: Computer Science
Rewrite the following SELECT statement. In the rewrite change the join operator style on the Facility table to a Type I nested query. (10 points)
SELECT eventplan.planno, eventrequest.eventno, workdate,activity
FROM eventrequest, eventplan, Facility
WHERE eventplan.workdate BETWEEN '2018-12-01' AND '2018-12-31' AND eventrequest.eventno = eventplan.eventno AND EventRequest.FacNo = Facility.FacNo AND facname = 'Basketball arena';
Rewrite the following SELECT statement. In the rewrite change the join operator style on the Facility and Employee tables to a Type I nested queries. (15 points)
SELECT DISTINCT eventrequest.eventno, dateheld, status, estcost
FROM eventrequest, employee, facility, eventplan
WHERE eventplan.workdate
BETWEEN '2018-10-01' AND '2018-12-31' AND eventplan.empno = employee.empno AND eventrequest.facno = facility.facno AND facname = 'Basketball arena' AND empname = 'Mary Manager' AND eventrequest.eventno = eventplan.eventno;
Short Summary:
SOLUTION:
Rewrite the following SELECT statement. In the rewrite change the join operator style on the Facility table to a Type I nested query.
SELECT eventplan.planno, eventrequest.eventno,
workdate,activity
FROM eventrequest
INNER JOIN eventplan ON eventrequest.eventno =
eventplan.eventno
INNER JOIN Facility ON EventRequest.FacNo = Facility.FacN
WHERE eventplan.workdate BETWEEN '2018-12-01' AND
'2018-12-31'
AND facname = 'Basketball arena';
Rewrite the following SELECT statement. In the rewrite change the join operator style on the Facility and Employee tables to a Type I nested queries.
SELECT DISTINCT eventrequest.eventno, dateheld, status,
estcost
FROM eventrequest
INNER JOIN employee ON eventplan.empno = employee.empno
INNER JOIN facility ON eventrequest.facno = facility.facno
INNER JOIN eventplan ON eventrequest.eventno =
eventplan.eventno
WHERE eventplan.workdate BETWEEN '2018-10-01' AND
'2018-12-31'
AND facname = 'Basketball arena'
AND empname = 'Mary Manager' ;
**************************************************************************************
Feel free to rate the answer and comment your questions, if you have any.
Please upvote the answer and appreciate our time.
Happy Studying!!!
**************************************************************************************