Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Querying using MySQL

Total questions: 20

Worksheet time: 27mins

Name
Class
Date
1.

Which SQL command is used to describe the structure of the table ?

4 lines
2.

A table ‘Student’ contains 5 rows and 4 columns initially. 2 more rows are added and 1 more column is added . What will be the degree and cardinality of the table student after adding these rows and columns?

a)

7, 5

b)

5,7

c)

5,5

d)

None of the above

3.

1. All aggregate functions ignore the __________________ value.

a)

similar

b)

NULL

c)

column

4.

1. To perform condition based on a list, we need to use ____________ clause

a)

between

b)

select

c)

in

5.

1. The ___________ character with LIKE matches any substring.

a)

_

b)

%

c)

*

6.

Delete is a ___________ command , Drop is a ___________ command

a)

DML, DDL

b)

DDL, DML

c)

DCL,DML

7.

1. Output of-

SELECT INSTR(‘UNICODE’,’CO’);

a)

1

b)

3

c)

4

8.

1. Which statement is appropriate to change the first name "Madhur" to "Mridul" in the "FName" column in the 'Student' table?

a)

UPDATE Student SET FName='Mridul' WHERE FName='Madhur' ;

b)

MODIFY Student SET FName='Madhur' INTO FName='Mridul ;

c)

UPDATE Student SET FName='Madhur' INTO FName='Mridul'

9.

1. Quotes are required around the standard date and time formats.

a)

False

b)

True

10.

1. The default way to store a date in MySQL is with –

a)

YY-MM-DD

b)

YYYY-MM-DD

c)

YYY-MMM-DDD

11.

1. ______________statement can be used to delete all rows of a table.

a)

DROP

b)

REMOVE

c)

DELETE

12.

Logical operator _______________is used to negate a condition

a)

AND

b)

NOT

c)

OR

13.

1. The OR operator displays a record if ANY of the conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true

a)

True

b)

False

14.

Which of the following are single row functions:

a)

SUBSTR( )

b)

SUM( )

c)

TRIM( )

d)

ROUND( )

15.

1. The HAVING clause places conditions on _____________

a)

Columns

b)

Tables

c)

Group

16.

1. What is the output of-

SELECT ROUND(6.5675, 2);

a)

6.57

b)

6.56

c)

6.5

17.

What will be the output of the following code?

SELECT MOD(14,3);

4 lines
18.

The command that is used to change the size of column in the table.

4 lines
19.

Write the SQL clause used to sort the records of a table.

4 lines
20.

1. Can a table have multiple primary keys? Can it have multiple foreign keys?

a)

Yes,No

b)

No,Yes

c)

Yes,Yes