SOL-C01 · Question #149
You are tasked with creating a table `EMPLOYEES in Snowflake to store employee data. The table should have columns for 'employee_id' (INT, primary key), 'first_name' (VARCHAR(50)), 'last_name' (VARCHA
Sign in or unlock SOL-C01 to reveal the answer and full explanation for question #149. The question stem and answer options stay visible for context.
Question
You are tasked with creating a table `EMPLOYEES in Snowflake to store employee data. The table should have columns for 'employee_id' (INT, primary key), 'first_name' (VARCHAR(50)), 'last_name' (VARCHAR(50)), 'email' (VARCHAR(IOO)), and 'hire_date' (DATE). You want to ensure that when loading data, any rows with duplicate 'employee_id' values are rejected without failing the entire load . Furthermore, you need to automatically generate surrogate keys for any new departments added to the 'DEPARTMENTS' table, which is not currently populated but will be loaded later. Which of the following approaches correctly combines these requirements?
Options
- ACreate the 'EMPLOYEES table with a unique constraint on 'employee_id' and use a COPY INTO
- BCreate the 'EMPLOYEES' table with 'employee_id' as the primary key. Use a COPY INTO
- CCreate the 'EMPLOYEES' table with 'employee_id' as the primary key. Use a COPY INTO
- DCreate the 'EMPLOYEES' table without a primary key constraint. Use a COPY INTO statement
- ECreate the `EMPLOYEES table with a unique constraint on 'employee_id'. IJse a COPY INTO
Unlock SOL-C01 to see the answer
You've previewed enough free SOL-C01 questions. Unlock SOL-C01 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.