▶ C'mon over to https://realpars.com
where you can learn PLC programming faster and easier than you ever thought possible!
▶ Check out the full blog post over at https://realpars.com/sql-subquery/
If you are just now joining along with this series of videos, please note that you are going to learn about SQL programming basics.
If you would like to follow along with us, please review the RealPars video, “How to install MySQL and import a sample database”, on how to download and setup MySQL database on your computer.
“What are SQL Where and Like statements basics” (https://realpars.com/sql-where/), continues where we left off within the “What are SQL programming basics” video for our series of lessons covering SQL programming. (https://realpars.com/sql/)
In the video, "What are the SQL Order By Clause and Expression statement language elements?" (https://realpars.com/sql-order-by/), we learned about the structure of SQL defining the clauses, expressions defining the overall statement.
In the previous video, What are the SQL INNER Join, And, OR, Having and Between Clause statement language elements (https://realpars.com/inner-join/), we learned about some of the more advanced SQL statements and clauses such as, AND, OR, BETWEEN, INNER JOIN and HAVING. We also learned about the SQL syntax or rules of the SQL language.
In this video, What are the SQL Subquery and Exists Clause statement language elements, you will learn about some of the advanced data definition SQL statements such as, Subquery and Exists.
A subquery is a query nested within another query used in the SELECT, INSERT, UPDATE or DELETE statement. Also, in MySQL, a subquery can be nested inside another subquery.
A subquery is named an inner query while the query that contains the subquery is named an outer query. A subquery can be used anywhere that expression is used and must be closed in parentheses.
In this example, when the query is executed, the subquery runs first and returns all office codes of the offices located in the USA. Then, this result set is used as an input to the outer query, selecting the last name and first name columns from the employee's table.
The EXISTS operator is a Boolean operator that returns either true or false. The EXISTS operator is often used in a subquery to test if data exists condition.
For example, in each row in the Students table, the query checks the StudentNumber in the Orders table. If StudentNumber, which appears in the Students table, also exists in the Orders table, the subquery returns matching rows.
As a result, the EXISTS operator returns true. Otherwise, the subquery returns no row and the EXISTS operator returns false.
Review the MySQL minimum hardware requirement web page here: https://forums.mysql.com/read.php?11
Download the MySQL Installer: https://dev.mysql.com/downloads/installer/
Download the sample database SQL file from here: https://realpars.com/wp-content/uploads/2019/12/realparssampledatabasev2.zip
Download the sample database diagram file from here: https://realpars.com/wp-content/uploads/2020/01/RealParsSampleDatabaseV2-Diagram.zip
Missed our most recent videos? Watch them here:
How to Install MySQL and Import a Sample Database (Part 1) https://realpars.com/mysql
What are SQL Programming Basics? (Part 2) https://realpars.com/sql
What are SQL Where and Like Statements Basics? (Part 3) https://realpars.com/sql-where
What are the SQL Order By Clause and Expression Statement Language Elements? (Part 4) https://realpars.com/sql-order-by/
What are the SQL Inner Join, And, Or, Having and Between Clause? (Part 5) https://realpars.com/inner-join/
To stay up to date with our last videos and more lessons, make sure to subscribe to this YouTube channel:
TWEET THIS VIDEO https://ctt.ac/ahTo6
Like us on Facebook: https://www.facebook.com/therealpars/
Follow us on Twitter: https://twitter.com/realpars
Follow us on LinkedIn https://www.linkedin.com/company/realpars
Follow us on Instagram https://www.instagram.com/realparsdotcom/
#RealPars #SQL #MySQL