Bird
0
0

Which of the following is the correct syntax to create a view named EmployeeView that shows only name and salary from Employees table?

easy📝 Syntax Q12 of 15
SQL - Views
Which of the following is the correct syntax to create a view named EmployeeView that shows only name and salary from Employees table?
ACREATE VIEW EmployeeView AS SELECT name, salary FROM Employees;
BCREATE TABLE EmployeeView AS SELECT name, salary FROM Employees;
CINSERT VIEW EmployeeView SELECT name, salary FROM Employees;
DVIEW CREATE EmployeeView SELECT name, salary FROM Employees;
Step-by-Step Solution
Solution:
  1. Step 1: Recall the syntax for creating a view

    The correct syntax starts with CREATE VIEW, then the view name, followed by AS and the SELECT query.
  2. Step 2: Match the options with correct syntax

    CREATE VIEW EmployeeView AS SELECT name, salary FROM Employees; matches the correct syntax exactly; others use wrong keywords or order.
  3. Final Answer:

    CREATE VIEW EmployeeView AS SELECT name, salary FROM Employees; -> Option A
  4. Quick Check:

    CREATE VIEW + AS + SELECT = B [OK]
Quick Trick: Use CREATE VIEW ... AS SELECT ... [OK]
Common Mistakes:
MISTAKES
  • Using CREATE TABLE instead of CREATE VIEW
  • Wrong keyword order like INSERT VIEW
  • Omitting AS keyword

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes