0% found this document useful (0 votes)
70 views6 pages

SQL MCQ

The document contains 14 multiple choice questions about MySQL functions. The questions test knowledge of functions like LENGTH, MAX, MIN, AVG, COUNT, ROUND, SUBSTR, and NOW. They also address SQL clauses like ORDER BY and concepts like data types, aggregate functions, and using DESC with ORDER BY to sort in descending order.

Uploaded by

tmaskperson
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
70 views6 pages

SQL MCQ

The document contains 14 multiple choice questions about MySQL functions. The questions test knowledge of functions like LENGTH, MAX, MIN, AVG, COUNT, ROUND, SUBSTR, and NOW. They also address SQL clauses like ORDER BY and concepts like data types, aggregate functions, and using DESC with ORDER BY to sort in descending order.

Uploaded by

tmaskperson
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

Important MySQL MCQs/1 Mark Questions

[1] Identify the data type returned by the following query:

Select length(“LENGTH”) ;

a) Numeric value

b) Text value

c) Null value

d) Float value

2] If column “SCORE” of table PLAYER contains the data set (45,80, 35,15, 7) , what will be the output
after execution of the following query?

SELECT MAX(SCORE) – MIN(SCORE) FROM PLAYER;

a) 38

b) 73

c) 8

d) 35

3] If column “temp” of the weather table contains the data set (45, 35, 35, 28, 28), what will be the
output after the execution of the given query?
SELECT AVG (DISTINCT temp) FROM weather;

a) 34.2

b) 21.6

c) 38.33

d) 36

4] Ravi is class 12 student. He is learning MySQL functions. He wants to know the category of mid()
function. Select an appropriate category to help him to understand well.

a) Math function

b) Text function

c) Date Function

d) Aggregate Function

5] What will be the output of the following SQL command?

SELECT round(155.9772,-1);

a) 155

b) 156
c) 160

d) 156

6] If column “venue” of table matches contains the data set (‘Ahmedabad’, ‘Baroda’, ‘Ahmedabad’,
‘Anand’, ‘Baroda’) , what will be the output after execution of the following query?

SELECT COUNT(DISTINCT venue) FROM matches ;

a) 5

b) 3

c) 2

d) 4

7] The correct SQL form below to find the temperature in increasing order of all cities

a) SELECT city FROM weather order by temperature ;

b) SELECT city, temperature FROM weather ;

c) SELECT city, temperature FROM weather ORDER BY temperature ;

d) SELECT city, temperature FROM weather ORDER BY city ;

8] Which one of the following is an aggregate function(s)?


i) min()

ii) max()

iii) power()

iv) now()

a) Only (i)

b) (i) and (ii)

c) (i) , (ii) and (iii)

d) (i), (iii) and (iv)

9] Observe this statement and select appropriate option: “Where and Having clauses can be used
interchangeably in SELECT queries“.

a) True

b) False

c) Only in views

d) With order by

10] Sohail is confused about which function returns the time when the function executes. Help him by
selecting the correct option out of the following:
a) SYSDATE()

b) NOW()

c) CURRENT()

d) TIME()

11]Prakash has been given a task to select a function used to display the current date and time. Select an
appropriate function for same.

a) Date( )

b) Time( )

c) Current( )

d) Now( )

12]Find the output for the below SQL statement:

Select substr(“BoardExam@2023”, -1, 7);

a )3

b) am@2023

c) BoardEx
d) 3202@ma

13] What is the output of following?

Select Round(9999.299,2);

a) 9999.30

b) 10000.29

c) 19999.00

d) 10000.30

14] What is the use of a desc word along with order by clause?

a) Display the result with all rows

b) Display results with in descriptive format

c) Display distinct rows

d) Display results in descending order

You might also like