SQL Quiz

SQL Quiz

12th Grade

20 Qs

quiz-placeholder

Similar activities

DatabaseBasic

DatabaseBasic

12th Grade

17 Qs

AV1/R1 3TEC_Banco de Dados - Chave Primária

AV1/R1 3TEC_Banco de Dados - Chave Primária

1st Grade - University

15 Qs

sql queries - 2

sql queries - 2

12th Grade

20 Qs

Introduction to MySQL

Introduction to MySQL

11th - 12th Grade

15 Qs

MySQL adatleíró és adatkezelő utasítások

MySQL adatleíró és adatkezelő utasítások

12th Grade

18 Qs

Sains Komputer Tingkatan 5 - 2.1.3 SQL: Membina Pangkalan..

Sains Komputer Tingkatan 5 - 2.1.3 SQL: Membina Pangkalan..

10th - 12th Grade

15 Qs

SQL Queries

SQL Queries

12th Grade

25 Qs

programer

programer

12th Grade

20 Qs

SQL Quiz

SQL Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Wasiha Tasneem

Used 1+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?

Discover more resources for Computers