NEW
Font size
WorksheetsCS10337 - Lecture #2
Total questions: 10
Worksheet time: 2mins
Which of the following is a valid MySQL data type?
VARCHAR
NUMSTRING
TEXTFILE
BOOLEANISH
Which data type is best suited for storing large binary files (like images)?
VARCHAR
BLOB
INT
CHAR
Which SQL command correctly creates a database named school?
CREATE school DATABASE;
NEW DATABASE school;
CREATE DATABASE school;
MAKE DATABASE school;
Which command is used to select a database in MySQL?
USE school;
OPEN school;
SELECT DATABASE school;
LOAD school;
Which command correctly creates a table named students with id as the primary key?
CREATE TABLE students (id INT PRIMARY KEY, name VARCHAR(50));
NEW TABLE students (id INT KEY, name STRING(50));
CREATE students TABLE (id INT PRIMARY, name VARCHAR(50));
MAKE TABLE students (id NUMBER, name TEXT(50));
Which constraint ensures that a column cannot have duplicate values?
PRIMARY KEY
FOREIGN KEY
UNIQUE
NOT NULL
Which of the following correctly defines a NOT NULL constraint?
age INT UNIQUE;
age INT NOT NULL;
age INT FOREIGN KEY;
age INT PRIMARY;
Which command creates an index on the last_name column of students?
ADD INDEX last_name ON students(last_name);
CREATE INDEX idx_lastname ON students(last_name);
NEW INDEX idx_lastname FOR students(last_name);
MAKE INDEX idx_lastname ON students(last_name);
Which type of index is automatically created when you define a primary key?
Fulltext Index
Clustered Index
Unique Index
Spatial Index
Which index type is best for searching text within large documents?
Fulltext Index
Composite Index
Spatial Index
Regular Index
