Q1
True / FalseIn Oracle, a foreign key is a column or a set of columns that establishes a link between data in two tables.
A foreign key is used to create a relationship between two tables by linking columns in one table to columns in another table.
Q2
True / FalseIn Oracle, a foreign key column can contain NULL values.
Foreign key columns can contain NULL values, indicating that the relationship is optional.
Q3
True / FalseIn Oracle, a foreign key constraint automatically creates an index on the foreign key column(s).
Oracle does not automatically create an index on foreign key columns, though it is often beneficial to create one for performance reasons.
Q4
True / FalseIn Oracle, a foreign key must reference a primary key in another table.
A foreign key typically references a primary key or a unique key in another table to ensure referential integrity.
Q5
True / FalseIn Oracle, you can define a foreign key constraint at both the column level and the table level.
Foreign key constraints can be specified directly in the column definition or separately after all column definitions at the table level.
Q6
True / FalseIn Oracle, a table can have multiple foreign keys.
A table can have multiple foreign keys, each establishing a relationship with different parent tables.
Q7
True / FalseIn Oracle, cascading delete is an option where deleting a row in the parent table automatically deletes the related rows in the child table.
The ON DELETE CASCADE option ensures that when a row in the parent table is deleted, the related rows in the child table are also deleted automatically.
Q8
True / FalseIn Oracle, you can disable a foreign key constraint temporarily without dropping it.
Foreign key constraints can be disabled temporarily using the ALTER TABLE statement with the DISABLE keyword.
Q9
True / FalseIn Oracle, adding a foreign key constraint to a column with existing data that violates the constraint will result in an error.
Oracle will return an error if you try to add a foreign key constraint to a column that contains data violating the constraint, ensuring referential integrity.
Q10
True / FalseThe Oracle Certified Professional (OCP) exam includes knowledge on creating, modifying, and managing foreign key constraints, as well as understanding their impact on database integrity and performance.
The OCP certification covers advanced topics, including the creation, modification, and management of foreign key constraints, and understanding their impact on data integrity and query performance.
Q27
Multiple ChoiceDetermine the SQL statements that ensure referential integrity when inserting data into a child table with a foreign key constraint.
Referential integrity requires that each foreign key value in the child table ('order_items') must have a corresponding primary key value in the parent table ('orders'). The correct SQL statements will demonstrate how to enforce this constraint.
Q28
Multiple ChoiceIdentify the SQL statements that demonstrate the use of composite foreign keys in Oracle.
Composite foreign keys reference a composite primary key in another table. The correct SQL statements will list all columns involved in the foreign key constraint and reference the corresponding composite primary key.