NEW
Font size
WorksheetsSQL TEST
Total questions: 10
Worksheet time: 4mins
Which SQL statement adds a new column named 'Email' to the ‘Students' table?
ALTER TABLE Students ADD COLUMN Email varchar(255);
ALTER Students ADD COLUMN Email varchar(255);
ALTER TABLE Students ADD Email varchar(255);
MODIFY TABLE Students ADD Email varchar(255);
What will the following SQL statement do?
ALTER TABLE Students
DROP COLUMN Email;
Delete all records in the 'Email' column.
Delete all data from a table.
Change the data type of the 'Email' column.
Delete the 'Email' column from the ‘Students' table.
What does the SQL ALTER TABLE
statement allow you to do?
Create a new table in the database.
Add, delete, or modify columns in an existing table.
Delete all data from a table.
Insert data into a table
Which syntax is correct for changing the data type of a column in SQL?
ALTER TABLE Table_name …
ALTER COLUMN Column_name Datatype ;
CHANGE Column_name Datatype;
MODIFY Datatype TO Column_name ;
ALTER COLUMN Datatype Column_name;
How do you add a PRIMARY KEY
to the 'ID' column in an existing table named ‘Persons’?
ALTER TABLE Persons SET PRIMARY KEY (ID);
ALTER TABLE Persons MODIFY PRIMARY KEY (ID);
ALTER TABLE Persons ADD PRIMARY KEY (ID);
ALTER TABLE Persons PRIMARY KEY ID;
What is the primary purpose of the SQL CREATE TABLE statement?
To insert data into a table
To join a table
To create a new table in a database
To delete a table from a database
What does the 'DATATYPE' parameter in the CREATE TABLE statement specify?
The type of data the column can hold
The default value of the column
The name of the column
The primary key for the column
Which of the following is NOT a string data type in SQL?
VarChar
Symbol
Text
Character
A floating point number can be defined using FLOAT or …?...
INTEGER
NUMERIC
REAL
BOOLEAN
Which of the following is the correct format for the DATE data type?
DD-MM-YYYY
MM/DD/YYYY
YYYY/MM/DD
YYYY-MM-DD
