Search Header Logo

SQL Quiz

Authored by Wasiha Tasneem

Computers

12th Grade

Used 1+ times

SQL Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Create a SQL query to create a table named 'Students' with columns 'id' of type INT, 'name' of type VARCHAR(50), and 'age' of type INT.

CREATE TABLE Students (id VARCHAR(50), name INT, age VARCHAR(50));

INSERT INTO Students (id INT, name VARCHAR(50), age INT);

CREATE TABLE Students (id INT, name VARCHAR(50), age INT);

UPDATE Students SET id INT, name VARCHAR(50), age INT;

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Write a SQL query to create a table named 'Employees' with columns 'emp_id' of type INT, 'emp_name' of type VARCHAR(50), 'emp_salary' of type DECIMAL(10,2), and 'emp_join_date' of type DATE.

CREATE TABLE Employees (emp_id INT, emp_name VARCHAR(50), emp_salary DECIMAL(10,2), emp_join_date DATE);

CREATE TABLE Employees (emp_id DECIMAL(10,2), emp_name DATE, emp_salary VARCHAR(50), emp_join_date INT);

CREATE TABLE Employees (emp_id DATE, emp_name DECIMAL(10,2), emp_salary INT, emp_join_date VARCHAR(50));

CREATE TABLE Employees (emp_id VARCHAR(50), emp_name INT, emp_salary DATE, emp_join_date DECIMAL(10,2));

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Design a SQL query to create a table named 'Products' with columns 'product_id' of type INT, 'product_name' of type VARCHAR(100), 'price' of type DECIMAL(8,2), and 'quantity' of type INT.

CREATE TABLE Products (product_id VARCHAR(50), product_name VARCHAR(255), price DECIMAL(10,2), quantity INT);

CREATE TABLE Products (product_id INT, product_name VARCHAR(100), price DECIMAL(8,2), quantity INT);

CREATE TABLE Products (id INT, name VARCHAR(100), price DECIMAL(8,2), qty INT);

CREATE TABLE Products (product_id INT, product_name TEXT, price DECIMAL(8,2), quantity INT);

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the data types in SQL with examples.

Data types in SQL include apple, banana, orange, grape, and watermelon among others.

Data types in SQL include integer, float, char, varchar, date, and boolean among others.

Data types in SQL include cat, dog, bird, fish, and rabbit among others.

Data types in SQL include red, blue, green, yellow, and purple among others.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the different data types available in SQL? Provide examples for each data type.

Text, Number, DateTime

String, Boolean, Float

Character, Integer, Boolean

INT, VARCHAR, DATE

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Discuss the importance of data types in SQL and how they are used in table creation.

Data types in SQL are used in table creation to specify the color of the text

Data types in SQL are important for defining the type of data that can be stored in a column. They are used in table creation to specify the type of data that each column can hold, such as integer, text, date, etc.

Data types in SQL are used in table creation to specify the type of font used

Data types in SQL are not important for defining the type of data that can be stored in a column

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Explain the concept of constraints in SQL and provide examples of different types of constraints.

Constraints in SQL are used to enhance the performance of queries

Constraints in SQL are rules that are used to limit the type of data that can go into a table. Examples of constraints include NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, and CHECK constraints.

Examples of constraints include formatting rules for data input

Constraints in SQL are only applicable to numeric data types

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?