Database Questions 1 You are designing a table for employee
Database Questions
1) You are designing a table for employee data of a company. You have a requirement to identify if an employee is a United States citizen or not. You have designed a table called EMPLOYEE to store information related to each employee and you have a column called US CITIZEN INDICATOR to store if an employee is a US citizen or not. You only want to store values \"Y\" or \"N\" in this column. From the following options, what is the best way to accomplish this in your database d A) Define a check constraint on the primary key column of the table to accept only \"Y\" and \"N\" as the values B) Define a check constraint on the column US CITIZEN INDICATOR to accept only \"Y\" and \"N\" as the values C Define a check constraint on all the columns of the table to accept only \"Y\" and \"N\" as the values D) Design a process that deletes the rows that do not contain valid values for the column USCITIZEN INDICATOR E) None of the above 2) In your database, you have the CUSTOMER table to record and maintain information related to your customers. The CUSTOMER NUMBER column is the primary key for this table. There is already a row in this table with CUSTOMER NUMBER 100. What is the outcome of an attempt to insert another row into this table with CUSTOMER NUMBER 100? A) The system will remove the PRIMARY KEY definition from the CUSTOMER NUMBER column and allow insertion of new row with CUSTOMER NUMBER 100 B) A new row will be inserted into the table with CUSTOMER NUMBER 100 C) The existing row with CUSTOMER NUMBER 100 will be replaced with the new row D All the rows with CUSTOMER NUMBER 00 will be deleted E) Attempt to insert the new row will fail 3) Which of the following is NOT true about UNIQUE KEY and PRIMARY KEY? A A UNIQUE KEY can be NULL in a row. But the PRIMARY KEY cannot be null in any row B The PRIMARY KEY is always a UNIQUE KEY C Every UNIQUE KEY is always a PRIMARY KEY D) A table can have more than one UNIQUE KEY and the PRIMARY KEY is one of the UNIQUE KEYS E) A UNIQUE KEY or the PRIMARY KEY can be made of two or more attributes Concatenated Key)Solution
1. A) Define a check constraint on the primary key column of the table to accept only \"Y\" and \"N\" as the values
2. B) A new row will be inserted into the table with CUSTOMER_NUMBER = 100
3. D) A table can have more than one UNIQUE KEY and the PRIMARY KEY is one of the UNIQUE KEYs.
4. D) A and B
5. C) Subset for the field PROBABILITY_OF_RAIN
