Navigate
JavaScript Tutorial for Beginners
The Ultimate CSS Tutorial for Beginners
Data Structure Tutorial for Beginners
ReactJS Tutorial for Beginners
Java Tutorial for Beginners
Node.js Tutorial for Beginners
SQL Tutorial for Beginners
Content
- Joining Tables
- Grouping Data
- Aggregating Data
- Using Subqueries
- Benefits of Using JavaScript
- Updated on 10/09/2024
- 450 Views
Joining Tables
Use JOIN to combine rows from two or more tables based on a related column.
Grouping Data
Use GROUP BY to group rows that have the same values in specified columns.
Aggregating Data
Use aggregate functions like SUM(), AVG(), MAX(), and MIN() to perform calculations on data.
Using Subqueries
A subquery is a query within another query.
Activity
Write a query to find the department with the highest average salary and list the employees in that department.
Quiz
What does the JOIN keyword do in SQL?
- Combines rows from two or more tables
- Deletes rows from a table
- Filters rows in a single table
- Updates rows in a table
Which clause is used to group rows with the same values?
- ORDER BY
- GROUP BY
- JOIN
- FILTER BY
What is the purpose of aggregate functions?
- To sort data
- To perform calculations on data
- To join multiple tables
- To filter records
How would you find the average salary of employees in a table?
- SELECT AVG(salary) FROM employees;
- SELECT AVERAGE(salary) FROM employees;
- SELECT MEAN(salary) FROM employees;
- SELECT SUM(salary) / COUNT(salary) FROM employees;
What is a subquery in SQL?
- A query within another query
- A type of table join
- A data filtering operation
- A command to update data