Bird
0
0

Given the table Employees with columns EmployeeID, Name, Salary, and a view EmployeeView defined as:

medium📝 query result Q13 of 15
SQL - Views
Given the table Employees with columns EmployeeID, Name, Salary, and a view EmployeeView defined as:
CREATE VIEW EmployeeView AS SELECT EmployeeID, Name FROM Employees;

What will the query SELECT * FROM EmployeeView; return?
AOnly Salary column
BAll columns: EmployeeID, Name, Salary
COnly EmployeeID and Name columns
DSyntax error because Salary is missing
Step-by-Step Solution
Solution:
  1. Step 1: Understand the view definition

    The view selects only EmployeeID and Name columns from Employees.
  2. Step 2: Determine what SELECT * from the view returns

    It returns only the columns defined in the view, which are EmployeeID and Name.
  3. Final Answer:

    Only EmployeeID and Name columns -> Option C
  4. Quick Check:

    View columns = Selected columns only [OK]
Quick Trick: View shows only columns defined in its SELECT query [OK]
Common Mistakes:
MISTAKES
  • Expecting all original table columns
  • Thinking missing columns cause syntax errors
  • Confusing view columns with table columns

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes