nerdexam
Snowflake

SOL-C01 · Question #15

A data engineer needs to create a table named 'EMPLOYEES in the `PUBLIC' schema of the database 'COMPANY DATA'. The table should store employee IDs as integers, names as strings, and hire dates as dat

The correct answer is E. CREATE OR REPLACE TABLE COMPANY DATA.PUBLIC.EMPLOYEES (EmployeelD INT,. Option E is correct because it uses the full three-part qualified name in the correct order - COMPANY DATA.PUBLIC.EMPLOYEES (database → schema → table) - combined with CREATE OR REPLACE TABLE, which is the appropriate syntax when targeting a specific database and schema location.

Snowflake Overview and Architecture

Question

A data engineer needs to create a table named 'EMPLOYEES in the `PUBLIC' schema of the database 'COMPANY DATA'. The table should store employee IDs as integers, names as strings, and hire dates as dates. Which of the following SQL statements correctly creates this table?

Options

  • ACREATE TABLE COMPANY_DATA.PUBLIC.EMPLOYEES (EmployeelD INT, Name STRING,
  • BCREATE OR REPLACE TABLE EMPLOYEES (EmployeelD NUMBER, Name VARCHAR,
  • CCREATE TABLE EMPLOYEES (EmployeelD INTEGER, Name VARCHAR(255), HireDate
  • DCREATE OR REPLACE TABLE COMPANY_DATA.PUBLIC.EMPLOYEES (EmployeelD
  • ECREATE OR REPLACE TABLE COMPANY DATA.PUBLIC.EMPLOYEES (EmployeelD INT,

How the community answered

(38 responses)
  • B
    5% (2)
  • C
    11% (4)
  • D
    3% (1)
  • E
    82% (31)

Explanation

Option E is correct because it uses the full three-part qualified name in the correct order - COMPANY DATA.PUBLIC.EMPLOYEES (database → schema → table) - combined with CREATE OR REPLACE TABLE, which is the appropriate syntax when targeting a specific database and schema location.

Why the distractors fail:

  • A & D both use COMPANY_DATA (with an underscore), which refers to a different, nonexistent database - the actual name is COMPANY DATA with a space.
  • B omits the database and schema qualifiers entirely, so CREATE OR REPLACE TABLE EMPLOYEES would land the table in whatever the current session's default context is, not COMPANY DATA.PUBLIC.
  • C has the same unqualified naming problem as B, and also uses CREATE TABLE rather than CREATE OR REPLACE TABLE.

Memory tip: Use the mnemonic D-S-T - Database → Schema → Table - to remember the correct three-part qualification order. Whenever you see a space in an identifier name in the question, watch for distractors that silently swap the space for an underscore; that's a classic trap on SQL certification exams.

Topics

#DDL#CREATE TABLE#Schema Naming#Table Creation

Community Discussion

No community discussion yet for this question.

Full SOL-C01 Practice