CUET Computer/IP: Informatics PracticesSQL Functions. Free, no login required.

Q1:

2026: 21 May Shift 1

SQL Functions

Easy

Informatics Practices

Which of the following are correct syntax in SQL?

(A) UPDATE tablename SET attribute1=value1, attribute2=value2.......WHERE condition;

(B) UPDATE TABLE tablename SET attribute1=value1, attribute2=value2.......WHERE condition;

(C) ALTER tablename DROP attribute;

(D) ALTER TABLE tablename DROP attribute;

Answer options
Option 1
Correct Answer
Explanation for 2026: 21 May Shift 1 CSE question 1

Q2:

2026: 21 May Shift 1

SQL Functions

Easy

Informatics Practices

_________ joins are needed to combine 'N' tables on equality condition.

Answer options
Option 3
Correct Answer
Explanation for 2026: 21 May Shift 1 CSE question 2

Q3:

2026: 20 May Shift 1

SQL Functions

Easy

Informatics Practices

Suppose you want to display Payment mode and number of payments made using that mode more than once, in which sequence will the following commands be written to achieve the result?

(A) HAVING COUNT(*)>1

(B) FROM SALE GROUP BY PaymentMode

(C) SELECT PaymentMode,

(D) Count(PaymentMode)

Answer options
Option 4
Correct Answer
Explanation for 2026: 20 May Shift 1 CSE question 3

Q4:

2026: 20 May Shift 1

SQL Functions

Easy

Informatics Practices

Relation A

NameYear
Sumit1st
Nidhi2nd
Pradeep3rd
Jyoti2nd

Relation B

NameYear
Anand1st
Pradeep3rd
Jyoti2nd
Ashutosh4th

Which operation on relations above will give the following result?

NameYear
Sumit1st
Nidhi2nd
Answer options
Option 3
Correct Answer
Explanation for 2026: 20 May Shift 1 CSE question 4

Q5:

2026: 20 May Shift 1

SQL Functions

Easy

Informatics Practices

EmpNoENameSalaryDeptId
E101Sumit60000D01
E104Jyoti55000D04
E105Anand50000D05
E102Pradeep80000D02
E103Rakesh70000D03

Consider the table 'EMPLOYEE' given above.

Which SQL query will display all employees having salary more than 60000 arranged in descending order by salary amount?

Answer options
Option 1
Correct Answer
Explanation for 2026: 20 May Shift 1 CSE question 5

Q6:

2026: 20 May Shift 1

SQL Functions

Easy

Informatics Practices

What will be the output of the following query on table 'STUDENTS'?

SELECT COUNT(*) FROM STUDENTS;

Answer options
Option 3
Correct Answer
Explanation for 2026: 20 May Shift 1 CSE question 6

Q7:

2026: 19 May Shift 1

SQL Functions

Hard

Informatics Practices

Consider tables 'UNIFORM' and 'COST':

Uniform

UcodeUnameUcolor
1ShirtWhite
2PantGrey
3T-ShirtGreen

Cost

UcodeSizePrice
1L580
1M560
1S500
2L400
2M500

Which of the following are correct commands to display the records from both the tables?

(A) SELECT * FROM UNIFORM U JOIN COST C WHERE U.UCode = C.UCode;

(B) SELECT * FROM UNIFORM U, COST C WHERE U.UCode = C.UCode;

(C) SELECT * FROM UNIFORM U JOIN COST C ON U.Ucode=C.Ucode;

(D) SELECT * FROM UNIFORM NATURAL JOIN COST;

Answer options
Option 2
Correct Answer
Explanation for 2026: 19 May Shift 1 CSE question 7

Q8:

2026: 19 May Shift 1

SQL Functions

Easy

Informatics Practices

Assume that the four digit area code is reflected in the mobile number starting from position number 3. For example, 2630 is the area code of mobile number 4726309212. Based on this, arrange the following SQL query to display the area code of the customer living in 'Rohini'.

(A) FROM CUSTOMER

(B) like '%Rohini%'

(C) WHERE CustAdd

(D) SELECT MID(Phone,3,4)

Answer options
Option 4
Correct Answer
Explanation for 2026: 19 May Shift 1 CSE question 8

Q9:

2026: 19 May Shift 1

SQL Functions

Easy

Informatics Practices

What will be the output of the following SQL query?

SELECT LEFT("INDIA",3), RIGHT("COMPUTER SCIENCE",4);

Answer options
Option 1
Correct Answer
Explanation for 2026: 19 May Shift 1 CSE question 9

Q10:

2026: 19 May Shift 1

SQL Functions

Easy

Informatics Practices

Assume a table 'GUARDIAN' having 4 columns viz. 'Guid', 'Gname', 'Gphone' and 'Gadd'. Which of the following command is correct for inserting a record into the table?

Answer options

Q11:

2026: 18 May Shift 2

SQL Functions

Easy

Informatics Practices

What is the difference between UNION and UNION ALL?

Answer options

Q12:

2026: 18 May Shift 2

SQL Functions

Easy

Informatics Practices

Match the LIST-I with LIST-II

LIST-ILIST-II
A.Now( )I.It returns the day part from the date
B.Date( )II.It returns the name of the day from the date
C.DAY(date)III.Returns the date part
D.DAYNAME(date)IV.Returns the current system date and time
Answer options

