• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 14 pages
Exam (elaborations)

CPS 510 Final Exam Actual Questions and Answers Verified 100% Correct Latest Update

Document preview thumbnail
Preview 2 out of 14 pages

CPS 510 Final Exam Actual Questions and Answers Verified 100% Correct Latest Update Q1: Which of the following commands will add a column email to an existing table users? a) ALTER TABLE users ADD email VARCHAR(100); b) MODIFY TABLE users ADD email VARCHAR(100); c) ADD COLUMN email VARCHAR(100) TO users; d) ALTER users ADD email VARCHAR(100); - ANSWER -Correct ANSWER: a Q3: Given a table employees with columns name and department, what does the following query do? SELECT DISTINCT department FROM employees; a) Retrieves the count of employees in each department. b) Retrieves all departments, including duplicates. c) Retrieves unique department names without duplicates. d) Retrieves all employee names in each department. - ANSWER -Correct ANSWER: c Q2: If the functional dependency A - B holds, which of the following is true? a) B can determine A. b) A uniquely determines B. c) A and B are independent. d) A depends on B. - ANSWER -Correct ANSWER: b Q4: What is the primary purpose of the JOIN clause in SQL? a) To create new tables dynamically. b) To delete rows from multiple tables. c) To filter data from a single table. d) To combine data from two or more tables based on a related column. - ANSWER -Correct ANSWER: d Q5: Which of the following ensures that a database transaction is durable? a) The transaction updates are saved to persistent storage before completion. b) The transaction involves no updates. c) The transaction is atomic. d) The transaction is isolated from other transactions. - ANSWER -Correct ANSWER: a Q6: Which SQL clause is used to filter groups after grouping with GROUP BY? a) FILTER b) GROUP BY c) WHERE d) HAVING - ANSWER -Correct ANSWER: d Q7: If a relation has a multivalued dependency, which normal form is it not in? a) 4NF b) 3NF c) 2NF d) 1NF - ANSWER -Correct ANSWER: a Q8: Which of the following queries will count the number of rows in the table students? a) SELECT SUM() FROM students; b) SELECT ROWS() FROM students; c) SELECT COUNT() FROM students; d) SELECT TOTAL() FROM students; - ANSWER -Correct ANSWER: c Q9: What does the ON DELETE CASCADE action do in a foreign key constraint? a) Deletes rows in the referencing table when a referenced row is deleted. b) Sets the referencing foreign key column to its default value when the referenced row is deleted. c) Prevents deletion of referenced rows. d) Sets the referencing foreign key column to NULL when the referenced row is deleted. - ANSWER -Correct ANSWER: a Q20: What is the output of the following relational algebra operation? R(A, B) ∪ S(A, B) a) All tuples that are in either R or S, or both, with duplicates removed. b) All tuples that are in R but not in S. c) All tuples that are common to R and S. d) All tuples that are in S but not in R. - ANSWER -Correct ANSWER: a Q21: What is the purpose of the PRIMARY KEY constraint in a table? a) To allow duplicate rows. b) To enforce unique values and prevent NULL values. c) To enable fast searching in the table. d) To define a default value for a column. - ANSWER -Correct ANSWER: b Q22: Which SQL command removes all data from a table but keeps its structure? a) DELETE b) DROP c) TRUNCATE d) ALTER - ANSWER -Correct ANSWER: c Q23: What is the default sorting order when using the ORDER BY clause in SQL? a) Descending b) Random c) Ascending d) Lexicographical - ANSWER -Correct ANSWER: c Q24: Which of the following queries retrieves all rows where the salary is between 50000 and 100000? a) SELECT * FROM employees WHERE salary = 50000 AND salary = 100000; b) SELECT * FROM employees WHERE salary BETWEEN 50000 AND 100000; c) SELECT * FROM employees WHERE salary IN (50000, 100000); d) Both a and b. - ANSWER -Correct ANSWER: d Q25: Which of the following describes a foreign key? a) A column used to identify a unique row in the same table. b) A column or set of columns used to enforce a link between the data in two tables.

Content preview

CPS 510 Final Exam Actual Questions and
Answers Verified 100% Correct Latest Update
Q1: Which of the following commands will add a column email to an existing
table users?
a) ALTER TABLE users ADD email VARCHAR(100);
b) MODIFY TABLE users ADD email VARCHAR(100);
c) ADD COLUMN email VARCHAR(100) TO users;
d) ALTER users ADD email VARCHAR(100); - ANSWER -Correct ANSWER: a

Q3: Given a table employees with columns name and department, what does the
following query do?
SELECT DISTINCT department FROM employees;
a) Retrieves the count of employees in each department.
b) Retrieves all departments, including duplicates.
c) Retrieves unique department names without duplicates.
d) Retrieves all employee names in each department. - ANSWER -Correct
ANSWER: c

Q2: If the functional dependency A -> B holds, which of the following is true?
a) B can determine A.
b) A uniquely determines B.
c) A and B are independent.
d) A depends on B. - ANSWER -Correct ANSWER: b

Q4: What is the primary purpose of the JOIN clause in SQL?
a) To create new tables dynamically.
b) To delete rows from multiple tables.
c) To filter data from a single table.
d) To combine data from two or more tables based on a related column. -
ANSWER -Correct ANSWER: d

Q5: Which of the following ensures that a database transaction is durable?
a) The transaction updates are saved to persistent storage before completion.

, b) The transaction involves no updates.
c) The transaction is atomic.
d) The transaction is isolated from other transactions. - ANSWER -Correct
ANSWER: a

Q6: Which SQL clause is used to filter groups after grouping with GROUP BY?
a) FILTER
b) GROUP BY
c) WHERE
d) HAVING - ANSWER -Correct ANSWER: d

Q7: If a relation has a multivalued dependency, which normal form is it not in?
a) 4NF
b) 3NF
c) 2NF
d) 1NF - ANSWER -Correct ANSWER: a

Q8: Which of the following queries will count the number of rows in the table
students?
a) SELECT SUM() FROM students;
b) SELECT ROWS() FROM students;
c) SELECT COUNT() FROM students;
d) SELECT TOTAL() FROM students; - ANSWER -Correct ANSWER: c

Q9: What does the ON DELETE CASCADE action do in a foreign key
constraint?
a) Deletes rows in the referencing table when a referenced row is deleted.
b) Sets the referencing foreign key column to its default value when the referenced
row is deleted.
c) Prevents deletion of referenced rows.
d) Sets the referencing foreign key column to NULL when the referenced row is
deleted. - ANSWER -Correct ANSWER: a

Q20: What is the output of the following relational algebra operation?
R(A, B) ∪ S(A, B)

Document information

Uploaded on
November 29, 2025
Number of pages
14
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$11.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TheExamMaestro
3.6
(18)
Sold
159
Followers
5
Items
3822
Last sold
1 week ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions