
SQL Queries Practical

Quiz
•
Computers
•
University
•
Hard
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
Similar Resources on Wayground
25 questions
Estructura de Datos

Quiz
•
University
25 questions
PTS TIKOM 5 SEM II

Quiz
•
5th Grade - University
30 questions
CADATHON QUIZ

Quiz
•
University
30 questions
Quiz PBD 21 Sept 2023

Quiz
•
University
25 questions
Module 3 - Security Architecture

Quiz
•
University
35 questions
SQL

Quiz
•
University
25 questions
5th sem r2 final

Quiz
•
University
25 questions
Cybersecurity Knowledge Assessment

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University