El Exam Flashcards
(53 cards)
Why is 2 not considered the number of attributes present in the address fragment ‘Portland, OR 97212’?
2 is incorrect because a complete address fragment usually includes more than just two pieces of information, such as city, state, and zip code.
Why is 3 considered the correct number of attributes present in the address fragment ‘Portland, OR 97212’?
3 is correct because the address fragment ‘Portland, OR 97212’ explicitly contains the city (Portland), state (OR), and zip code (97212), totaling three attributes.
Why is ‘birthdate’ not designated as the primary key for the Patient table?
‘birthdate’ is incorrect because multiple patients can share the same birthdate, meaning it cannot uniquely identify each record.
Why should ‘patient_id
’ be designated as the primary key for the Patient table?
‘patient_id
’ should be designated as the primary key because it is an integer column specifically designed to hold a unique identifier for each patient record, ensuring that each record can be uniquely identified.
Why is ‘exam_id
’ not designated as the foreign key for the Exam table?
‘exam_id
’ is incorrect because it is explicitly labeled as PK exam_id in the diagram, indicating it is the primary key of the Exam table itself, not a foreign key referencing another table.
Why should ‘patient_id
’ be designated as the foreign key for the Exam table?
‘patient_id
’ (labeled as patient_number in the column list) should be designated as the foreign key because it is explicitly labeled as FK patient_id in the diagram, indicating its role in linking the Exam table to the Patient table by referencing the patient’s primary key.
Why is ‘Integer
’ not the data type that represents numbers with fractional values?
‘Integer’ is incorrect because it is used for storing whole numbers without any decimal component.
Why is ‘Binary’ not the data type that represents numbers with fractional values?
‘Binary’ is incorrect because it is used for storing binary data, not numerical values with fractions.
Why is ‘Decimal’ the data type that represents numbers with fractional values?
‘Decimal’ is correct because the DECIMAL data type is specifically designed to store numbers with a fixed or specified number of decimal places, making it suitable for fractional values.
Why is ‘SELECT’ not a DDL command?
‘SELECT’ is incorrect because it is a DML (Data Manipulation Language) command used for retrieving data from a database, not for defining or modifying database structure.
Why is ‘UPDATE’ not a DDL command?
‘UPDATE’ is incorrect because it is a DML (Data Manipulation Language) command used for modifying existing data in a table, not for defining or modifying database structure.
Why is ‘CREATE INDEX’ a DDL command?
‘CREATE INDEX’ is correct because CREATE INDEX is a DDL (Data Definition Language) command used to define or create new database objects, specifically an index, which is part of the database schema.
Why is ‘CREATE VIEW’ not a DML command?
‘CREATE VIEW’ is incorrect because it is a DDL (Data Definition Language) command used for defining new database objects (views), not for manipulating data.
Why is ‘CREATE TABLE’ not a DML command?
‘CREATE TABLE’ is incorrect because it is a DDL (Data Definition Language) command used for defining new database objects (tables), not for manipulating data.
Why is ‘ALTER INDEX’ not a DML command?
‘ALTER INDEX’ is incorrect because it is a DDL (Data Definition Language) command used for modifying an existing database object (index), not for manipulating data.
Why is ‘INSERT’ a DML command?
‘INSERT’ is correct because it is a DML (Data Manipulation Language) command used for manipulating data within schema objects, specifically for adding new rows of data into a table.
Why would ‘Those exams would remain in the database.’ not happen if a patient linked to exams is deleted when ON DELETE CASCADE is specified?
‘Those exams would remain in the database.’ is incorrect because the ON DELETE CASCADE foreign key constraint explicitly means that if the parent record (patient) is deleted, the dependent child records (exams) will also be automatically deleted.
Why would ‘The Patient ID for those exams would be changed to NULL.’ not happen if a patient linked to exams is deleted when ON DELETE CASCADE is specified?
‘The Patient ID for those exams would be changed to NULL.’ is incorrect because ON DELETE CASCADE results in the deletion of the entire dependent row, not just setting the foreign key to NULL.
Why would ‘Those exams would be deleted also.’ happen if a patient linked to exams is deleted when ON DELETE CASCADE is specified?
‘Those exams would be deleted also.’ is correct because the ON DELETE CASCADE clause in the foreign key definition ensures that when a record in the referenced (parent) table (Patient) is deleted, all corresponding records in the referencing (child) table (Exam) are also deleted.
Why would ‘Those invoices would remain in the database.’ not be the full outcome if a customer linked to invoices is deleted when ON DELETE RESTRICT
is specified?
‘Those invoices would remain in the database.’ is incorrect because while the invoices themselves aren’t deleted, the deletion of the linked customer (patient) would be prevented if those invoices exist.
Why would ‘Those invoices would be deleted also.’ not happen if a customer linked to invoices is deleted when ON DELETE RESTRICT is specified?
‘Those invoices would be deleted also.’ is incorrect because ON DELETE RESTRICT specifically prevents the deletion of the parent record if dependent child records exist, rather than deleting the child records.
Why would ‘The Customer ID for those invoices would be changed to NULL.’ not happen if a customer linked to invoices is deleted when ON DELETE RESTRICT is specified?
‘The Customer ID for those invoices would be changed to NULL.’ is incorrect because ON DELETE RESTRICT
does not modify the foreign key value; its purpose is to prevent the parent deletion.
Why would ‘The delete of the Customer would not be allowed.’ happen if a customer linked to invoices is deleted when ON DELETE RESTRICT is specified?
‘The delete of the Customer would not be allowed.’ is correct because the ON DELETE RESTRICT clause prevents the deletion of a record in the parent table (Customer in the explanation, Patient in the table schema) if there are any related records in the child table (Invoice in the explanation, Exam in the table schema) that reference it.
Why is ‘It must be refreshed whenever the base table changes.’ true about a materialized view?
A materialized view must be refreshed whenever the base table changes to ensure its data remains consistent and up-to-date with the underlying table.