Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL Basics Worksheet

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.

How do you insert a new table in SQL?

a)

INSERT INTO table_name VALUES (column1, column2, ...)

b)

CREATE TABLE table_name (column1 datatype, column2 datatype, ...)

c)

ADD TABLE table_name (column1, column2, ...)

d)

INSERT INTO TABLE table_name VALUES (column1, column2, ...)

2.

Which query deletes a table in SQL?

a)

DELETE TABLE table_name

b)

DROP TABLE table_name

c)

REMOVE TABLE table_name

d)

CLEAR TABLE table_name

3.

Which SQL query converts a string into uppercase?

a)

UPPERCASE(string_column)

b)

TOUPPER(string_column)

c)

UPPER(string_column)

d)

CONVERT(string_column TO UPPER)

4.

Which query would you use to add a new column to an existing table?

a)

ALTER TABLE table_name ADD column_name datatype

b)

ALTER TABLE table_name INSERT column_name datatype

c)

ALTER TABLE table_name ADD COLUMN column_name datatype

d)

MODIFY TABLE table_name ADD COLUMN column_name datatype

5.

How can you update a value in a table?

a)

UPDATE table_name SET column_name = new_value WHERE condition

b)

MODIFY table_name SET column_name = new_value WHERE condition

c)

UPDATE table_name WHERE condition SET column_name = new_value

d)

CHANGE table_name SET column_name = new_value WHERE condition

6.

How would you delete data in a table without removing the table itself?

a)

REMOVE FROM table_name

b)

DELETE FROM table_name

c)

TRUNCATE table_name

d)

DROP FROM table_name

7.

Which query allows you to rename a table?

a)

RENAME TABLE old_name TO new_name

b)

CHANGE TABLE old_name TO new_name

c)

ALTER TABLE old_name RENAME TO new_name

d)

UPDATE TABLE old_name RENAME new_name

8.

Which SQL command is used to modify an existing column's datatype?

a)

ALTER TABLE table_name MODIFY column_name new_datatype

b)

ALTER TABLE table_name CHANGE column_name new_column_name new_datatype

c)

MODIFY TABLE table_name column_name new_datatype

d)

ALTER TABLE table_name CHANGE column_name TO new_datatype