SOL-C01 · Question #15
SOL-C01 Question #15: Real Exam Question with Answer & Explanation
The correct answer is E: CREATE OR REPLACE TABLE COMPANY DATA.PUBLIC.EMPLOYEES (EmployeelD INT,. The correct answer is E. It uses 'CREATE OR REPLACE to avoid errors if the table exists, specifies the full table name with database and schema ('COMPANY_DATA.PUBLIC.EMPLOYEES'), and uses appropriate data types: 'INT' for integers, 'VARCHAR(255)' for strings, and 'DATE for dates.
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,
Explanation
The correct answer is E. It uses 'CREATE OR REPLACE to avoid errors if the table exists, specifies the full table name with database and schema ('COMPANY_DATA.PUBLIC.EMPLOYEES'), and uses appropriate data types: 'INT' for integers, 'VARCHAR(255)' for strings, and 'DATE for dates. Option A would cause errors if table already exists, Option B and C does not specify the database and schema. Option D uses NUMBER
Topics
Community Discussion
No community discussion yet for this question.