Bird
0
0

Given a view top_products defined as SELECT product_id, sales FROM products WHERE sales > 1000;, what will be the result after executing DROP VIEW top_products; and then SELECT * FROM top_products;?

medium📝 query result Q4 of 15
SQL - Views
Given a view top_products defined as SELECT product_id, sales FROM products WHERE sales > 1000;, what will be the result after executing DROP VIEW top_products; and then SELECT * FROM top_products;?
AAn empty result set with no rows.
BAn error indicating that the view top_products does not exist.
CThe original data from the products table where sales > 1000.
DA list of all products regardless of sales.
Step-by-Step Solution
Solution:
  1. Step 1: Understand DROP VIEW effect

    DROP VIEW removes the view definition from the database, so the view no longer exists.
  2. Step 2: Querying a dropped view

    After dropping, trying to SELECT from the view causes an error because the view is not found.
  3. Final Answer:

    An error indicating that the view top_products does not exist. -> Option B
  4. Quick Check:

    Query dropped view causes error = B [OK]
Quick Trick: Selecting from a dropped view causes an error [OK]
Common Mistakes:
MISTAKES
  • Expecting empty results instead of error
  • Assuming data from underlying table is returned
  • Thinking view still exists after DROP

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes