CUET-UG SERIES
Computer-science

Sql

28 previous year questions.

Volume: 28 Ques
Yield: High

High-Yield Trend

13
2025
8
2024
7
2023

Chapter Questions
28 MCQs

01
PYQ 2023
medium
computer-science ID: cuet-ug-
Before the usage of .................. table command to add a primary key, one needs to make sure that the field is ...........
1
ALTER, NOT NULL
2
Create, NOT NULL
3
Update, NOT NULL
4
Update, NULL
02
PYQ 2023
medium
computer-science ID: cuet-ug-
SQL applies conditions on the groups through which clause after groups have been formed?
1
Group by
2
With
3
Where
4
Having
03
PYQ 2023
medium
computer-science ID: cuet-ug-
If column "Payment" contains the data set \{10000, 15000, 25000, 10000, 15000\}, what will be the output after the execution of the given query?
1
75000
2
25000
3
10000
4
50000
04
PYQ 2023
medium
computer-science ID: cuet-ug-
Which of the following is not an aggregate function?
1
max(col)
2
min(col)
3
round(n, d)
4
count(*)
05
PYQ 2023
medium
computer-science ID: cuet-ug-
What is the output of the following SQL query?
1
PRA
2
PRAYAG
3
RAJ
4
PRAYAGRAJ
06
PYQ 2023
medium
computer-science ID: cuet-ug-
Which of the following command is DML command?
1
Delete
2
Drop
3
Alter
4
Create
07
PYQ 2023
medium
computer-science ID: cuet-ug-
In SQL, which of the following constraint means that no two values in any column should be the same?
1
DISTINCT
2
UNIQUE
3
ORDER BY
4
GROUP BY
08
PYQ 2024
medium
computer-science ID: cuet-ug-
Consider the following two tables emp1 and emp2:
emp1
IdName
1Amit
2Punita
emp2
IdName
1Punita
2Anand
What is the output of the following query?
SELECT name from emp1 minus SELECT name from emp2;
1
Punita
2
Amit
3
Anand
4
Amit, Punita
09
PYQ 2024
medium
computer-science ID: cuet-ug-
SQL applies conditions on the groups through ________ clause after groups have been formed?
1
where
2
having
3
new
4
all
10
PYQ 2024
medium
computer-science ID: cuet-ug-
What is the output of the SQL statement?
SELECT MID('CUET2024',2,5)?
1
UET2
2
ET202
3
UET20
4
CUET2
11
PYQ 2024
medium
computer-science ID: cuet-ug-
Amit wants to be familiar with SQL. One of his friends Anand suggests him to execute the following SQL commands:
(A) Create Table Student
(B) Use Database DB
(C) Select * from Student
(D) Insert into Student
In which order Amit needs to run the above commands?
1
(A), (B), (C), (D)
2
(A), (B), (D), (C)
3
(B), (A), (D), (C)
4
(C), (B), (D), (A)
12
PYQ 2024
medium
computer-science ID: cuet-ug-
Which SQL expression calculates the square root of 16?
1
POWER(16,2)
2
POWER(16,0.5)
3
POWER(16,1)
4
MOD(16)
13
PYQ 2024
medium
computer-science ID: cuet-ug-
What is the result of the following arithmetic operation in SQL: SELECT 5 + NULL AS RESULT?
1
5
2
NULL
3
0
4
5NULL
14
PYQ 2024
medium
computer-science ID: cuet-ug-
Which of the following is correct syntax for inserting foreign key constraint in a relation?
1
ALTER TABLE table_name ADD FOREIGN KEY(attribute_name) REFERENCES referenced_table_name(attribute_name)
2
ADD TABLE table_name ADD FOREIGN KEY(attribute_name) REFERENCES referenced_table_name(attribute_name)
3
ALTER TABLE table_name REFERENCES referenced_table_name(attribute_name) ADD FOREIGN KEY(attribute_name)
4
MODIFY TABLE table_name ADD FOREIGN KEY(attribute_name) REFERENCES referenced_table_name(attribute_name)
15
PYQ 2024
medium
computer-science ID: cuet-ug-
Consider the following SQL functions:
(A) CURDATE()
(B) CURRENT DATE()
(C) CURRENT DATE
(D) TODAY()
1
(A), (B), and (D) only
2
(A), (B), and (C) only
3
(A), (B), (C), and (D)
4
(B), (C), and (D) only
16
PYQ 2025
medium
computer-science ID: cuet-ug-
The SELECT command when combined with DISTINCT clause is used to:
1
returns records without repetition
2
returns records with repetition
3
returns all records with conditions
4
returns all records without checking
17
PYQ 2025
medium
computer-science ID: cuet-ug-
____________________________________ is used to search for a specific pattern in a column.
1
Between operator
2
In operator
3
Like operator
4
Null operator
18
PYQ 2025
medium
computer-science ID: cuet-ug-
After establishing the connection to fetch the data from the table of a database in SQL into a DataFrame, which of the following function will be used?
(A) pandas.read__sql__query()
(B) pandas.read__sql__table()
(C) pandas.read__sql__query__table()
(D) pandas.read__sql()
1
(A), (B) and (D) only
2
(A), (B) and (C) only
3
(A), (B), (C) and (D)
4
(B), (C) and (D) only
19
PYQ 2025
medium
computer-science ID: cuet-ug-

Give the output of the query: SELECT MONTH("2010-03-05");

1
3
2
5
3
MARCH
4
MAY
20
PYQ 2025
medium
computer-science ID: cuet-ug-
What will be the format of the output of the NOW() function?
1
HH:MM:SS
2
YYYY-MM-DDHH:MM:SS
3
HH:MM:SS YYYY-MM-DD
4
YYYY-DD-MMHH:MM:SS
21
PYQ 2025
medium
computer-science ID: cuet-ug-
State the output of the following query:
1
9900
2
9873
3
9800
4
9873.5
22
PYQ 2025
medium
computer-science ID: cuet-ug-
Match List-I with List-II:
List-IList-II
(A) group by(III) having
(B) mid()(IV) text function
(C) count()(II) aggregate function
(D) mod()(I) math function
1
(A)-(III), (B)-(IV), (C)-(II), (D)-(I)
2
(A)-(I), (B)-(III), (C)-(II), (D)-(IV)
3
(A)-(II), (B)-(IV), (C)-(I), (D)-(III)
4
(A)-(III), (B)-(IV), (C)-(II), (D)-(I)
23
PYQ 2025
medium
computer-science ID: cuet-ug-
Ms Ritika wants to delete the table 'sports' permanently. Help her in selecting the correct SQL command from the following.
1
DELETE FROM SPORTS;
2
DROP SPORTS;
3
DROP TABLE SPORTS;
4
DELETE FROM SPORTS;
24
PYQ 2025
medium
computer-science ID: cuet-ug-
State the output of the following query:
1
NOOUTPUT
2
5
3
0
4
ERROR
25
PYQ 2025
medium
computer-science ID: cuet-ug-
Which of the following are text functions? (A) MID()
(B) INSTR()
(C) SUBSTR()
(D) LENGTH()
1
(A), (B) and (D) only
2
(A), (B) and (C) only
3
(A), (B), (C) and (D)
4
(B), (C) and (D) only
26
PYQ 2025
medium
computer-science ID: cuet-ug-
Single row functions are also known as ________ functions.
1
Multi row
2
Group
3
Mathematical
4
Scalar
27
PYQ 2025
medium
computer-science ID: cuet-ug-
Match List-I with List-II:
List-I (Aggregate function)List-II (Description)
(A) count(marks)(III) Count all non null values of marks column
(B) count()(I) Count all rows
(C) avg(marks)(II) Finding average of non null values of marks
(D) sum(marks)(IV) Finding sum of all marks
1
(A)-(III), (B)-(I), (C)-(II), (D)-(IV)
2
(A)-(I), (B)-(III), (C)-(II), (D)-(IV)
3
(A)-(II), (B)-(III), (C)-(IV), (D)-(I)
4
(A)-(III), (B)-(IV), (C)-(I), (D)-(II)
28
PYQ 2025
easy
computer-science ID: cuet-ug-
Given table 'StudAtt' with structure as (Rno, Attdate, Attendance). Identify the suitable command to add a primary key to the table after creation.
Note: We want to make both Rno and Attdate columns as primary key.
1
ALTER TABLE StudAtt ADD PRIMARY KEY(Rno, Attdate);
2
CREATE TABLE StudAtt ADD PRIMARY KEY(Rno);
3
ALTER TABLE StudAtt ADD PRIMARY KEY;
4
ALTER TABLE StudAtt ADD PRIMARY KEY(Rno) AND PRIMARY KEY(Attdate);