Q31
Q31 What is the correct SQL syntax to return only distinct (different) values from the "Name" column in the "Employees" table?
SELECT DISTINCT Name FROM Employees
SELECT UNIQUE Name FROM Employees
SELECT DIFFERENT Name FROM Employees
SELECT Name FROM Employees DISTINCT
Q32
Q32 Which SQL clause is used to filter groups of rows that have been aggregated?
WHERE
HAVING
GROUP BY
ORDER BY
Q33
Q33 To update the "Salary" column in the "Employees" table by increasing all salaries by 10%, which SQL statement is correct?
UPDATE Employees SET Salary = Salary * 1.1
UPDATE Employees INCREASE Salary BY 10%
ALTER TABLE Employees MODIFY Salary = Salary * 1.1
CHANGE Employees SET Salary = Salary + (Salary * 0.1)
Q34
Q34 Given the following SQL statement:
SELECT Name FROM Employees WHERE DepartmentID IN (SELECT DepartmentID FROM Departments WHERE Budget > 100000); What does this query do?
Retrieves the names of all employees who work in departments with a budget greater than 100000
Deletes names of employees in departments with high budgets
Updates the names of employees in well-funded departments
Inserts names into Employees for departments with large budgets
Q35
Q35 What is the purpose of the SQL command EXPLAIN?
To document the structure of the database
To describe the syntax of SQL commands
To provide a detailed execution plan of a query
To correct errors in SQL queries
Q36
Q36 A developer runs a query to select all records from a table, but it returns no results despite the table not being empty.
What is the likely cause?
A syntax error in the SELECT statement
The WHERE clause is filtering out all records
The table is locked
The database connection is lost
Q37
Q37 After adding a new index to a table, a previously fast query has become significantly slower.
What is the most likely reason?
The index has increased the data retrieval time
The new index is not used by the query
The index has caused additional overhead for data modifications
The database requires reorganization
Q38
Q38 A complex query involving multiple JOIN operations is performing poorly.
What is a common method to improve its performance?
Reducing the number of columns in the SELECT clause
Using subqueries instead of JOINs
Optimizing the join order
Increasing the database server's memory
Q39
Q39 During the execution of a transaction, a deadlock occurs.
What is a typical solution to resolve this issue?
Increasing the transaction timeout period
Rolling back one of the transactions involved in the deadlock
Eliminating all indexes on the tables involved
Splitting the transaction into smaller transactions
Q40
Q40 What is the goal of normalization in database design?
To reduce data redundancy and ensure data integrity
To increase database size
To make database security more complex
To speed up query processing
Q41
Q41 Which of the following is NOT a normal form?
First Normal Form (1NF)
Zero Normal Form (0NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Q42
Q42 The process of minimizing redundancy and dependency by organizing fields and table relationships is known as:
Denormalization
Normalization
Indexing
Partitioning
Q43
Q43 Which normal form is concerned with removing partial dependency between columns of a database table?
1NF
2NF
3NF
BCNF
Q44
Q44 A relation R is in which normal form if every non-prime attribute of R is non-transitively dependent on every key of R?
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce-Codd Normal Form (BCNF)
Q45
Q45 Lossless join property ensures that:
The join operation increases data redundancy
Data can be reconstructed exactly after decomposition
Data is lost during normalization
The join operation reduces query performance
Q46
Q46 Dependency preservation in database normalization ensures that:
All functional dependencies are represented in one table
Functional dependencies are preserved across table decompositions
Only primary keys have dependencies
All tables are dependent on a single table
Q47
Q47 In the context of database normalization, what is denormalization used for?
Increasing the complexity of the database
Undoing the normalization process to improve query performance
Secure data storage
Create redundancy for backup purposes
Q48
Q48 Which SQL keyword is used to create a unique constraint on a column to enforce uniqueness?
UNIQUE
PRIMARY KEY
CHECK
FOREIGN KEY
Q49
Q49 In SQL, how can you modify an existing table to add a foreign key constraint referencing another table?
ALTER TABLE table_name ADD CONSTRAINT fk_name FOREIGN KEY (column1) REFERENCES other_table(column2)
ALTER TABLE table_name MODIFY COLUMN column_name FOREIGN KEY REFERENCES other_table(column_name)
ALTER TABLE table_name ADD FOREIGN KEY (column_name) REFERENCES other_table
USE table_name ADD FOREIGN KEY REFERENCES other_table
Q50
Q50 Which SQL statement is used to delete a constraint from a table?
DELETE CONSTRAINT constraint_name FROM table_name
REMOVE CONSTRAINT constraint_name FROM table_name
ALTER TABLE table_name DROP CONSTRAINT constraint_name
DROP CONSTRAINT constraint_name FROM table_name
Q51
Q51 What is the correct way to change the data type of a column in an existing table in SQL?
MODIFY TABLE table_name CHANGE column_name column_name NEW_DATA_TYPE
ALTER TABLE table_name ALTER COLUMN column_name SET DATA TYPE NEW_DATA_TYPE
ALTER TABLE table_name MODIFY COLUMN column_name NEW_DATA_TYPE
ALTER TABLE table_name CHANGE column_name column_name NEW_DATA_TYPE
Q52
Q52 A database table is noticed to have duplicate rows.
Which normalization form is most likely being violated?
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce-Codd Normal Form (BCNF)
Q53
Q53 A table contains a non-primary key column that depends on only part of a composite primary key.
What normalization issue does this indicate?
Partial dependency, indicating a violation of 2NF
Transitive dependency, indicating a violation of 3NF
Non-atomic values, indicating a violation of 1NF
None, this is an acceptable design
Q54
Q54 During schema refinement, a designer notices that certain attributes depend on other non-primary attributes.
Which normal form is not being adhered to?
First Normal Form (1NF)
Second Normal Form (2NF)
Third Normal Form (3NF)
Boyce-Codd Normal Form (BCNF)
Q55
Q55 Which property of a transaction ensures that all operations within the transaction are completed successfully, or none of them are?
Atomicity
Consistency
Isolation
Durability
Q56
Q56 The durability property of a transaction ensures that:
Changes made by a transaction are not permanent
Changes are visible even before the transaction is committed
Once a transaction commits, its changes are lost on system failure
Once a transaction commits, its changes are permanent, surviving system failures
Q57
Q57 Which of the following is NOT a property of transactions (ACID properties)?
Authenticity
Atomicity
Consistency
Isolation
Q58
Q58 In the context of transactions, what does the consistency property ensure?
The database remains in a consistent state before and after the transaction
The transaction only shows committed data to external users
Transactions are isolated from each other
The results of the transaction are permanently stored in the database
Q59
Q59 Isolation in database transactions ensures that:
Transactions are processed in a linear fashion
The operations of one transaction are visible to another transaction
Multiple transactions can be made to appear as if they are running in parallel
Each transaction is aware of all other transactions in the system
Q60
Q60 What is a deadlock in the context of transaction management?
A situation where transaction operations are waiting indefinitely for each other to release locks
A failed transaction that cannot be rolled back
A transaction that does not comply with ACID properties
An isolation level that has been incorrectly set