SQL
Oracle MySQL 5.6 Certification with Study Guide
What is MySQL 5.6 Certification? The new release of MySQL 5.6 is designed for professionals...
A sub query is a select query that is contained inside another query. The inner select query is usually used to determine the results of the outer select query.
Let's look into the sub query syntax -
A common customer complaint at the MyFlix Video Library is the low number of movie titles. The management wants to buy movies for a category which has least number of titles.
You can use a query like
SELECT category_name FROM categories WHERE category_id =( SELECT MIN(category_id) from movies);
It gives a result
Let's see how this query works
The above is a form of Row Sub-Query. In such sub-queries the , inner query can give only ONE result. The permissible operators when work with row subqueries are [=, >, =, <=, ,!=, ]
Let's look at another example ,
Suppose you want Names and Phone numbers of members of people who have rented a movie and are yet to return them. Once you get Names and Phone Number you call them up to give a reminder. You can use a query like
SELECT full_names,contact_number FROM members WHERE membership_number IN (SELECT membership_number FROM movierentals WHERE return_date IS NULL );
What is MySQL 5.6 Certification? The new release of MySQL 5.6 is designed for professionals...
What are JOINS? Joins help retrieving data from two or more database tables. The tables are...
What is ER Modeling? Entity Relationship Model (ER Modeling) is a graphical approach to database...
$20.20 $9.99 for today 4.6 (119 ratings) Key Highlights of SQLite PDF 159+ pages eBook Designed for...
In this tutorial, we will discuss the key difference between SQL and MySQL. Before discussing SQL...
SQL is the standard language for dealing with Relational Databases. SQL can be used to insert,...