Q13:

2026: 18 May Shift 2

SQL Functions

Easy

Informatics Practices

In general, ___________ joins are needed to combine 'N' tables on equality condition.

Answer options

Q14:

2026: 18 May Shift 2

SQL Functions

Easy

Informatics Practices

Single row functions in SQL are also called :

Answer options

Q15:

2026: 13 May Shift 2

SQL Functions

Easy

Informatics Practices

Match List-I with List-II

List-I - SQL DATE FUNCTIONSList-II - DESCRIPTION
(A) NOW()(I) returns the date part from the given date/ time expression
(B) DATE()(II) returns the day part from the date
(C) DAY(date)(III) returns the month name from the specified date
(D) MONTHNAME(date)(IV) returns the current system date and time
Answer options

Q16:

2026: 13 May Shift 2

SQL Functions

Medium

Informatics Practices

Consider the following Table "SALE".

InvoiceNoCarIdCustIDSaleDate
I00001C123C00012019-05-24
I00002C128C00022020-02-21
I00003C139C00012020-03-23
I00004C145C00032020-04-17
I00005C147C00022021-04-11
I00006C145C00042022-05-08

What will be the output of the following SQL Query?

SELECT CustID, COUNT(*) FROM SALE GROUP BY CustID HAVING Count(*)>1;

Answer options

Q17:

2026: 13 May Shift 2

SQL Functions

Medium

Informatics Practices

What will be the output of the following SQL query?

SELECT MID(“Electronics”, 7);

Answer options

Q18:

2026: 13 May Shift 2

SQL Functions

Medium

Informatics Practices

What will be the output of the following SQL query?

SELECT INSTR(“Systematic”, “ma”)

Answer options

Q19:

2026: 11 May Shift 2

SQL Functions

Easy

Informatics Practices

Consider the given query:

________ CustID , COUNT() _____ SALE ________ CustID ____ Count() >1

Fill the following words in the above query in correct order:

A. SELECT

B. FROM

C. GROUP BY

D. HAVING

Answer options

Q20:

2026: 11 May Shift 2

SQL Functions

Easy

Informatics Practices

What will the following query retrieve?

SELECT MID(phone, 3, 4) from customer where cust_address like '%Rohini%';

Answer options

Q21:

2026: 11 May Shift 2

SQL Functions

Easy

Informatics Practices

Which of the following are legitimate functions in SQL?

A. MOD(A, B)

B. LTRIM(string)

C. Day(date)

D. SUB(string, pos, n)

Answer options

Q22:

2026: 11 May Shift 2

SQL Functions

Easy

Informatics Practices

Match the LIST-I with LIST-II

LIST-ILIST-II
A.Natural joinI.Combine the tuple from two tables on specified conditions
B.JoinII.Removes redundant attributes from the result set of join
C.MinusIII.Retrieve the rows present in first table but not in second table
D.IntersectionIV.Retrieves the tuples which are common in both the tables
Answer options

Q24:

2025: 3 June Shift 2

SQL Functions

Medium

Informatics Practices

Which of the following will retrieve the second and third character from the City column in the Customer table?

(A) SELECT MID(City,2,2);

(B) SELECT SUBSTR(City,2,2);

(C) SELECT LEFT(City,2,2);

(D) SELECT SUBSTRING(City,2,2);

Answer options

Q25:

2025: 3 June Shift 2

SQL Functions

Medium

Informatics Practices

Consider the following tables 'UNIFORM' and 'COST'. Select the correct answer for retriving Ucode, Uname, Ucolor, Size and Price of related tuple of the table 'Uniform' and 'Cost'.

UNIFORM

UcodeUnameUcolor
1ShirtWhite
2PantGrey
3TieBlue

COST

UcodeSizePrice
1L580
1M500
2L890
2M810
Answer options

Q26:

2025: 3 June Shift 2

SQL Functions

Easy

Informatics Practices

Which of the following is used to find total number of rows in a table?

Answer options

Q28:

2025: 3 June Shift 2

SQL Functions

Medium

Informatics Practices

Arrange the following SQL steps in correct order to retrieve the Max Salary from the 'Employee' table for each Dept showing only those Dept where Max Salary is greater than 50000.

(A) HAVING MAX(Salary)> 50000

(B) GROUP BY Dept

(C) SELECT Dept, MAX(Salary) FROM Employee

(D) ORDER BY MAX(Salary)

Answer options

Q29:

2025: 30 May Shift 2

SQL Functions

Easy

Informatics Practices

Cartesian product operation combines tuples from two relations.. The cardinality of the resulting relation is calculated as ____________________

Answer options

Q30:

2025: 30 May Shift 2

SQL Functions

Medium

Informatics Practices

Match List-I with List-II

List-IList-II
(A) If a cartesian product is again applied on two tables, what will be the degree of the modified table?(I) Combines tuples from two tables on specified conditions.
(B) JOIN operation(II) Sum of the degrees of both the relations.
(C) UNION (U)(III) To get the common tuples from two tables.
(D) INTERSECT (∩)(IV) To combine the selected rows of two tables at a time, if some rows are the same in both the tables, then the result will show those rows only once.
Answer options