Question: Lab01 (20 points) Preliminary Login into Linux machine (oraclelinux.eng.fau.edu) .Connect to database (e.g, sqlplus username/password) ALTER SESSION SET CURRENT SCHEMA:YANGK .Change line size: SET LINESIZE
Lab01 (20 points) Preliminary Login into Linux machine (oraclelinux.eng.fau.edu) .Connect to database (e.g, sqlplus username/password) ALTER SESSION SET CURRENT SCHEMA:YANGK .Change line size: SET LINESIZE 400 There are 6 tables: TITLES, SALARIES, EMPLOYEES, DEPT MANAGER, DEPT EMP, and DEPARTMENTS .Execute the following SQL and review the primary keys SELECT cols.table name I.'ll cols.column name II l cons.owner FROM WHERE cons.constraint type 'P all constraints cons, all cons columns cols AND AND ORDER BY cols.table name, cols.position cons.constraint name-cols.constraint name cons.owner YANGK . Execute the SOL and review the indexed k SELECT table-name ll .'ll index-name ll-, . ll column_name ll .. 'll column_position FROM all ind_columns WHERE table owner "YANGK ORDER BY index name, column e the following SQL and review the index structure. SELECT index_name | index type II 'II blevel |I' 'Il leaf blocks table name IIII avg leaf blocks per key II l avg_data blocks per key'l clustering factor |Il distinct keys FROM all indexes WHERE owner- YANGK Query Evaluation .Use Spool command to log the output of SQL (e.g., SPOOL filename and SPOOL OFF) Use AUTOTRACE command to see Execution Plans for SQL statements (i.e.,set autotrace traceonly explain) There are two files you should submit: 1) explanation for query execution plans and 2) recorded spool file. 1. (10 pts) Execute the following two SQLs. Draw the query tree and explain why both SQLs produce the same query tree. SELECT E.first name, DM.from date FROM employees E, dept manager DM WHEREE.emp no-DM.er SELECT first name, from date FROM (SELECT e.emp no as e emp no, e.first_name, dm.emp no as dm_emp no, dm.from_date FROM employees E, dept manager DM) WHERE e 2. (5 pts) Execute the following SQL and draw the query tree. Explain which join operations are used in the query tree ALTER SESSION SET hash join enabled false 2 SELECT DE.from date, DM.from date FROM dept emp DE, dept manager DM WHERE DM 3. (5 pts) Execute the following SQL and draw the query tree. Explain which join operations are used in the query tree. ALTER SESSION SET hash join enabled true 2 SELECT DE.from date, DM from date FROM dept emp DE, dept manager DM WHERE DE DM no
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
