Bird
0
0

Given the table:

medium📝 query result Q5 of 15
SQL - Database Design and Normalization
Given the table:

Sales(SaleID, CustomerID, ProductList)
Where ProductList stores multiple product IDs separated by semicolons. What will be the output of this query?

SELECT SaleID, ProductList FROM Sales;
AIt splits ProductList into multiple rows automatically
BIt returns SaleID and the entire semicolon-separated ProductList as stored
CIt returns only the first product ID from ProductList
DIt throws an error due to multiple values in ProductList
Step-by-Step Solution
Solution:
  1. Step 1: Understand query behavior

    SQL SELECT returns column values as stored unless functions are used to split or parse data.
  2. Step 2: Analyze the query

    The query selects SaleID and ProductList as is, so the entire semicolon-separated string is returned.
  3. Final Answer:

    It returns SaleID and the entire semicolon-separated ProductList as stored -> Option B
  4. Quick Check:

    Query returns stored string without splitting [OK]
Quick Trick: SELECT returns stored string unless parsed [OK]
Common Mistakes:
  • Assuming SQL auto-splits multi-values
  • Expecting errors from multi-valued columns in SELECT
  • Thinking only first value is returned

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes