wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

RDBMS QUIZ

Total questions: 100

Worksheet time: 53mins

Name
Class
Date
1.

In DBMS, a row in a table is called:

a)

Tuple

b)

Attribute

c)

Relation

d)

Key

2.

Recall what each column in a table represents.

a)

A record

b)

A tuple

c)

A key

d)

An attribute

3.

Apply the correct method to test MySQL Server connectivity.

a)

Use MySQL Workbench

b)

Use Excel

c)

Use PowerPoint

d)

Use Notepad

4.

Which constraint ensures values in one table match values in another table?

a)

Primary Key

b)

Foreign Key

c)

Unique

d)

Check

5.

Classify the following SQL command: SHOW TABLES;

a)

Data manipulation

b)

Data definition

c)

Meta data retrieval

d)

Transaction control

6.

Explain the role of a foreign key in table relationships.

a)

Encrypts data

b)

Sorts data

c)

Deletes records

d)

Links tables

7.

Evaluate the advantages of using MySQL over other DBMS tools.

a)

It's open-source and uses SQL

b)

It doesn't support SQL

c)

It's a programming language

d)

It's only for large enterprises

8.

Recall what SQL stands for.

a)

Structured Query Language

b)

Simple Query Language

c)

Sequential Query Language

d)

Standard Question Language

9.

The language used to query data from a database is called:

a)

HTML

b)

XML

c)

SQL

d)

C++

10.

SQL stands for:

a)

Structured Question Language

b)

Structured Query Language

c)

Sequential Query Language

d)

Simple Query Language

11.

Identify which of the following is a database management system.

a)

MS Word

b)

Photoshop

c)

Oracle

d)

MS Power Point

12.

SQL is used for:

a)

Querying operating systems

b)

Querying relational databases

c)

Writing programs

d)

Designing websites

13.

The constraint that enforces referential integrity is:

(a)  

14.

The relational model organizes data into:

a)

Trees

b)

Graphs

c)

Tables

d)

Records

15.

Identify the correct syntax to select a database for use.

a)

SELECT DATABASE db_name;

b)

OPEN db_name;

c)

CHOOSE db_name;

d)

USE db_name;

16.

MySQL is best suited for which type of databases?

a)

Relational

b)

Hierarchical

c)

Network

d)

Object-oriented

17.

Which command is used to delete all rows of a table without removing its structure?

a)

DROP

b)

DELETE

c)

REMOVE

d)

TRUNCATE

18.

A table in relational database is also called as:

a)

Attribute

b)

Relation

c)

Tuple

d)

Entity

19.

Which command is used to view the structure of a table?

a)

SHOW table_name

b)

DESC table_name

c)

VIEW table_name

20.

Which command is used to back up a MySQL database from the terminal?

a)

mysqlbackup

b)

mysqldump

c)

mysqlsave

d)

backupdb

21.

Which SQL command retrieves data from a database?

a)

SELECT

b)

INSERT

c)

UPDATE

d)

DELETE

22.

Which of the following is NOT a type of key in DBMS?

a)

Primary Key

b)

Foreign Key

c)

Alternate Key

d)

Parent Key

23.

Which SQL command is used to remove a database?

a)

DELETE DATABASE

b)

REMOVE DATABASE

c)

DROP DATABASE

d)

CLEAR DATABASE

24.

Which tool provides a GUI to design and manage MySQL databases?

a)

MySQL Workbench

b)

SQL Editor

c)

Database Builder

d)

Data Manager

25.

Which SQL command is used to create a database?

a)

MAKE DATABASE

b)

NEW DATABASE

c)

CREATE DATABASE

d)

INIT DATABASE

26.

Which command displays all tables in a selected database?

4 lines
27.

Which MySQL statement is used to select a database before use?

a)

USE database_name

b)

SELECT database_name

c)

OPEN database_name

d)

START database_name

28.

Explain the role of the Configuration Wizard in MySQL installation.

a)

It writes SQL queries

b)

It sets up server parameters

c)

It installs drivers

d)

It creates user accounts

29.

Define the purpose of MySQL Installer for Windows.

a)

To write SQL queries

b)

To configure network settings

c)

To install and manage MySQL components

d)

To test database performance

30.

Which of the following uniquely identifies a row in a table?

a)

Foreign key

b)

Primary key

c)

Candidate key

d)

Alternate key

31.

Which of the following is NOT an aggregate function in MySQL?

a)

SUM()

b)

COUNT()

c)

AVG()

d)

ROUND()

32.

Which SQL clause is used to sort the results?

a)

ORDER BY

b)

SORT BY

33.

Which MySQL command is used to list all tables in a database?

a)

SHOW DATABASES

b)

SHOW TABLES

c)

LIST TABLES

d)

DESCRIBE DATABASE

34.

The SQL command used to remove a record permanently from a table is:

a)

REMOVE

b)

DELETE

c)

DROP

d)

CLEAR

35.

Which MySQL clause is used to filter groups formed by GROUP BY?

a)

ORDER BY

b)

WHERE

c)

HAVING

d)

DISTINCT

36.

In MySQL, the default sorting order of ORDER BY is:

a)

DESC

b)

ASC

c)

RANDOM

d)

NONE

37.

Which symbol is used in SQL for pattern matching with LIKE?

a)

d)

b)

&

38.

Name the command which is used to drop the structure of the table.

a)

CREATE

b)

ALTER

c)

TRUNCATE

d)

DROP

39.

Which SQL operator is used to check if a value exists in a subquery?

a)

BETWEEN

b)

EXISTS

c)

IN

d)

LIKE

40.

Which clause is used with SELECT to filter records in MySQL?

a)

ORDER BY

b)

WHERE

41.

Which MySQL statement is used to change the structure of an existing table?

a)

UPDATE

b)

ALTER

c)

MODIFY

d)

RENAME

42.

In MySQL, which keyword is used to eliminate duplicate rows in the result?

a)

UNIQUE

b)

DISTINCT

c)

NODUPLICATE

d)

DIFFERENT

43.

The LIKE operator in SQL is used for:

a)

Arithmetic operations

b)

String pattern matching

c)

Sorting

d)

Data type conversion

44.

What does the NOT NULL constraint ensure?

a)

Column must be unique

b)

Column must have default value

c)

Column must be primary key

d)

Column cannot have NULL values

45.

Which SQL command is used to create a new table in MySQL?

a)

INSERT

b)

CREATE

c)

UPDATE

d)

ALTER

46.

Which SQL operator is used to compare a value to a list of possible values?

a)

IN

b)

LIKE

c)

ANY

47.

Which of the following is NOT a Data Manipulation Language (DML) command?

a)

DELETE

b)

INSERT

c)

UPDATE

d)

CREATE

48.

Which SQL statement is used to insert new data into a table?

a)

ADD

b)

INSERT INTO

c)

UPDATE

d)

APPEND

49.

Which command is used to rename a table in MySQL?

a)

CHANGE TABLE

b)

RENAME TABLE

c)

ALTER TABLE

d)

MODIFY TABLE

50.

What does the * symbol in SELECT * FROM table; represent?

a)

Multiply column values

b)

Select all columns

c)

Select unique rows

d)

Count all rows

51.

Which of the following is a Data Definition Language (DDL) command?

a)

INSERT

b)

DELETE

c)

CREATE

d)

UPDATE

52.

Which of the following is NOT a valid MySQL data type?

a)

INT

b)

VARCHAR

c)

FLOAT

d)

CHARACTER

53.

Which statement is used for multi-branch conditional logic in MySQL?

a)

IF()

b)

IFNULL()

c)

CASE

d)

LOOP

54.

In a WHILE loop, where is the loop condition checked?

a)

Before executing the loop body

b)

After executing the loop body

c)

Randomly

d)

Only once

55.

Which flow control statement allows you to exit a loop immediately?

a)

EXIT

b)

LEAVE

c)

END

d)

WHILE

56.

Which clause is used to filter rows in MySQL?

a)

ORDER BY

b)

GROUP BY

c)

WHERE

d)

HAVING

57.

Which clause is used to filter groups after aggregation?

a)

WHERE

b)

ORDER BY

c)

GROUP BY

d)

HAVING

58.

Which statement repeats a block of statements until a condition becomes false?

a)

IF

b)

REPEAT

59.

What is a correlated sub-query?

a)

A query that does not reference any outer query

b)

A query that references columns from the outer query

c)

A query without WHERE clause

d)

A query that only updates data

60.

Which of the following is used to execute conditional logic in MySQL?

a)

LOOP()

b)

IF()

c)

LEAVE

d)

ITERATE

61.

Which of the following is an advantage of using views?

a)

Improves security by restricting access to specific columns

b)

Increases storage requirement

c)

Cannot simplify complex queries

d)

Weaken security by restricting access to specific columns

62.

Which of the following is a looping structure in MySQL?

a)

JOIN

b)

WHILE

c)

SELECT

d)

GROUP BY

63.

Which of the following is a correct way to create a view?

a)

CREATE TABLE view_name AS SELECT * FROM table;

b)

CREATE VIEW view_name AS SELECT * FROM table;

64.

Which operator is used to test for NULL values in SQL?

a)

= NULL

b)

IS NULL

c)

LIKE NULL

d)

NOT NULL

65.

How do you update an existing view?

a)

ALTER VIEW view_name AS SELECT ...;

b)

UPDATE VIEW view_name AS SELECT ...;

c)

MODIFY VIEW view_name AS SELECT ...;

d)

CREATE VIEW view_name AS SELECT ...;

66.

Which function returns a specified value if an expression is NULL?

a)

IFNOTNULL()

b)

IFNULL()

c)

CASE

d)

WHILE

67.

Which type of sub-query is executed for each row of the outer query?

a)

Scalar sub-query

b)

Correlated sub-query

c)

Non-correlated sub-query

d)

Inline view

68.

Which clause is used to sort the result set?

a)

WHERE

b)

ORDER BY

c)

GROUP BY

d)

HAVING

69.

What happens if you drop a table on which a view depends?

a)

Nothing, the view still works

b)

The view is automatically updated

70.

Which of the following is a sub-query?

a)

SELECT * FROM table WHERE id=100;

b)

SELECT * FROM table WHERE id IN (SELECT id FROM table2);

c)

UPDATE table SET col=val;

d)

DELETE FROM table;

71.

How do you delete a view in MySQL?

a)

REJECT VIEW view_name;

b)

DELETE VIEW view_name;

c)

DROP VIEW view_name;

d)

REMOVE VIEW view_name;

72.

Views can help in:

a)

Reducing query complexity

b)

Storing data permanently

c)

Avoiding indexing

d)

Increasing table size

73.

Which command is used to create a sequence in SQL?

a)

CREATE SEQUENCE

b)

MAKE SEQUENCE

c)

NEW SEQUENCE

d)

GENERATE SEQUENCE

74.

Which clause is used to sort the result set?

a)

ORDER

b)

SORT BY

c)

ORDER BY

d)

GROUP BY

75.

Which join returns only the rows with matching values in both tables?

a)

INNER JOIN

b)

LEFT JOIN

c)

RIGHT JOIN

d)

FULL OUTER JOIN

76.

What does the UNION operator do in SQL?

a)

Joins tables side by side

b)

Returns duplicate rows from multiple queries

c)

Combines result sets and removes duplicates

d)

Creates a new table

77.

Which join returns all rows from both tables, with NULLs where there is no match?

a)

Inner Join

b)

Natural Join

c)

Full Outer Join

d)

Left Join

78.

Which command is used to undo a transaction?

a)

REVERSE

b)

CANCEL

c)

COMMIT

d)

ROLLBACK

79.

What is the command to delete a sequence in SQL?

a)

DROP SEQUENCE

b)

REMOVE SEQUENCE

c)

DELETE SEQUENCE

d)

ERASE SEQUENCE

80.

Which command is used to delete a user?

a)

DROP USER

b)

DELETE USER

c)

REMOVE USER

d)

ERASE USER

81.

What command is used to take back permissions from a user?

a)

DENY

b)

REVOKE

c)

REMOVE

82.

Which SQL clause keeps duplicates in union results?

a)

UNION EVERY

b)

UNION ALL

c)

UNION DISTINCT

d)

INTERSECT

83.

What clause limits the number of rows returned?

a)

TOP

b)

FIRST

c)

LIMIT

d)

ROWS

84.

A join that relates a table to itself is called:

a)

Cross Join

b)

Self Join

c)

Outer Join

d)

Composite Join

85.

Which clause would you use to change the increment value of an existing sequence?

a)

MODIFY SEQUENCE

b)

ALTER SEQUENCE

c)

UPDATE SEQUENCE

d)

CHANGE SEQUENCE

86.

What is the difference between UNION and UNION ALL?

a)

UNION includes duplicates, UNION ALL removes them

b)

UNION removes duplicates, UNION ALL includes them

c)

They are identical

d)

Only UNION can sort results

87.

Which command is used to make a transaction permanent?

a)

SAVE

b)

ROLLBACK

c)

COMMIT

d)

EXECUTE

88.

What type of index uses a combination of two or more columns?

a)

Simple Index

b)

Primary Index

c)

Compound Index

d)

Unique Index

89.

Which command is used to create a new user in SQL?

a)

ADD USER

b)

NEW USER

c)

CREATE USER

d)

MAKE USER

90.

Which of these requires the same number and order of columns to work properly?

a)

JOIN

b)

UNION

c)

NATURAL JOIN

d)

SUBQUERY

91.

What is the purpose of a SAVEPOINT in a transaction?

a)

Automatically commits changes

b)

Allows partial rollback

c)

Deletes data

d)

Ends a transaction

92.

What command is used to give permissions to a user?

a)

PERMIT

b)

ALLOW

c)

GRANT

d)

ENABLE

93.

Which command retrieves the next row from a cursor?

a)

GET

b)

SELECT

c)

FETCH

d)

PULL

94.

Which statement is used to close a cursor?

a)

END CURSOR

b)

DROP CURSOR

c)

CLOSE CURSOR

d)

EXIT CURSOR

95.

Which statement is used to remove a stored procedure?

a)

DROP PROCEDURE

b)

DELETE PROCEDURE

c)

REMOVE PROCEDURE

d)

CLEAR PROCEDURE

96.

What is the correct order of cursor operations?

a)

OPEN → DECLARE → FETCH → CLOSE

b)

DECLARE → OPEN → FETCH → CLOSE

c)

FETCH → OPEN → DECLARE → CLOSE

d)

DECLARE → FETCH → OPEN → CLOSE

97.

A trigger can be associated with how many tables?

a)

Only one table

b)

Two tables

c)

Any number of tables

d)

Three tables

98.

Which clause is used to execute a stored procedure?

a)

EXEC

b)

EXECUTE

c)

CALL

d)

RUN

99.

Which Command is used to create stored functions?

a)

CREATE FUNCTION

b)

ADD FUNCTION

c)

MAKE FUNCTION

100.

Which statement is used to remove a trigger?

a)

CLEAR TRIGGER

b)

DELETE TRIGGER

c)

REMOVE TRIGGER

d)

DROP TRIGGER