NEW
Font size
WorksheetsMySQL Basics for Grade 10
Total questions: 10
Worksheet time: 5mins
What are the main SQL data types?
Character, Float, Timestamp, Array
Decimal, Varchar, Interval, List
Text, Integer, Time, Set
Numeric, String, Date and Time, Boolean
Which command is used to create a new table in SQL?
MODIFY TABLE
ADD TABLE
INSERT TABLE
CREATE TABLE
What is the purpose of the SELECT statement?
To delete data from a database.
To create new tables in a database.
To retrieve data from a database.
To update existing records in a database.
How do you update a record in a table?
Use the SQL SELECT statement with JOIN clause.
Use the SQL DELETE statement with WHERE clause.
Use the SQL UPDATE statement with SET and WHERE clauses.
Use the SQL INSERT statement with VALUES clause.
What data type would you use for a date in SQL?
TIMESTAMP
DATE
STRING
VARCHAR
Which command is used to delete a table?
DELETE TABLE table_name;
REMOVE TABLE table_name;
CLEAR TABLE table_name;
DROP TABLE table_name;
What is the syntax for inserting data into a table?
INSERT INTO table_name (column1, column2) VALUES (value1, value2);
DELETE FROM table_name WHERE condition;
SELECT * FROM table_name;
UPDATE table_name SET column1 = value1;
How can you retrieve all records from a table?
SELECT * FROM table_name;
FETCH * FROM table_name;
GET ALL FROM table_name;
RETRIEVE table_name;
What is the difference between VARCHAR and CHAR data types?
VARCHAR is fixed-length; CHAR is variable-length.
VARCHAR is variable-length; CHAR is fixed-length.
VARCHAR can only store numbers; CHAR can store text.
CHAR is used for large text; VARCHAR is for small text.
How do you add a new column to an existing table?
CREATE TABLE table_name ADD new_column_name data_type;
ALTER TABLE table_name ADD COLUMN new_column_name data_type;
INSERT INTO table_name (new_column_name) VALUES (value);
UPDATE table_name SET new_column_name = value;
