wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CS10337 - Lecture #2

Total questions: 10

Worksheet time: 2mins

Name
Class
Date
1.

Which of the following is a valid MySQL data type?

a)

VARCHAR

b)

NUMSTRING

c)

TEXTFILE

d)

BOOLEANISH

2.

Which data type is best suited for storing large binary files (like images)?

a)

VARCHAR

b)

BLOB

c)

INT

d)

CHAR

3.

Which SQL command correctly creates a database named school?

a)

CREATE school DATABASE;

b)

NEW DATABASE school;

c)

CREATE DATABASE school;

d)

MAKE DATABASE school;

4.

Which command is used to select a database in MySQL?

a)

USE school;

b)

OPEN school;

c)

SELECT DATABASE school;

d)

LOAD school;

5.

Which command correctly creates a table named students with id as the primary key?

a)

CREATE TABLE students (id INT PRIMARY KEY, name VARCHAR(50));

b)

NEW TABLE students (id INT KEY, name STRING(50));

c)

CREATE students TABLE (id INT PRIMARY, name VARCHAR(50));

d)

MAKE TABLE students (id NUMBER, name TEXT(50));

6.

Which constraint ensures that a column cannot have duplicate values?

a)

PRIMARY KEY

b)

FOREIGN KEY

c)

UNIQUE

d)

NOT NULL

7.

Which of the following correctly defines a NOT NULL constraint?

a)

age INT UNIQUE;

b)

age INT NOT NULL;

c)

age INT FOREIGN KEY;

d)

age INT PRIMARY;

8.

Which command creates an index on the last_name column of students?

a)

ADD INDEX last_name ON students(last_name);

b)

CREATE INDEX idx_lastname ON students(last_name);

c)

NEW INDEX idx_lastname FOR students(last_name);

d)

MAKE INDEX idx_lastname ON students(last_name);

9.

Which type of index is automatically created when you define a primary key?

a)

Fulltext Index

b)

Clustered Index

c)

Unique Index

d)

Spatial Index

10.

Which index type is best for searching text within large documents?

a)

Fulltext Index

b)

Composite Index

c)

Spatial Index

d)

Regular Index