Bird
0
0

Which SQL statement correctly creates a view named CustomerView showing only CustomerID and Name from the Customers table?

easy📝 Syntax Q3 of 15
SQL - Views
Which SQL statement correctly creates a view named CustomerView showing only CustomerID and Name from the Customers table?
ACREATE TABLE CustomerView AS SELECT CustomerID, Name FROM Customers;
BCREATE VIEW CustomerView AS SELECT CustomerID, Name FROM Customers;
CSELECT CustomerID, Name INTO CustomerView FROM Customers;
DINSERT INTO CustomerView SELECT CustomerID, Name FROM Customers;
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct syntax for creating a view

    The correct syntax is CREATE VIEW view_name AS SELECT ...
  2. Step 2: Check each option

    CREATE VIEW CustomerView AS SELECT CustomerID, Name FROM Customers; uses correct syntax; others use table creation or insert commands incorrectly.
  3. Final Answer:

    CREATE VIEW CustomerView AS SELECT CustomerID, Name FROM Customers; -> Option B
  4. Quick Check:

    View creation syntax = CREATE VIEW ... AS SELECT [OK]
Quick Trick: Use CREATE VIEW ... AS SELECT to define views [OK]
Common Mistakes:
MISTAKES
  • Using CREATE TABLE instead of CREATE VIEW
  • Using SELECT INTO which creates tables, not views
  • Trying to insert data into a view directly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes