img
SQL - I

SQL is a programming language for managing relational databases. It handles data storage, retrieval, and manipulation efficiently.

Last updated on:- 4th June 2023


1.
What does SQL stand for ?
Structured Query Language
Sequential Query Language
Simple Query Language
Structured Query Logic

SQL stands for Structured Query Language, which is used for managing and manipulating relational databases.


2.
Which SQL statement is used to retrieve data from a database ?
SELECT
UPDATE
DELETE
INSERT

The SELECT statement is used to retrieve data from a database table in SQL.


3.
Which SQL keyword is used to filter records based on a specified condition ?
WHERE
FROM
JOIN
GROUP BY

The WHERE keyword is used to filter records based on a specified condition in SQL.


4.
Which SQL statement is used to update data in a database ?
SELECT
UPDATE
DELETE
INSERT

The UPDATE statement is used to modify existing data in a database table in SQL.


5.
Which SQL keyword is used to sort the result set in ascending order ?
SORT BY
GROUP BY
ORDER BY
FILTER BY

The ORDER BY keyword is used to sort the result set in ascending or descending order based on specified columns in SQL.


6.
Which SQL statement is used to delete records from a database ?
SELECT
UPDATE
DELETE
INSERT

The DELETE statement is used to remove records from a database table in SQL.


7.
Which SQL keyword is used to retrieve unique/distinct values from a column ?
UNIQUE
DISTINCT
UNION
GROUP BY

The DISTINCT keyword is used to retrieve unique/distinct values from a column in SQL.


8.
Which SQL statement is used to insert new records into a database ?
SELECT
UPDATE
DELETE
INSERT

The INSERT statement is used to add new records to a database table in SQL.


9.
Which SQL keyword is used to combine rows from two or more tables based on a related column between them ?
JOIN
UNION
FROM
GROUP BY

The JOIN keyword is used to combine rows from two or more tables based on a related column between them in SQL.


10.
Which SQL statement is used to create a new database ?
CREATE DATABASE
ALTER DATABASE
DROP DATABASE
SELECT DATABASE

The CREATE DATABASE statement is used to create a new database in SQL.


11.
Which SQL function is used to count the number of rows in a table ?
SUM
AVG
COUNT
MAX

The COUNT function is used to count the number of rows in a table in SQL.


12.
Which SQL keyword is used to retrieve the top 'n' records from a table ?
FIRST
LAST
LIMIT
TOP

The TOP keyword is used to retrieve the top 'n' records from a table in SQL.


13.
Which SQL statement is used to add a new column to an existing table ?
ALTER TABLE
ADD COLUMN
CREATE TABLE
UPDATE TABLE

The ALTER TABLE statement is used to add a new column to an existing table in SQL.


14.
Which SQL keyword is used to specify multiple conditions in a SELECT statement ?
AND
OR
NOT
BETWEEN

The AND keyword is used to specify multiple conditions in a SELECT statement in SQL.


15.
Which SQL operator is used to select values within a specified range ?
IN
BETWEEN
LIKE
IS NULL

The BETWEEN operator is used to select values within a specified range in SQL.


16.
Which SQL keyword is used to sort the result set in descending order ?
SORT BY
GROUP BY
ORDER BY
FILTER BY

The ORDER BY keyword is used to sort the result set in ascending or descending order based on specified columns in SQL.


17.
Which SQL function is used to find the average value of a column ?
SUM
AVG
COUNT
MAX

The AVG function is used to find the average value of a column in SQL.


18.
Which SQL operator is used to search for a specified pattern in a column ?
IN
BETWEEN
LIKE
IS NULL

The LIKE operator is used to search for a specified pattern in a column in SQL.


19.
Which SQL keyword is used to retrieve records from multiple tables using a common column ?
WHERE
FROM
JOIN
GROUP BY

The JOIN keyword is used to retrieve records from multiple tables using a common column in SQL.


20.
Which SQL statement is used to delete a table from a database ?
DELETE TABLE
DROP TABLE
REMOVE TABLE
ERASE TABLE

The DROP TABLE statement is used to delete a table from a database in SQL.


21.
What is the purpose of the SQL GROUP BY clause ?
To filter records based on a specified condition
To combine rows from two or more tables
To sort the result set in ascending or descending order
To group rows with the same values into summary rows

The GROUP BY clause is used to group rows with the same values into summary rows in SQL.


22.
Which SQL operator is used to check if a value is NULL ?
IS
LIKE
NOT
BETWEEN

The IS operator is used to check if a value is NULL in SQL.


23.
Which SQL keyword is used to specify a condition to be met for the result set ?
SELECT
WHERE
FROM
ORDER BY

The WHERE keyword is used to specify a condition to be met for the result set in SQL.


24.
Which SQL function is used to find the highest value in a column ?
SUM
AVG
COUNT
MAX

The MAX function is used to find the highest value in a column in SQL.


25.
Which SQL operator is used to select values that are not in a specified set ?
IN
BETWEEN
LIKE
NOT IN

The NOT IN operator is used to select values that are not in a specified set in SQL.


26.
Which SQL keyword is used to retrieve records from a table without any duplicate values ?
UNIQUE
DISTINCT
UNION
GROUP BY

The DISTINCT keyword is used to retrieve records from a table without any duplicate values in SQL.


27.
Which SQL statement is used to modify the structure of an existing table ?
SELECT
UPDATE
ALTER TABLE
INSERT

The ALTER TABLE statement is used to modify the structure of an existing table in SQL.


28.
Which SQL operator is used to select values that are NULL ?
IS
LIKE
NOT
BETWEEN

The IS operator is used to select values that are NULL in SQL.


29.
Which SQL keyword is used to specify the columns to be retrieved in a SELECT statement ?
SELECT
WHERE
FROM
ORDER BY

The SELECT keyword is used to specify the columns to be retrieved in a SELECT statement in SQL.


30.
Which SQL statement is used to create a new table in a database ?
CREATE TABLE
ALTER TABLE
DROP TABLE
INSERT INTO

The CREATE TABLE statement is used to create a new table in a database in SQL.

img

"Embrace curiosity, unlock knowledge"

Copyright © 2023 - Some rights reserved

Made with

in INDIA