General SQL II
1.
Which SQL statement is used to add a new column to an existing table?
ALTER TABLE
UPDATE
INSERT INTO
CREATE TABLE
2.
What does the acronym ACID stand for in the context of database transactions?
Aggregation, Concurrency, Inheritance, Division
Atomicity, Consistency, Isolation, Durability
Association, Constraints, Indexing, Deletion
Accuracy, Connectivity, Integration, Decryption
3.
In SQL, what is the purpose of the INNER JOIN clause?
To filter rows based on a condition
To retrieve all rows from both tables, regardless of matching values
To retrieve rows that have matching values in both tables
To group rows based on a specified column
4.
What is the purpose of the SQL function AVG()?
To calculate the average value of a numeric column
To find the maximum value in a column
To count the total number of rows in a table
To concatenate strings in a column
5.
Which SQL clause is used to sort the result set in descending order?
ORDER BY column_name ASC
ORDER BY column_name DESC
SORT DESC column_name
SORT column_name DESC
6.
In SQL, what is the purpose of the LEFT JOIN clause?
To retrieve all rows from the left table and matching rows from the right table
To retrieve only unmatched rows from both tables
To filter rows based on a condition
To group rows based on a specified column
7.
What is the purpose of the SQL function COUNT() when used with DISTINCT?
To count the total number of columns in a table
To count the total number of rows in a table
To count the number of NULL values in a column
To count the number of unique values in a column
8.
Which SQL statement is used to remove a table from the database?
REMOVE TABLE
DELETE TABLE
DROP TABLE
REMOVE FROM
9.
What is the purpose of the SQL keyword 'AS' in a SELECT statement?
To alias column or table names
To filter rows based on a condition
To order the result set
To perform arithmetic operations
10.
Which SQL data type is suitable for storing large amounts of alphanumeric data?
VARCHAR
TEXT
CHAR
INTEGER
11.
In SQL, what does the term 'Normalization' refer to?
Sorting data in ascending order
Organizing data in a database to reduce redundancy and improve data integrity
Filtering data based on a condition
Grouping data based on a column
12.
What is the purpose of the SQL keyword 'HAVING' in a SELECT statement?
To order the result set
To filter the result set based on a condition after the GROUP BY clause
To perform arithmetic operations
To group the result set based on a column
13.
Which SQL statement is used to grant specific privileges to a user?
ACCESS
ALLOW
PERMIT
GRANT
14.
What is the purpose of the SQL function MAX()?
To calculate the average value of a numeric column
To find the maximum value in a column
To count the total number of rows in a table
To concatenate strings in a column
15.
In SQL, what does the term 'View' refer to?
A table with primary key constraints
A table with no data
A table that stores temporary data
A virtual table based on the result of a SELECT query
16.
What is the purpose of the SQL keyword 'DISTINCT' in a SELECT statement?
To retrieve unique values in a specified column or columns
To filter the result set based on a condition
To order the result set
To group the result set based on a column
17.
Which SQL statement is used to change the values in an existing table?
CHANGE
MODIFY
ALTER
UPDATE
18.
What is the purpose of the SQL keyword 'GROUP BY' in a SELECT statement?
To filter the result set based on a condition
To group rows based on a specified column or columns
To order the result set
To perform arithmetic operations
19.
Which SQL function is used to find the minimum value in a column?
MAX()
MIN()
SUM()
AVG()
20.
In SQL, what is the purpose of the CASCADE option in a foreign key constraint?
Automatically delete or update related records when the referenced record is deleted or updated
Prevent any changes to the foreign key column
Enforce uniqueness in the foreign key column
Automatically insert a new record when the referenced record is inserted