WGU D427 Practice Test 2 Exam Questions with
100% Correct Answers | Verified | Latest
Update
Answer Key 5 At the End Of the Test
1. The Book table has the following columns:
ID—integer, primary key, auto_increment
conTitle—variable-length string
Genre—variable-length string
Year—integer
Cost – positive decimal
Write a SQL Statement to add up all costs in the Book table.
2. The Patient table has the following columns:
first_name – varchar(20)
last_name – varchar(30)
birthdate – date
patient_id – int
Which column should be designated as the primary key for the Patient table?
a. first_name
b. last_name
c. birthdate
d. patient_id
3. The Exam table has the following columns:
exam_id – int
exam_date – date
exam_reason – varchar (100)
patient_id – int
Which column should be designated as the foreign key for the Exam table?
a. exam_id
b. exam_date
c. exam_reason
d. patient_id
,4. Which data type represents numbers with fractional values:
a. Varchar
b. Integer
c. Binary
d. Decimal
5. Which of the following is a DDL (Data Definition Language) command?
a. INSERT
b. SELECT
c. CREATE INDEX
d. UPDATE
6. Which of the following is a DML(Data Manipulation Language) command?
a. CREATE VIEW
b. CREATE TABLE
c. INSERT
d. ALTER INDEX
7.
CREATE TABLE Exam (
exam_id INT NOT NULL AUTO_INCREMENT,
exam_date DATE NOT NULL,
exam_reason VARCHAR (100),
patient_id INT NOT NULL,
PRIMARY KEY (exam_id),
FOREIGN KEY (patient_id) REFERENCES Patient (patient _id) ON DELETE CASCADE
);
,Looking at the Patient and Exam tables above and the CREATE TABLE for the Exam table
with foreign key reference statement above, what would happen to exams in the Exam
table that are linked to a patient if that patient is deleted.
a. Those exams would remain in the database.
b. Those exams would be deleted also.
c. The Patient ID for those exams would be changed to NULL.
d. Nothing would happen.
8.
CREATE TABLE Exam (
exam_id INT NOT NULL AUTO_INCREMENT,
exam_date DATE NOT NULL,
exam_reason VARCHAR (100),
patient_id INT NOT NULL,
PRIMARY KEY (exam_id),
FOREIGN KEY (patient_id) REFERENCES Patient (patient _id) ON DELETE RESTRICT
);
Looking at the Patient and Exam tables above and the CREATE TABLE for the Exam table
with foreign key reference statement above, what would happen to exams in the Exam
table that are linked to a patient if that patient is deleted.
a. Those patients would remain in the database.
, b. Those patients would also be deleted.
c. The Patient ID for those exams would be changed to NULL.
d. The delete of the exam record would not be allowed.
9.
CREATE TABLE Exam (
exam_id INT NOT NULL AUTO_INCREMENT,
exam_date DATE NOT NULL,
exam_reason VARCHAR (100),
patient_id INT NOT NULL,
PRIMARY KEY (exam_id),
FOREIGN KEY (patient_id) REFERENCES Patient (patient _id) ON DELETE SET TO NULL
);
Looking at the Patient and Exam tables above and the CREATE TABLE for the Exam table
with foreign key reference statement above, what would happen to exams in the Exam
table that are linked to a patient if that patient is deleted.
a. Those patients would remain in the database.
b. Those exam records would also be deleted.
c. The patient ID for those exams would be changed to NULL.
d. The delete of the exam record would not be allowed.
10.
Which of the following are true about a materialized view (Choose 2)?
a. It is a base table.
100% Correct Answers | Verified | Latest
Update
Answer Key 5 At the End Of the Test
1. The Book table has the following columns:
ID—integer, primary key, auto_increment
conTitle—variable-length string
Genre—variable-length string
Year—integer
Cost – positive decimal
Write a SQL Statement to add up all costs in the Book table.
2. The Patient table has the following columns:
first_name – varchar(20)
last_name – varchar(30)
birthdate – date
patient_id – int
Which column should be designated as the primary key for the Patient table?
a. first_name
b. last_name
c. birthdate
d. patient_id
3. The Exam table has the following columns:
exam_id – int
exam_date – date
exam_reason – varchar (100)
patient_id – int
Which column should be designated as the foreign key for the Exam table?
a. exam_id
b. exam_date
c. exam_reason
d. patient_id
,4. Which data type represents numbers with fractional values:
a. Varchar
b. Integer
c. Binary
d. Decimal
5. Which of the following is a DDL (Data Definition Language) command?
a. INSERT
b. SELECT
c. CREATE INDEX
d. UPDATE
6. Which of the following is a DML(Data Manipulation Language) command?
a. CREATE VIEW
b. CREATE TABLE
c. INSERT
d. ALTER INDEX
7.
CREATE TABLE Exam (
exam_id INT NOT NULL AUTO_INCREMENT,
exam_date DATE NOT NULL,
exam_reason VARCHAR (100),
patient_id INT NOT NULL,
PRIMARY KEY (exam_id),
FOREIGN KEY (patient_id) REFERENCES Patient (patient _id) ON DELETE CASCADE
);
,Looking at the Patient and Exam tables above and the CREATE TABLE for the Exam table
with foreign key reference statement above, what would happen to exams in the Exam
table that are linked to a patient if that patient is deleted.
a. Those exams would remain in the database.
b. Those exams would be deleted also.
c. The Patient ID for those exams would be changed to NULL.
d. Nothing would happen.
8.
CREATE TABLE Exam (
exam_id INT NOT NULL AUTO_INCREMENT,
exam_date DATE NOT NULL,
exam_reason VARCHAR (100),
patient_id INT NOT NULL,
PRIMARY KEY (exam_id),
FOREIGN KEY (patient_id) REFERENCES Patient (patient _id) ON DELETE RESTRICT
);
Looking at the Patient and Exam tables above and the CREATE TABLE for the Exam table
with foreign key reference statement above, what would happen to exams in the Exam
table that are linked to a patient if that patient is deleted.
a. Those patients would remain in the database.
, b. Those patients would also be deleted.
c. The Patient ID for those exams would be changed to NULL.
d. The delete of the exam record would not be allowed.
9.
CREATE TABLE Exam (
exam_id INT NOT NULL AUTO_INCREMENT,
exam_date DATE NOT NULL,
exam_reason VARCHAR (100),
patient_id INT NOT NULL,
PRIMARY KEY (exam_id),
FOREIGN KEY (patient_id) REFERENCES Patient (patient _id) ON DELETE SET TO NULL
);
Looking at the Patient and Exam tables above and the CREATE TABLE for the Exam table
with foreign key reference statement above, what would happen to exams in the Exam
table that are linked to a patient if that patient is deleted.
a. Those patients would remain in the database.
b. Those exam records would also be deleted.
c. The patient ID for those exams would be changed to NULL.
d. The delete of the exam record would not be allowed.
10.
Which of the following are true about a materialized view (Choose 2)?
a. It is a base table.