SQL Queries Practical

SQL Queries Practical

University

30 Qs

quiz-placeholder

Similar activities

DBC-IT105-Prelim Quiz

DBC-IT105-Prelim Quiz

University

25 Qs

1st Term Revision G4

1st Term Revision G4

3rd Grade - University

25 Qs

TIM Pertemuan 1-4

TIM Pertemuan 1-4

University

25 Qs

Unit- 1- OFFICE AUTOMATION

Unit- 1- OFFICE AUTOMATION

University

25 Qs

CAMP_CODING_SIMKESKHANZA

CAMP_CODING_SIMKESKHANZA

University - Professional Development

25 Qs

Speed Cup de Ingeniería 2021 (Eliminatoria)

Speed Cup de Ingeniería 2021 (Eliminatoria)

1st Grade - University

25 Qs

UTS manajemen data 2017, FKM Universitas Malahayati

UTS manajemen data 2017, FKM Universitas Malahayati

University

25 Qs

ITC 211 - Introduction to Computing - Quiz 1

ITC 211 - Introduction to Computing - Quiz 1

University

25 Qs

SQL Queries Practical

SQL Queries Practical

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Bendangmenla Bendangmenla

Used 6+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the basic syntax for a SELECT query in SQL?

SELECT column1, column2 WHERE table_name;

SELECT column1, column2 FROM table_name;

SELECT column1 column2 FROM table_name;

SELECT * FROM table_name;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between INNER JOIN and LEFT JOIN.

INNER JOIN returns all rows from the left table

LEFT JOIN returns only matching rows

INNER JOIN compares and returns only matching rows, LEFT JOIN returns all rows from the left table and matched rows from the right table

INNER JOIN combines all rows from both tables

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are some common aggregate functions in SQL?

TOTAL

COUNT, SUM, AVG, MIN, MAX

AVERAGE

SMALLEST

BIGGEST

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you use a subquery in a WHERE clause?

SELECT * FROM table_name WHERE column_name = (SELECT column_name FROM another_table WHERE condition)

SELECT * FROM table_name WHERE column_name = (SELECT column_name FROM another_table WHERE condition) ORDER BY column_name

SELECT * FROM table_name WHERE column_name = (SELECT column_name FROM another_table WHERE condition) OR column_name = value

SELECT * FROM table_name WHERE column_name = (SELECT column_name FROM another_table WHERE condition) AND column_name = value

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write a query to retrieve the average salary of employees in a table.

SELECT MAX(salary) FROM employees;

SELECT AVG(salary) FROM employees;

SELECT SUM(salary) FROM employees;

SELECT MIN(salary) FROM employees;

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When would you use a self-join in SQL?

When you want to insert new rows into a table

When you need to delete rows from a table

When you need to perform aggregate functions on a table

When you need to compare rows within the same table.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the GROUP BY clause in SQL?

To sort rows in ascending order

To update values in a table

To filter rows based on a condition

To group rows with the same values together for aggregate function calculations.

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?

Discover more resources for Computers