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...
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),...
Sensor
Model
Price
Safety
XBR20
85,624.21
High
GTX50
64,262.05
Low
BUS100
79,522.00
High
BUS200
32,572.60
Medium...
Sensor
Model
Price
Safety
XBR20
85,624.21
High
GTX50
64,262.05
Low
BUS100
79,522.00
High
BUS200
32,572.60
Medium
Another table SensorTest uses TestCase column
as Primary Key, and its SensorModel column is a Foreign Key that
refers to Model column of Car Table. Four data
entities already exist in the table as shown below.
SensorTest
TestCase (PK)
SensorModel (FK)
Tester
Result
T001
XBR20
Mike
Acceptable
T002
GTX50
Jane
Unacceptable
T003
GRX50
Mike
Acceptable
T004
BUS100
Mike
Acceptable
Which of the following SQL...
1.Consider the following (normalized) relational model (primary
keys
are underlined, foreign keys are in italics). EMPLOYEE(SSN,...
1.Consider the following (normalized) relational model (primary
keys
are underlined, foreign keys are in italics). EMPLOYEE(SSN,
ENAME, EADDRESS, SEX,
DATE_OF_BIRTH, SUPERVISOR, DNR)
S U P E R V I S O R : foreign key refers to SSN in EMPLOYEE,
NULL value allowed
D N R : foreign key refers to DNR in DEPARTMENT, NULL value not
allowed
DEPARTMENT(DNR, DNAME, DLOCATION, MGNR) MGNR: foreign key refers
to SSN in EMPLOYEE, NULL
value not allowed
PROJECT(PNR, PNAME, PDURATION, DNR)
DNR: foreign...
Create 2 stored procedures: sp_AddNewUser and sp_AddNewRole. Use
the ManyToMany script as your base table structures....
Create 2 stored procedures: sp_AddNewUser and sp_AddNewRole. Use
the ManyToMany script as your base table structures.
The stored procedure should accept the parameters needed to input
the data for each table.
NOTE: You do not need to input the UserID or RoleID. These are
surrogate keys and the system automatically inserts them when you
insert a row in the tables.
On execution, the stored procedure should check the database to see
if the user exists, if so, return a message...