SQL tutorial 69: Intersect and Minus SQL set operators (Free Practice Sheet)
Summary
TLDRIn this SQL tutorial, Manish from RebellionRider.com explains the INTERSECT and MINUS set operators using practical examples. He demonstrates how INTERSECT returns rows common to both queries and how MINUS returns rows from the first query that are not present in the second. Using cricket and football tables as examples, he walks viewers through SQL queries for both operators, showcasing the results. The tutorial also includes a free practice sheet for viewers to enhance their understanding of SQL set operators in Oracle Database.
Takeaways
- 😀 The video is part of a series on SQL set operators, focused on explaining the INTERSECT and MINUS operators.
- 😀 INTERSECT returns rows that are common to both queries being compared.
- 😀 The presenter uses football and cricket tables to demonstrate how INTERSECT works.
- 😀 In the demonstration, the INTERSECT query returns a common row (Clark Kent) from both tables.
- 😀 SQL syntax for INTERSECT: `SELECT first_name, last_name FROM cricket INTERSECT SELECT first_name, last_name FROM football;`.
- 😀 The MINUS operator returns rows from the first query that are not present in the second query.
- 😀 MINUS shows the difference between two tables, meaning only the rows from the first table that don't exist in the second table are returned.
- 😀 The SQL syntax for the MINUS operator is similar to INTERSECT but uses the keyword `MINUS` instead.
- 😀 In the MINUS example, the result set consists of rows from the cricket table that were not found in the football table.
- 😀 The presenter encourages viewers to download a practice sheet from the description to help reinforce the concepts of SQL set operators.
Q & A
What is the primary focus of this video?
-The primary focus of this video is explaining two SQL set operators, INTERSECT and MINUS, using practical examples with 'cricket' and 'football' tables.
What does the INTERSECT operator do in SQL?
-The INTERSECT operator in SQL returns rows that are common to both queries, meaning it only retrieves the data that appears in both result sets.
Can you give an example of how INTERSECT works using the tables in the video?
-In the video, both the 'cricket' and 'football' tables contain rows with a person named Clark Kent. Since this row is present in both tables, executing the INTERSECT operation returns just this row.
What is the key difference between INTERSECT and MINUS in SQL?
-The INTERSECT operator returns rows that are common to both queries, while the MINUS operator returns rows from the first query that are not present in the second query.
How does the MINUS operator work in SQL?
-The MINUS operator in SQL returns rows from the first query that do not exist in the second query, effectively subtracting the second query's result from the first query's result.
What is the output when using the MINUS operator on the 'cricket' and 'football' tables in the video?
-When the MINUS operator is used on the 'cricket' and 'football' tables, the output contains the rows from the 'cricket' table that are not present in the 'football' table, which in this case are two rows.
Why does the video recommend watching the previous tutorial before this one?
-The previous tutorial provides foundational knowledge on SQL set operators and uses the same 'cricket' and 'football' tables, which helps in understanding the concepts discussed in this tutorial.
What does the speaker provide for viewers to practice the concepts learned in this video?
-The speaker offers a free practice sheet for viewers to download and practice the concepts of SQL set operators in Oracle Database.
What is the purpose of the links in the video description?
-The links in the video description provide access to additional resources, including the previous tutorial, the practice sheet, and the speaker's social media accounts for updates.
How can viewers support the channel and the speaker's educational mission?
-Viewers can support the channel by sharing the video on social media, liking, and subscribing to the channel, helping to reach more people and promote free IT education.
Outlines
此内容仅限付费用户访问。 请升级后访问。
立即升级Mindmap
此内容仅限付费用户访问。 请升级后访问。
立即升级Keywords
此内容仅限付费用户访问。 请升级后访问。
立即升级Highlights
此内容仅限付费用户访问。 请升级后访问。
立即升级Transcripts
此内容仅限付费用户访问。 请升级后访问。
立即升级浏览更多相关视频
SQL tutorial 44: How to import data from Microsoft Excel to Oracle Database using SQL Developer
Oracle Database Tutorial 56:Data Pump impdp table and Duplicate (Remap_table ) table
SQL tutorial 71: LPAD and RPAD SQL Function By Manish Sharma RebellionRider
How to Run PostgreSQL in Visual Studio Code
Sql Variables & 2nd Highest Salary Interview Question | Mysql, MariaDB & Postgres
(CS50 SQL) PROBLEM SET 0 - Cyberchase | SOLUTION
5.0 / 5 (0 votes)