About 155,000 results
Open links in new tab
  1. SQL | Subquery - GeeksforGeeks

    Apr 14, 2025 · In this article, we will explain the concept of SQL subqueries, exploring their syntax, use cases, and how they can be applied effectively. We’ll provide detailed examples and outputs to ensure we fully understand how to use subqueries to simplify complex operations.

  2. SQL Subquery - SQL Tutorial

    In this tutorial, you'll learn about SQL subquery, a query nested within another query, to form flexible queries.

  3. SQL Subqueries - w3resource

    Feb 13, 2025 · What is subquery in SQL? A subquery is a SQL query nested inside a larger query. A subquery can be located in: - A SELECT clause - A FROM clause - A WHERE clause - A HAVING clause; The subquery can be nested inside a SELECT, INSERT, UPDATE, or DELETE statement or inside another subquery.

  4. SQL Server SUBQUERY with Examples - SQL Server Tutorial

    What is SUBQUERY in SQL Server? A SUBQUERY is a SQL query within a SQL statement. A subquery can be part of a SELECT, INSERT, UPDATE or DELETE statement and is itself always a SELECT query. It is also possible for a subquery to have another subquery within it.

  5. How to Use the SQL Subquery: A Detailed Guide | Codecademy

    Mar 25, 2025 · Using the SQL subquery with the SELECT statement. The SELECT statement in SQL allows us to retrieve data from a database. We can use the SQL subquery with the SELECT statement to perform operations in SQL. Consider a table employees containing the given data: employee_id name department_id salary; 1: Alice: 101: 60000: 2: Bob: 102: 55000: 3 ...

  6. SQL Subquery (With Examples) - Programiz

    In a subquery, the outer query's result depends on the result set of the inner subquery. That's why subqueries are also called nested queries. Here is how this code works: Suppose we want the details of customers who have placed an order. We can achieve that by using a subquery. FROM Customers . WHERE customer_id IN ( SELECT customer_id.

  7. SQL Subquery: A Comprehensive Guide - DataCamp

    Jan 16, 2025 · SQL subqueries are a powerful tool in database management, allowing for more complex and efficient data retrieval. This guide will walk you through the fundamentals of SQL subqueries, offering insights into their practical applications and advanced techniques.

  8. Subquery - SQL Tutorial

    Subqueries are enclosed within parentheses and can be used in various SQL statements such as SELECT, INSERT, UPDATE, and DELETE. Subqueries are used to retrieve data from one or more tables to be used as a condition in the main query.

  9. The Ultimate Guide To SQL Server Subquery - SQL Server Tutorial

    Summary: in this tutorial, you will learn about the SQL Server subquery and how to use the subquery for querying data. A subquery is a query nested inside another statement such as SELECT, INSERT, UPDATE, or DELETE. Let’s see the following example. Consider the orders and customers tables from the sample database.

  10. SQL Subqueries - Online Tutorials Library

    Subqueries are most frequently used with the SELECT statement. The basic syntax is as follows −. In the following query, we are creating a table named CUSTOMERS −. ID INT NOT NULL, . NAME VARCHAR(20) NOT NULL, . AGE INT NOT NULL, . ADDRESS CHAR (25), . SALARY DECIMAL (18, 2), PRIMARY KEY (ID) );

Refresh