NEW
Font size
WorksheetsQuiz#1 - SQL Part 1 (Information Management)
Total questions: 20
Worksheet time: 5mins
What does SQL stand for?
Structured Query Logic
Simple Query Language
Structured Query Language
Systematic Query Language
Which of the following is a correct SQL command to create a database?
NEW DATABASE myDB;
CREATE DATABASE myDB;
MAKE DATABASE myDB;
INIT DATABASE myDB;
Which SQL command would you use to remove all data from a table without deleting the table itself?
DELETE TABLE Students;
REMOVE Students;
TRUNCATE TABLE Students;
DROP TABLE Students;
Which data type category includes varchar and text?
Numeric
Date and Time
Binary Strings
Character Strings
Which of the following is a logical operator in SQL?
+
=
AND
%
Which SQL command modifies a column’s data type in an existing table?
CHANGE COLUMN
ALTER COLUMN
MODIFY COLUMN
UPDATE COLUMN
Which constraint ensures that a column cannot contain duplicate values?
NOT NULL
PRIMARY KEY
DAFAULT
UNIQUE
What does the FOREIGN KEY constraint do?
Prevents NULL values
Links records to another table
Sets a default value
Ensures a value is within a range
Which is the correct syntax to create a PRIMARY KEY during table creation?
PRIMARY (StudentID);
UNIQUE KEY StudentID;
StudentID PRIMARY KEY;
KEY StudentID PRIMARY;
Which command is used to add a CHECK constraint on an existing table?
MODIFY TABLE ADD CHECK (condition);
CHECK ON TABLE (condition);
ALTER TABLE ADD CHECK (condition);
ALTER TABLE CHECK ADD (condition);
A query is a specific request for data manipulation issued by the end-user or an application.
TRUE
FALSE
The command DROP TABLE Students; removes all the data from the table but keeps the table structure.
TRUE
FALSE
The DEFAULT constraint is used to ensure all values in a column are unique.
TRUE
FALSE
varchar, nchar, and nvarchar are examples of character string data types in SQL.
TRUE
FALSE
The ALTER TABLE command can be used to both add and drop columns in an existing table.
TRUE
FALSE
SQL commands are case-sensitive, meaning SELECT and select are treated differently.
TRUE
FALSE
The CHECK constraint is used to enforce a condition on the values in a column.
TRUE
FALSE
The EXISTS and BETWEEN operators are types of arithmetic operators in SQL.
TRUE
FALSE
A column defined with the NOT NULL constraint must always have a value.
TRUE
FALSE
SQL is only compatible with Microsoft SQL Server and not with other databases like MySQL or Oracle.
TRUE
FALSE
