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

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
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 Quizizz
25 questions
Lvl 2 Relational Algebra

Quiz
•
University
30 questions
Database Design & Development 1

Quiz
•
University
25 questions
Relational Database Model

Quiz
•
University
26 questions
dbms_batch2_28_jan_2020_quiz

Quiz
•
University
26 questions
BTEC DIT Component 2 Super Quiz

Quiz
•
1st Grade - University
25 questions
DBMS

Quiz
•
University
29 questions
SQL Basics

Quiz
•
University
25 questions
SQL BASICS

Quiz
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade