1. Suppose StudentID is the primary key of one table (e.g., the
Students table) and the...
1. Suppose StudentID is the primary key of one table (e.g., the
Students table) and the foreign key of another table (e.g., the
Top10DesiredJobs table). If you can’t enforce the referential
integrity relationship between these two tables, what might be the
cause?
Select one:
a. The values of the primary key column are referenced by the
values of the foreign key column.
b. The foreign key contains duplicate data.
c. The foreign key column contains values that do not exist...
In MS Access, if you have two related tables and you check the
box to enforce...
In MS Access, if you have two related tables and you check the
box to enforce referential integrity, how does the software behave
during the insertion of a new record into the many table?
Question 34 options:
1)
It prevents a row from being inserted into the many table if
the data in the foreign key column does not match any of the values
in the primary key column of the one table.
2)
It prevents any records from being...
a) If a referential integrity constraint (foreign key) is
defined with the ON DELETE CASCADE option...
a) If a referential integrity constraint (foreign key) is
defined with the ON DELETE CASCADE option on a column in a table,
what rules will be enforced on the data in that column and on the
corresponding referenced table? Explain with a clear example.
b) Given the following schema, answer the queries using
relational algebra and SQL
Employee (person-name, street, city)
Works (person-name, company-name, salary)
Company (company-name, city)
Manages (person-name, manager-name)
(i). Find the names and cities of residence of...
Here are SQL declarations for three tables R, S, and T:
CREATE TABLE R(e INT PRIMARY...
Here are SQL declarations for three tables R, S, and T:
CREATE TABLE R(e INT PRIMARY KEY, f INT);
CREATE TABLE S(c INT PRIMARY KEY, d INT REFERENCES R(e) ON DELETE CASCADE);
CREATE TABLE T(a INT PRIMARY KEY, b INT REFERENCES S(c) ON DELETE CASCADE);
Suppose R(e,f) contains tuples
(1,0), (2,4), (3,5), (4,3), and (5,7).
Suppose S(c,d) contains tuples
(1,5), (2,2), (3,3), (4,5), and (5,4).
Suppose T(a,b) contains tuples
(0,2), (1,2), (2,3), (3,4), and (4,4).
As a result of the...
-- Table construction (just 1 simplest possible way)
CREATE TABLE PetType (
petTypeId VARCHAR(10) PRIMARY KEY,...
-- Table construction (just 1 simplest possible way)
CREATE TABLE PetType (
petTypeId VARCHAR(10) PRIMARY KEY,
animalType VARCHAR(20),
breed VARCHAR(20)
);
CREATE TABLE Owner (
ownerId VARCHAR(10) PRIMARY KEY,
firstName VARCHAR(20),
lastName VARCHAR(20) NOT NULL,
homePhoneNumber VARCHAR(20),
streetAddress VARCHAR(80),
suburb VARCHAR(20),
postcode VARCHAR(10)
);
CREATE TABLE Pet (
petId VARCHAR(10) PRIMARY KEY,
petName VARCHAR(20),
sex CHAR(1)
CHECK (sex IN ('M', 'F')),
petTypeId VARCHAR(10)
FOREIGN KEY REFERENCES PetType
);
CREATE TABLE PetAndOwner (
ownerId VARCHAR(10),
petId VARCHAR(10),
PRIMARY KEY (ownerId, petId),...