You are designing a table for employee data of a company. You have are requireme
ID: 3797605 • Letter: Y
Question
You are designing a table for employee data of a company. You have are 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 design? Define a check constraint on the primary key column of the table to accept only "Y" and "N" as the values Design a process that deletes the rows that do not contain valid values for the column US CITIZEN INDICATOR Define a check constraint on all the columns of the table to accept only "Y" and "N" as the values Define a check constraint on the column US CITIZEN INDICATOR to accept only "Y" and "N" as the values 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 new row will be inserted into the table with CUSTOMER NUMBER = 100 Attempt to insert the new row will fail The existing row with CUSTOMER NUMBER = 100 will be replaced with the new row The system will remove the PRIMARY KEY definition from the CUSTOMER NUMBER column and allow insertion of new row with CUSTOMER NUMBER = 100 Which of the following is NOT true about UNIQUE KEY and PRIMARY KEY? A UNIQUE KEY can be NULL in a row. But the PRIMARY KEY cannot be null in any row Every UNIQUE KEY is always a PRIMARY KEY The PRIMARY KEY is always a UNIQUE KEY A UNIQUE KEY or the PRIMARY KEY can be made of two or more attributes (Concatenated Key)Explanation / Answer
1) Option d
If you define a CHECK constraint on a single column it allows only certain values for this column.So only Y or N will be accepted in the column US_CITIZEN_INDICATOR
2)option b
If your table has a primary key column, and you are trying to insert a new row with duplicate key value on the primary key column, you will get an error. The reason is simple - Primary key column does not allow duplicate values.
3)option B
There can be more than one unique keys in a table but only one primary key.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.