TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

MySQL

MySQL Subquery Categories

Overview

In this tutorial, we will learn about MySQL Subquery Categories.We can categorize subqueries into many types.

  • Based on outer/inner query dependency
  • Based on data returned by the subquery.

There are two categories of subqueries based on the interaction between the outer and inner query. They are as follows:

  1. Correlated Subquery
  2. Non-correlated Subquery

Correlated Subquery

Correlated subquery contains references to the columns in the outer query and cannot be evaluated independently of it.

Non-Correlated Subquery

Non-correlated subquery contains no references to the outer query, is not dependent on it and can be evaluated as a completely separate query.

https://www.testingdocs.com/mysql-non-correlated-subquery/

Types of Subquery

We can categorize subqueries based on the return data. The type of table returned by the subquery determines how it may be used and which operators may be used by the outer query to interact with the table returned by the subquery.

Subqueries can return different amounts and types of table data as follows:

Type  Definition
Scalar                                Single row with a single column
Column                        

 

Single column with one or more row
Row  Single row with one or more columns
 

Table 

One or more row with one or more column

 

When the outer query has finished executing, the table returned by any subqueries are discarded, making a subquery act like a temporary table with statement scope. That means the MySQL database server frees up any storage allocated to the subquery results after the statement has finished execution.

—

MySQL Tutorials

MySQL Tutorials on this website:

https://www.testingdocs.com/mysql-tutorials-for-beginners/

For more information on MySQL Database:

https://www.mysql.com/

Related Posts

DataGrip Desktop Shortcut

MySQL /

Launch DataGrip on Windows

DataGrip Download

MySQL /

Install DataGrip IDE on Windows 11

MySQL Workbench Windows 11

MySQL /

New MySQL Connection in Workbench

MySQL Command-line Client

MySQL /

Command-Line MySQL Client

Start MySQL Client

MySQL /

Start MySQL Client on Windows 11

‹ MySQL Add New Column to a table› MySQL Non-Correlated Subquery

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version