General SQL III
1.
Which SQL statement is used to add a new row to a table?
ADD ROW
INSERT INTO
NEW ROW
APPEND ROW
2.
What does the term 'Index' refer to in the context of SQL databases?
A function that calculates the average value of a column
A constraint that ensures data integrity
A virtual table based on the result of a SELECT query
A data structure that improves the speed of data retrieval operations on a database table
3.
What is the purpose of the SQL keyword 'LIKE' in a WHERE clause?
To search for a specified pattern in a column
To filter rows based on a condition after the GROUP BY clause
To calculate the average value of a numeric column
To group rows based on a specified column
4.
Which SQL clause is used to limit the number of rows returned in a result set?
TOP
LIMIT
ROWNUM
FETCH FIRST
5.
What is the purpose of the SQL function SUBSTRING()?
To convert a string to uppercase
To concatenate two or more strings
To extract a substring from a string based on the starting position and length
To find the length of a string
6.
Which SQL statement is used to remove a unique constraint from a column?
REMOVE UNIQUE
DROP CONSTRAINT
ALTER TABLE DROP CONSTRAINT
REMOVE CONSTRAINT
7.
What does the term 'Stored Procedure' mean in SQL?
A table that stores procedures
A temporary table that holds the result of a query
A precompiled collection of one or more SQL statements that can be executed multiple times
A constraint that ensures data integrity
8.
What is the purpose of the SQL keyword 'AS' in a SELECT statement?
To order the result set
To filter rows based on a condition
To alias column or table names
To perform arithmetic operations
9.
Which SQL statement is used to delete all rows from a table without removing the table itself?
ERASE FROM table_name
REMOVE * FROM table_name
DROP * FROM table_name
DELETE FROM table_name
10.
In SQL, what does the term 'Triggers' refer to?
A function that calculates the average value of a column
A type of JOIN that retrieves unmatched rows from both tables
A constraint that ensures data integrity
A set of instructions that are automatically executed or fired when a specific event occurs
11.
Which SQL function is used to find the length of a string?
LEN()
LENGTH()
CHAR_LENGTH()
LEN_STRING()
12.
What is the purpose of the SQL keyword 'UNION' in a SELECT statement?
To perform arithmetic operations
To filter the result set based on a condition
To group the result set based on a column
To combine the result sets of two or more SELECT statements without including duplicates
13.
In SQL, what does the term 'Aggregate Functions' refer to?
Functions that perform arithmetic operations on numeric columns
Functions that operate on each row individually
Functions that manipulate text data
Functions that perform a calculation on a set of values and return a single value
14.
Which SQL statement is used to update multiple columns in a table?
MODIFY table_name SET column1 = value1, column2 = value2, ...
UPDATE table_name SET column1 = value1, column2 = value2, ...
ALTER table_name SET column1 = value1, column2 = value2, ...
CHANGE table_name SET column1 = value1, column2 = value2, ...
15.
What is the purpose of the SQL keyword 'NULL' in a column?
To represent the absence of data
To store numeric values
To enforce a unique constraint
To indicate a primary key
16.
Which SQL function is used to find the total sum of numeric values in a column?
ADD()
TOTAL()
SUM()
COUNT()
17.
Which SQL statement is used to retrieve unique values from a column in a sorted order?
SELECT DISTINCT column_name FROM table_name SORT BY column_name
SELECT UNIQUE column_name FROM table_name ORDER BY column_name
SELECT DISTINCT column_name FROM table_name ORDER BY column_name
SELECT UNIQUE column_name FROM table_name SORT BY column_name
18.
Which SQL statement is used to retrieve all columns from a table named 'employees' without any condition?
RETRIEVE employees
SELECT ALL employees
SELECT * FROM employees
SHOW COLUMNS employees
19.
What does the SQL statement 'SELECT CONCAT(column1, ' ', column2) FROM table_name;' do?
Updates all rows in the table
Counts the total number of rows in the table
Deletes all rows from the table
Concatenates values from two columns with a space in between
20.
What does the SQL statement 'SELECT * FROM users WHERE age BETWEEN 18 AND 30;' do?
Deletes all rows from the users table where age is between 18 and 30
Counts the total number of users aged between 18 and 30
Retrieves all rows from the users table where age is between 18 and 30
Updates all rows in the users table where age is between 18 and 30