0
0
SQLquery~10 mins

EXPLAIN plan for query analysis in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to show the execution plan of a query.

SQL
EXPLAIN [1] SELECT * FROM employees;
Drag options to blanks, or click blank then click option'
AANALYZE
BPLAN
CQUERY
DEXECUTE
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXPLAIN PLAN instead of EXPLAIN ANALYZE.
Using EXPLAIN QUERY which is not valid.
Using EXPLAIN EXECUTE which is incorrect.
2fill in blank
medium

Complete the code to get a summary of the query plan without running the query.

SQL
EXPLAIN [1] FOR SELECT * FROM orders WHERE order_date > '2023-01-01';
Drag options to blanks, or click blank then click option'
AANALYZE
BPLAN
CSELECT
DVERBOSE
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXPLAIN ANALYZE which runs the query.
Using EXPLAIN VERBOSE which is not standard.
Using EXPLAIN SELECT which is invalid.
3fill in blank
hard

Fix the error in the EXPLAIN command to correctly show the query plan.

SQL
EXPLAIN [1] SELECT name FROM customers WHERE city = 'Paris';
Drag options to blanks, or click blank then click option'
AANALYZE
BEXECUTE
CPLAN
DRUN
Attempts:
3 left
💡 Hint
Common Mistakes
Using EXPLAIN PLAN which does not run the query.
Using EXPLAIN EXECUTE which is invalid.
Using EXPLAIN RUN which is not a valid keyword.
4fill in blank
hard

Fill both blanks to create a query that explains the plan and shows detailed output.

SQL
EXPLAIN [1] [2] SELECT * FROM products WHERE price > 100;
Drag options to blanks, or click blank then click option'
AANALYZE
BVERBOSE
CPLAN
DEXECUTE
Attempts:
3 left
💡 Hint
Common Mistakes
Using PLAN instead of ANALYZE to run the query.
Using EXECUTE which is invalid.
Swapping the order of ANALYZE and VERBOSE.
5fill in blank
hard

Fill all three blanks to explain the query plan with analyze, verbose, and buffers options.

SQL
EXPLAIN [1] [2] [3] SELECT * FROM sales WHERE amount > 500;
Drag options to blanks, or click blank then click option'
AANALYZE
BVERBOSE
CBUFFERS
DPLAN
Attempts:
3 left
💡 Hint
Common Mistakes
Using PLAN instead of ANALYZE to run the query.
Missing BUFFERS option for buffer info.
Wrong order of options.