NEW
Font size
WorksheetsDatabase Query Language and procedural Language MCQS
Total questions: 20
Worksheet time: 10mins
Which of the following is used to retrieve data from a database in SQL?
INSERT
SELECT
UPDATE
DELETE
Which SQL statement is used to retrieve all columns from the "students" table?
SELECT * FROM students;
SELECT students FROM *;
GET ALL students;
SELECT ALL FROM students;
What is the purpose of the WHERE clause in SQL?
To sort the data
To filter the data
To modify data
To insert new data
Which SQL clause is used to sort the result-set?
ORDER BY
SORT BY
GROUP BY
FILTER BY
What is the function of the GROUP BY clause in SQL?
To update data
To filter records
To join tables
To aggregate data
Which SQL command is used to remove a table from a database?
ALTER TABLE table_name;
REMOVE TABLE table_name;
DROP TABLE table_name;
DELETE TABLE table_name;
What does the DISTINCT keyword do in a SQL query?
Removes duplicate records
Sorts the results
Filters records based on a condition
Groups records together
Which SQL function is used to count the number of rows in a result set?
COUNT()
ROWS()
SUM()
AVG()
What is the purpose of the JOIN clause in SQL?
To sort the results
To combine rows from two or more tables
To update data
To filter records
Which SQL statement is used to update existing records in a table?
CHANGE table_name;
MODIFY table_name;
UPDATE table_name SET;
ALTER table_name;
Which of the following statements in PL/SQL is used to exit a loop?
BREAK
EXIT
CONTINUE
STOP
What is the use of the exception handling block in PL/SQL?
To raise errors in the code
To prevent errors from occurring
To handle runtime errors gracefully
To optimize queries
What type of PL/SQL block is used to define a unit of work with inputs, outputs, and logic?
Function
Trigger
Procedure
Package
Which SQL function is used to find the maximum value in a column?
MAX()
HIGHEST()
GREATEST()
TOP()
What is the purpose of the HAVING clause in SQL?
To filter records after aggregation
To update records
To join tables
To sort the results
Which SQL statement is used to create a new table in a database?
CREATE TABLE table_name;
NEW TABLE table_name;
INSERT TABLE table_name;
ADD TABLE table_name;
Which SQL statement is used to delete records from a table?
ERASE FROM table_name;
DROP FROM table_name;
DELETE FROM table_name;
REMOVE FROM table_name;
What is the purpose of the LIMIT clause in SQL?
To group records together
To filter records based on a condition
To sort the results
To restrict the number of records returned
Which SQL function is used to calculate the average value of a numeric column?
AVG()
MEAN()
SUM()
MEDIAN()
Which of the following is true about a stored procedure in SQL?
It can only be called once
It cannot accept input parameters
It can be reused multiple times
It must return a value
