SQL Queries Practical

SQL Queries Practical

University

30 Qs

quiz-placeholder

Similar activities

MID SEMESTER TEST

MID SEMESTER TEST

University

30 Qs

DBMS SQL

DBMS SQL

University

30 Qs

SQL Basics

SQL Basics

University

29 Qs

MELINIA - SEQUELVERSE - ROUND 1

MELINIA - SEQUELVERSE - ROUND 1

University

30 Qs

SQL

SQL

University

35 Qs

PHP + MySQL

PHP + MySQL

7th Grade - University

25 Qs

SQL QUIZ-2

SQL QUIZ-2

University

30 Qs

Intro DBMS 2023-3

Intro DBMS 2023-3

University

30 Qs

SQL Queries Practical

SQL Queries Practical

Assessment

Quiz

Computers

University

Hard

Created by

Bendangmenla Bendangmenla

Used 6+ times

FREE Resource

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.

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?