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)