Question: Using the following relational schema: Sailors (S_ID, S_name, S_rating, S_Age) Boats (B_ID, B_name, B_color) Reservations (S_ID, B_ID, R_date) .Login in to the Linux Oracle server

Using the following relational schema:

Sailors (S_ID, S_name, S_rating, S_Age) Boats (B_ID, B_name, B_color) Reservations (S_ID, B_ID, R_date)

Using the following relational schema: Sailors (S_ID, S_name, S_rating, S_Age) Boats (B_ID,

.Login in to the Linux Oracle server and access the database using sqlplus (refer to Oracle Linux Server Instructions) .Display the SQL commands using: SET ECHO ON Create your homework submission log file using: SPOOL 4-FirstLastName-Lab.txt To turn off explain plan for queries: SET AUTOTRACE OFF (if you want to observe Using the sailors schema that you have already created answer the questions that follow: To terminate log file use: SPOOL OFF command what the resulting tuple set is). Part A: Query Optimization To see execution plans for queries use: SET AUTOTRACE TRACEONLY EXPLAIN 1. Run the following two queries: Query 1 select s.sname, b.bname from sailors s, reserves r, boats b Query 2 select s.sname, b.bname from sailors s, reserves r, boats b where s.sid - r.sid and r.bid - b.bid and b.color -red' (10 points) Looking at the explain plan for each query, describe what you see which query is better, and why? Run the following two queries: Query 1: select s.sname from sailors s, reserves r, reserves 2 where s.sid rl.sid and s.sid-r2.sid and rl.bid r2.bid; Query 2: select distinct s.sname from sailors s, reserves ri, reserves r2 where s.sidrl.sid and s.sid r2.sid and rl.bid r2.bid; (10 points) Looking at the explain plan for each query, describe what you see, which query is better and why

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!