filmov
tv
How to do Subqueries in SQL with Examples

Показать описание
Step-by-step tutorial shows you how to use SQL subqueries in your SELECT statement & FROM and WHERE clauses!
Queries:
1) A subquery in the SELECT statement: SELECT customerid, freight, (SELECT AVG(freight) FROM orders) FROM orders
2) A subquery in the FROM clause: SELECT shipcountry, AVG(num_orders) FROM (SELECT customerid, shipcountry, count(*) AS num_orders FROM orders GROUP BY 1,2) sub GROUP BY 1
3) A subquery in the WHERE clause: SELECT * FROM orders WHERE employeeid IN (SELECT employeeid FROM employees WHERE LOWER(firstname) LIKE '%b%')
Support the Channel:
Queries:
1) A subquery in the SELECT statement: SELECT customerid, freight, (SELECT AVG(freight) FROM orders) FROM orders
2) A subquery in the FROM clause: SELECT shipcountry, AVG(num_orders) FROM (SELECT customerid, shipcountry, count(*) AS num_orders FROM orders GROUP BY 1,2) sub GROUP BY 1
3) A subquery in the WHERE clause: SELECT * FROM orders WHERE employeeid IN (SELECT employeeid FROM employees WHERE LOWER(firstname) LIKE '%b%')
Support the Channel:
How to do Subqueries in SQL with Examples
Advanced SQL Tutorial | Subqueries
Subquery in SQL | Correlated Subquery + Complete SQL Subqueries Tutorial
MySQL: SUBQUERIES
Subquery In SQL | SQL Subquery Tutorial With Examples | SQL Tutorial For Beginners | Simplilearn
Subquery in SQL || SQL Subquery tutorial with examples
Secret To Optimizing SQL Queries - Understand The SQL Execution Order
Subqueries in sql Part 59
MySQL Update Query Explained: Step-by-Step Tutorial for Beginners
Approach to Complex SQL Queries
Nested Queries | SQL | Tutorial 18
Learning MySQL - SubQueries
MySQL: Verständliche Einführung in Subqueries (Subselects) (deutsch)
SQL : how to do subqueries in bigquery?
Correlated subquery in sql Part 60
SQL Server Queries Part 11 - Subqueries
Lec-68: Correlated Subquery in SQL with Example | Imp for Placements, GATE, NET & SQL certificat...
SQL Tutorial 9: SQL Joins and Sub Queries
Lec-61: SQL Queries and Subqueries (part-3) | Group By clause | Database Management System
Lec-59: SQL Queries and Subqueries (part-1) | Database Management System
Understanding Correlated Queries in SQL
Oracle SubQueries Part - 1 by Dinesh
SQL Subqueries | Subqueries in SQL with examples | Nested Queries | How to do Subqueries in SQL
Lec-65: SQL Queries and Subqueries (part-7)| use of IN and Not IN in Subquery | DBMS
Комментарии