DAD220 Ch 3 Questions and Answers | Latest Update | 2024/2025 | Graded A+
DAD220 Ch 3 Questions and Answers | Latest Update | 2024/2025 | Graded A+ What is the primary key of the PhoneNumber table? (Area code, Exchange, Number) is unique, non-null, and minimal, so (AreaCode, Exchange, Number) is a primary key. Occasionally, a primary key includes all columns in a table. Foreign Key A foreign key is a column, or group of columns, that refer to a primary key. Non-NULL foreign key values must match some value of the primary key. The data types of the foreign and primary keys must be the same, but the names may be different. The Manager column of the Department table below refers to the ID column of Employee, so Manager is a foreign key. Foreign keys do not obey the same rules as primary keys 1. Foreign key values may be repeated. Ex: Sales and Marketing have the same manager. 2. Foreign key values may be NULL. Ex: Technical support currently has no manager. 3. Non-NULL foreign key values must match some primary key value. The data type of Manager and ID must be the same if manager is a foreign key of ID which is primary key T F True Manager is a foreign key, which refers to the ID primary key. Data types of foreign and primary key must be the same. NULL in the Manager column refers to a row of the Employee table with a NULL ID. T F False. A NULL in the Manager column indicates the Department currently has no manager, or the manager is unknown. NULL does not refer to a row of Employee, since ID is the primary key and may not be NULL. Primary Key A column, or group of columns, used to identify a row. In the Employee table below, the primary key is ID because each employee has a unique employee ID. The primary key usually appears on the table's left side, but the primary key's position is not significant to the database. The primary key is specified in SQL when the table is created. Often, primary key values are used in the WHERE clause to select a specific row. Alternate Key If a table contains several unique columns, any unique column may be specified. A unique column that is not the primary key is called an alternate key Primary keys obey two rules 1. Values must be unique within the column. This rule ensures that each value identifies at most one row. 2. Values may not be NULL. This rule ensures that each value identifies at least one row. Together, the two rules ensure that each primary key value identifies exactly one row. Name is a good primary key. True False False. A new employee could have the same name. A new employee can be added without an ID value. T F F Primary Key values cannot be NULL A new employee can be added with ID 5384. T F False. Primary keys cannot have duplicates No alternate keys are present. T F
Written for
- Institution
- DAD220 Ch 3
- Module
- DAD220 Ch 3
Document information
- Uploaded on
- June 16, 2024
- Number of pages
- 17
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
dad220 ch 3 questions and answers latest update
Also available in package deal