Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- line width
- Text Analytics
- Text mining
- break
- SQL
- PANDAS
- PROJECT
- train/test
- machine learning
- AS
- Else
- iterates
- error
- self parameter
- polynomial regression
- __init__
- Default X points
- line color
- data distribution
- matplotlib.pyplot
- Python
- multiple lines
- continue
- For loops
- variables
- Github
- MySQL
- start exercise
- matplotlib
- pie charts
Archives
- Today
- Total
Data Science Explorer
[Basic Grammar] SQL FULL OUTER JOIN 본문
반응형
The FULL OUTER results in all records when there is a match in left or right table records.
- FULL OUTER JOIN Syntax
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name = table2.column_name
WHERE condition;
Example
The following SQL statement selects all customers, and all orders:
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
FULL OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;
Exercises
Write an SQL query to retrieve a list of all students and their enrolled courses. Use a FULL OUTER JOIN to ensure that all students and all courses are included in the result, even if some students are not enrolled in any courses and some courses have no enrolled students.
SELECT Students.StudentName, Courses.CourseName
FROM Students
FULL OUTER JOIN Enrollments ON Students.StudentID = Enrollments.StudentID
FULL OUTER JOIN Courses ON Enrollments.CourseID = Courses.CourseID;
'SQL' 카테고리의 다른 글
[Basic Grammar] SQL GROUP BY Statement (0) | 2023.10.19 |
---|---|
[Basic Grammar] SQL UNION Operator (0) | 2023.10.19 |
[Basic Grammar] SQL RIGHT JOIN (0) | 2023.10.18 |
[Basic Grammar] SQL LEFT JOIN (1) | 2023.10.18 |
[Basic Grammar] SQL INNER JOIN (0) | 2023.10.18 |