#1
Which keyword is used to create a view in SQL?
CREATE VIEW
DEFINE VIEW
VIEW AS
GENERATE VIEW
#2
What is the primary purpose of SQL query optimization?
To minimize the query execution time
To maximize the number of queries
To optimize the storage space
To improve data security
#3
Which SQL function is used to find the maximum value in a column?
MAX()
TOP()
MAXIMUM()
LARGEST()
#4
What is the purpose of a SQL index?
To define primary keys
To enforce referential integrity
To improve the performance of queries
To store data in a structured format
#5
Which SQL statement is used to update data in a database?
#6
Which SQL command is used to add a new row to a table?
INSERT INTO
ADD ROW
CREATE ROW
NEW ROW
#7
Which SQL function is used to count the number of rows in a result set?
COUNT()
TOTAL()
SUM()
SIZE()
#8
Which SQL statement is used to delete data from a database?
#9
Which SQL function is used to return the current date and time?
NOW()
CURRENT_TIMESTAMP()
GETDATE()
SYSDATE()
#10
Which SQL keyword is used to retrieve unique rows from a query result?
DISTINCT
UNIQUE
DIFFERENT
SINGLE
#11
Which SQL keyword is used to specify the order of the result set?
ORDER BY
SORT BY
GROUP BY
ARRANGE BY
#12
In SQL, which type of join returns all rows from both tables, joining records where available?
INNER JOIN
OUTER JOIN
LEFT JOIN
CROSS JOIN
#13
What is a correlated subquery in SQL?
A subquery that is independent of the outer query
A subquery that uses values from the outer query
A subquery that is nested within another subquery
A subquery that returns multiple rows
#14
Which index type in SQL can speed up SELECT queries but may slow down data modification operations?
Clustered index
Non-clustered index
Composite index
Full-text index
#15
What does ACID stand for in the context of database transactions?
Atomicity, Consistency, Isolation, Durability
Accuracy, Consistency, Isolation, Durability
Atomicity, Cohesion, Isolation, Durability
Accuracy, Consistency, Isolation, Destruction
#16
Which SQL command is used to remove a table from the database?
DELETE TABLE
REMOVE TABLE
DROP TABLE
ERASE TABLE
#17
What is the purpose of the GROUP BY clause in SQL?
To filter rows based on a condition
To join tables together
To sort the result set
To group rows with the same values into summary rows
#18
What is a common use case for using a SQL subquery?
To update multiple rows at once
To create a temporary table
To perform calculations on columns
To filter results based on a condition
#19
What is the purpose of the EXPLAIN keyword in SQL?
To provide a detailed explanation of a query's results
To show the execution plan of a query
To explain the usage of indexes in a database
To execute a query and display the output
#20
What is a self join in SQL?
A join operation between two different tables
A join operation within the same table
A join operation using a subquery
A join operation involving three or more tables
#21
Which SQL clause is used to limit the number of rows returned by a query?
FILTER
LIMIT
RESTRICT
ROW LIMIT
#22
What is SQL injection?
A method to insert comments into SQL queries
A technique to manipulate a database by injecting malicious SQL code
A feature in SQL to inject additional data into a table
A method to optimize SQL queries
#23
In SQL, what is the purpose of the HAVING clause?
To filter rows before grouping
To specify conditions on groups
To filter rows after grouping
To specify conditions on individual rows
#24
What is a scalar subquery in SQL?
A subquery that returns multiple columns
A subquery that returns a single value
A subquery that is independent of the outer query
A subquery that is nested within another subquery
#25
What is a derived table in SQL?
A table that is inherited from another table
A table created temporarily within the scope of a query
A table with computed columns
A table used for storing historical data