NEW
Font size
WorksheetsSQL Basics Worksheet
Total questions: 20
Worksheet time: 10mins
Which command is used to create a new database?
USE
CREATE DATABASE
SHOW DATABASES
CREATE TABLE
To start working inside a specific database, we use:
START DATABASE
OPEN DATABASE
USE
SELECT DATABASE
Which command displays all the tables present in the selected database?
DISPLAY TABLES
SHOW TABLES
VIEW TABLES
LIST TABLES
In SQL, which data type is best suited for Fare (price of a flight)?
INT
VARCHAR
DECIMAL
DATE
What is the correct syntax to create a table named Employees with the columns EmpID and Salary as integers?
CREATE Employees TABLE (EmpID INT, Salary INT);
CREATE TABLE Employees (EmpID, Salary);
CREATE TABLE Employees (EmpID INT, Salary INT);
TABLE Employees CREATE (EmpID INT, Salary INT);
Which SQL statement is used to remove a database?
DELETE DATABASE
DROP DATABASE
REMOVE DATABASE
ERASE DATABASE
What will the command SHOW DATABASES; do?
Display all tables
Display all records
Display list of databases
Show structure of a table
Which keyword is used to define text columns such as EmpName or Author?
TEXT
WORD
VARCHAR
CHARACTERS
Which command will show the structure of a table named Employees?
SHOW Employees;
DESCRIBE Employees;
DETAIL Employees;
VIEW Employees;
What does this command do? CREATE TABLE Flights (FlightNo INT, AirlineName VARCHAR(20));
Creates a new database
Creates a new table
Displays all flights
Inserts values into Flights
Which of the following is correct to create a table inside the selected database?
You must select the database first
You can create a table without selecting any database
You must show tables first
You must drop the database first
To store numeric salary with decimals, which data type is best?
INT
DECIMAL
CHAR
BOOLEAN
Which SQL keyword is mandatory when creating a database?
NEW
ADD
CREATE
OPEN
What does the following command do? DROP TABLE Books;
Deletes all databases
Deletes Books table permanently
Displays Books table
Removes only data but keeps structure
In the command CREATE TABLE Employees (EmpID INT, Salary INT); EmpID is:
Column name
Data type
Database name
Table name
Which of the following is NOT a valid SQL statement?
CREATE DATABASE MyDB;
SHOW DATABASES;
USE DATABASE MyDB;
USE MyDB;
Which of the following is a DDL (Data Definition Language) command?
INSERT
DELETE
UPDATE
CREATE
What is the correct order of SQL statements for creating and using a database?
CREATE TABLE → USE → CREATE DATABASE
CREATE DATABASE → CREATE TABLE → USE
USE → CREATE DATABASE → CREATE TABLE
CREATE DATABASE → USE → CREATE TABLE
Which datatype is suitable for storing prices such as Book Price?
BOOLEAN
DATE
DECIMAL
VARCHAR
SQL stands for:
Standard Query Language
Simple Query Language
Structured Query Language
Server Query Language
