Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MySql Basics

Total questions: 45

Worksheet time: 34mins

Name
Class
Date
1.
What does RDBMS stand for?
a)
Relational Database Management System
b)
Random Database Management System
c)
Relational Data Managed Storage
d)
Random Data Managed Structure
2.
Which of the following is a relational database?
a)
MongoDB
b)
MySQL
c)
Redis
d)
Cassandra
3.
What is a Primary Key in a table?
a)
A column with duplicate values
b)
A column that uniquely identifies a row
c)
A foreign key from another table
d)
A column with null values
4.
What does SQL stand for?
a)
Structured Query Language
b)
Standard Query Logic
c)
Simple Query Language
d)
Sequential Query Logic
5.
Which SQL command is used to create a new database?
a)
CREATE TABLE
b)
CREATE DATABASE
c)
CREATE SCHEMA
d)
CREATE RECORD
6.
Which of the following is NOT an RDBMS?
a)
MySQL
b)
PostgreSQL
c)
Oracle
d)
MongoDB
7.
In a relational database, data is organized in...
a)
Graphs
b)
Tables
c)
Trees
d)
Lists
8.
What is the function of a Foreign Key?
a)
To uniquely identify a record
b)
To link two tables together
c)
To store the primary key of the table
d)
To create a relationship between rows
9.
Which of the following commands is used to delete a database?
a)
DROP DATABASE
b)
DELETE DATABASE
c)
REMOVE DATABASE
d)
PURGE DATABASE
10.
Which SQL command is used to retrieve data from a database?
a)
SELECT
b)
FETCH
c)
GET
d)
RETRIEVE
11.
Which data type is used to store text data in MySQL?
a)
INT
b)
VARCHAR
c)
FLOAT
d)
BOOLEAN
12.
What does a NULL value represent in a database?
a)
A zero value
b)
An empty string
c)
A missing or undefined value
d)
A duplicate value
13.
Which SQL clause is used to filter results based on a condition?
a)
WHERE
b)
SELECT
c)
FROM
d)
FILTER
14.
Which tool is used for MySQL database administration?
a)
phpMyAdmin
b)
Workbench
c)
SQL Server
d)
NoSQL Bench
15.
What is the default port for MySQL Server?
a)
3306
b)
1433
c)
1521
d)
5432
16.
Which of the following commands is used to remove rows from a table?
a)
DELETE
b)
REMOVE
c)
TRUNCATE
d)
DROP
17.
What is the purpose of the USE command in SQL?
a)
To insert data into a table
b)
To delete data from a database
c)
To switch to a different database
d)
To update the schema of a table
18.
Which of the following is a valid MySQL data type?
a)
INT
b)
LIST
c)
DICT
d)
MONEY
19.
Which SQL statement is used to modify the structure of a table?
a)
ALTER TABLE
b)
CHANGE TABLE
c)
UPDATE TABLE
d)
MODIFY TABLE
20.
What is the purpose of INSERT INTO in SQL?
a)
To retrieve data from a table
b)
To insert new data into a table
c)
To update existing data in a table
d)
To delete data from a table
21.

What is the full form of DCL?

a)

Data Control Language

b)

Data Central Language

c)

Data Control Login

d)

Data Central Login

22.
Which of the following commands is used to show all databases in MySQL?
a)
SHOW ALL
b)
LIST DATABASES
c)
SHOW DATABASES
d)
SELECT DATABASES
23.

MySQL is

a)

open source software

b)

dbms

c)

spreadsheet software

d)

none of the above

24.
Which clause is used to sort the result set in SQL?
a)
SORT BY
b)
ORDER BY
c)
GROUP BY
d)
FILTER BY
25.
What is the command to create a table in MySQL?
a)
CREATE RECORD
b)
CREATE TABLE
c)
MAKE TABLE
d)
NEW TABLE
26.
Which of the following commands is used to delete all data from a table?
a)
DROP
b)
DELETE
c)
TRUNCATE
d)
CLEAR
27.
What is the maximum length of a VARCHAR column in MySQL?
a)
255
b)
1024
c)
65535
d)
32767
28.
What does the SHOW TABLES command do in MySQL?
a)
Displays all databases
b)
Displays all tables in a database
c)
Displays all columns in a table
d)
Displays all records in a table
29.
Which SQL command is used to change the structure of an existing database?
a)
MODIFY
b)
ALTER
c)
CHANGE
d)
UPDATE
30.
Which of the following is NOT a valid SQL command?
a)
INSERT
b)
SELECT
c)
REMOVE
d)
UPDATE
31.

How can you add a column to an existing table in MySQL?

a)

ALTER TABLE

b)

MODIFY TABLE

c)

UPDATE TABLE

d)

ADD COLUMN

32.

What does the COUNT function in SQL do?

a)

Sums up values in a column

b)

Returns the total number of rows

c)

Finds the maximum value in a column

d)

Returns distinct values in a column

33.

What is the purpose of the GROUP BY clause in SQL?

a)

Sorts data in a table

b)

Filters records based on a condition

c)

Groups rows sharing a property

d)

Joins multiple tables

34.

Which SQL clause is used to filter data after grouping it?

a)

GROUP BY

b)

HAVING

c)

FILTER BY

d)

WHERE

35.

What does the MAX function return in SQL?

a)

The maximum length of text in a column

b)

The highest number of rows in a table

c)

The largest numeric value in a column

d)

The largest table size

36.

What does DISTINCT do in an SQL query?

a)

Sorts records

b)

Filters records based on conditions

c)

Returns unique records

d)

Aggregates data into groups

37.

What data type is used to store the password in the login_info table?
See Projector Screen

a)

VARCHAR(255)

b)

TEXT

c)

CHAR(255)

d)

BLOB

38.

Which SQL command can be used to retrieve only the users who are marked as active?
See Projector Screen

a)

SELECT * FROM login_info WHERE status = 'inactive';

b)

SELECT * FROM login_info WHERE gender = 'male';

c)

SELECT * FROM login_info WHERE status = 'female';

d)

SELECT * FROM login_info WHERE status = 'active';

39.

Which of the following will return all female users in the login_info table?
See Projector Screen

a)

SELECT * FROM login_info WHERE gender = 'female';

b)

SELECT * FROM login_info WHERE status = 'female';

c)

SELECT * FROM login_info WHERE mobile LIKE 'female';

d)

SELECT gender FROM login_info WHERE gender = 'female';

40.

Which query can be used to update sanjay_k's status to active?
See Projector Screen

a)

UPDATE login_info SET status = 'active' WHERE username = 'sanjay_k';

b)

UPDATE status='active' WHERE username='sanjay_k';

c)

UPDATE login_info WHERE username='sanjay_k' SET status='active';

d)

UPDATE login_info status='active' WHERE username='sanjay_k';

41.

How can you delete the record of the user vikas_r?

a)

DELETE FROM login_info WHERE username='vikas_r';

b)

REMOVE FROM login_info WHERE username='vikas_r';

c)

DROP ROW FROM login_info WHERE username='vikas_r';

d)

DELETE vikas_r FROM login_info;

42.

Which SQL command will display all users sorted by their date_of_birth in ascending order?
See Projector Screen

a)

SELECT * FROM login_info ORDER BY date_of_birth DESC;

b)

SELECT * FROM login_info GROUP BY date_of_birth;

c)

SELECT * FROM login_info ORDER BY date_of_birth ASC;

d)

SELECT * FROM login_info WHERE date_of_birth ASC;

43.

We use group by in column where

a)

all values are unique

b)

values are repeated

c)

values are numbers

d)

none of the above

44.

Which mysql can be used to make column text to Upper case

a)

uppercase

b)

upper

c)

capital

d)

capitalcase

45.

Which of these are not used as wild card character?

a)

*

b)

%

c)

_

d)

all can be used