wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MYSQL Leval-1

Total questions: 30

Worksheet time: 16mins

Name
Class
Date
1.

What are the types of JOINs in SQL?

SELECT answer

FROM options

WHERE question = 'Types of JOINs in SQL';

a)

RIGHT JOIN

b)

LEFT JOIN

c)

OUTER JOIN

d)

INNER JOIN

2.

What does DML stand for?

SELECT answer

FROM options

WHERE question = 'DML meaning';

a)

Data Management Language

b)

Data Manipulation Language

c)

Data Modeling Language

d)

Data Monitoring Language

3.

Which of the following are DML commands?

SELECT answer

FROM options

WHERE question = 'DML commands';

a)

SELECT

b)

INSERT

c)

DELETE

d)

COMMIT

4.

What are the DCL commands?


SELECT answer

FROM options

WHERE question = 'DCL commands';

a)

GRANT

b)

REVOKE

c)

REMANE

d)

DENY

5.

Which of the following are DDL commands?

SELECT answer

FROM options

WHERE question = 'DDL commands';

a)

CREATE

b)

DROP

c)

COMMIT

d)

ALTER

6.

What are the TCL commands?

SELECT answer

FROM options

WHERE question = 'TCL commands';

a)

COMMIT

b)

ROLLBACK

c)

INSERT

d)

GRANT

7.

CREATE DATABASE college;

a)

Creates a new table named college

b)

Deletes the college database

c)

Creates a new database named college

d)

Adds a column named college

8.

USE college;

Question : What does this command mean?

a)

Runs all tables inside college

b)

Switches to the college database

c)

Drops the college database

d)

Grants access to all users in college

9.

What is the purpose of this syntax?

a)

Inserts a new student

b)

Creates a table named students with two columns

c)

Updates a student record

d)

Selects all students

10.

What does this command do?

a)

Updates Karthik's name

b)

Creates the students table

c)

Inserts one record into students table

d)

Selects one student

11.

What does this query do?

a)

Deletes all students

b)

Shows only student names

c)

Retrieves all columns and rows from students table

d)

Creates a student record

12.

What does this syntax do?

a)

Creates a new database called books

b)

Creates a table named books with two columns

c)

Adds data to the books table

d)

Drops the books table

13.

What does this query do?

a)

Deletes the book with id 1

b)

Changes the title of book with id 1

c)

Creates a new table

d)

Adds a new book

14.

What is the purpose of this command?

a)

Deletes the entire table

b)

Deletes the book with id = 1

c)

Updates a book title

d)

Selects all books

15.

What will this command return?

a)

Books with any title

b)

Books where title starts with S

c)

Deletes books starting with S

d)

Creates a new book entry

16.

What does the above SQL command do?

a)

Deletes a database

b)

Creates a new table

c)

Creates a new database named LibraryDB

d)

Adds a new column

17.

What is the data type CHAR used for?

a)

VARCHAR (Flexible string)

b)

TEXT (Large text)

c)

CHAR (Fixed-length string)

d)

LONGTEXT (Very large text)

18.

What kind of values will this column store?

a)

Integer values

b)

Floating point values

c)

Exact decimal values

d)

Boolean values

19.

What does the DATETIME type store?

a)

Only the date

b)

Only the time

c)

Both date and time

d)

Boolean

20.

What does this SQL statement do?

a)

Deletes all books

b)

Shows all columns and rows from the table

c)

Inserts a new book

d)

Updates book prices

21.

Which query will show all employees whose name starts with 'A'?

a)

SELECT * FROM employee WHERE ename = 'A%';

b)

SELECT * FROM employee WHERE ename LIKE 'A%';

c)

SELECT ename FROM employee WHERE ename = 'A';

d)

SELECT * FROM employee WHERE ename LIKE '%A';

22.

Which query counts how many employees are in 'SALES'?

a)

SELECT COUNT(job_desc) FROM employee;

b)

SELECT COUNT(*) FROM employee WHERE job_desc = 'SALES';

c)

SELECT * FROM employee WHERE job_desc = 'SALES';

d)

SELECT COUNT(ename) FROM employee GROUP BY job_desc;

23.

Which one gives the average salary of all employees?

a)

SELECT SUM(salary) FROM employee;

b)

SELECT AVG(salary) FROM employee;

c)

SELECT salary FROM employee ORDER BY salary;

d)

SELECT MAX(salary) FROM employee;

24.

Which query updates all ENGINEER roles to Analyst?

a)

UPDATE employee SET job_desc = 'Analyst' WHERE job_desc = 'ENGINEER';

b)

UPDATE employee SET job_desc = 'ENGINEER' WHERE job_desc = 'Analyst';

c)

UPDATE employee job_desc = 'Analyst' FROM employee WHERE job_desc = 'ENGINEER';

d)

ALTER employee SET job_desc = 'Analyst' WHERE job_desc = 'ENGINEER';

25.

Which command shows the name in UPPERCASE?

a)

SELECT UPPER(ename) FROM employee;

b)

SELECT UCASE(ename) FROM employee;

c)

SELECT ename FROM employee;

d)

SELECT UCASE(ename) FROM employee WHERE LCASE = TRUE;

26.

What is the purpose of AUTO_INCREMENT in the id column?

a)

It automatically sets id as the highest number

b)

It fills the id column with NULL

c)

It auto-generates unique incremental values for id

d)

It makes id a string

27.

What will happen if this INSERT command is run?

a)

It adds a new book with id = NULL

b)

It adds a new row and auto-generates id

c)

It throws an error due to missing id

d)

It adds duplicate data

28.

What does this query return?

a)

All employees

b)

Only the employee with the lowest salary

c)

Employees whose salary is equal to the maximum salary

d)

Employees whose salary is NULL

29.

What does this query do?

a)

It groups the data by job_desc

b)

It orders the records randomly

c)

It sorts employee records by job role in a specific priority

d)

It filters only CEOs and Managers

30.

What does this query return?

a)

All job_desc with their average salary

b)

Only job_desc where average salary is below 50000

c)

Only job_desc where average salary is more than 50000

d)

Employees whose salary is more than 50000