EXAM PRE-ASSESSMENT AND OBJECTIVE ASSESMENT |
ACCURATE CURRENTLY TESTING EXAMS | ACCURATE
AND VERIFIED FOR GUARANTEED PASS | LATEST UPDATE
Question 1
What SQL clause is used to filter records returned by a SELECT query?
A. ORDER BY
B. GROUP BY
C. WHERE
D. HAVING
Correct Answer: C. WHERE
Rationale: The WHERE clause is used to filter records before any grouping
occurs.
Question 2
Which of the following commands will delete all rows from a table without
removing the table itself?
A. DROP TABLE table_name
B. DELETE FROM table_name
C. REMOVE table_name
D. TRUNCATE DATABASE table_name
,Correct Answer: B. DELETE FROM table_name
Rationale: The DELETE statement removes rows from a table but leaves the
table structure intact.
Question 3
What is the purpose of a foreign key in a relational database?
A. To uniquely identify each record in a table
B. To enforce referential integrity between tables
C. To improve query performance
D. To create backup copies of tables
Correct Answer: B. To enforce referential integrity between tables
Rationale: Foreign keys ensure consistency by enforcing relationships between
tables.
Question 4
Which SQL statement will return only unique values from a column?
A. SELECT ALL
B. SELECT DISTINCT
C. SELECT UNIQUE
D. SELECT ONLY
Correct Answer: B. SELECT DISTINCT
Rationale: DISTINCT removes duplicate values from the result set.
Question 5
Which command is used to change the structure of an existing table in SQL?
A. UPDATE
B. ALTER
C. MODIFY
D. CHANGE
,Correct Answer: B. ALTER
Rationale: The ALTER command is used to add, delete, or modify columns in a
table.
Question 6
What is the result of a LEFT JOIN between two tables?
A. Only matching records from both tables
B. All records from the left table and matched records from the right table
C. All records from the right table and matched records from the left table
D. Only unmatched records from the left table
Correct Answer: B. All records from the left table and matched records from the
right table
Rationale: A LEFT JOIN returns all records from the left table and matched
records from the right; unmatched rows show NULLs.
Question 7
Which keyword is used in a SQL query to sort the result set?
A. SORT
B. ARRANGE
C. ORDER BY
D. GROUP BY
Correct Answer: C. ORDER BY
Rationale: The ORDER BY clause sorts the result set in ascending or descending
order.
Question 8
Which type of index improves query performance but slows down data
modification operations?
A. Composite index
B. Primary key
, C. Clustered index
D. Non-clustered index
Correct Answer: D. Non-clustered index
Rationale: Non-clustered indexes improve query speed but require maintenance
on data changes, affecting write performance.
Question 9
Which SQL statement is used to retrieve data from a database?
A. SELECT
B. GET
C. FETCH
D. RETRIEVE
Correct Answer: A. SELECT
Rationale: The SELECT statement is used to query data from one or more tables.
Question 10
Which normal form eliminates repeating groups and ensures atomicity of
attributes?
A. First Normal Form (1NF)
B. Second Normal Form (2NF)
C. Third Normal Form (3NF)
D. Boyce-Codd Normal Form (BCNF)
Correct Answer: A. First Normal Form (1NF)
Rationale: 1NF removes repeating groups and ensures each column holds atomic
(indivisible) values.
Question 11
Which of the following is NOT a characteristic of a primary key in a relational
database?
A. Uniquely identifies each record