Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Story
How we grew from 0 to 3 million users
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

How to Use EXISTS and NOT EXISTS in SQL Queries

386.3K views
•
September 25, 2018
by
Gate Smashers
YouTube video player
How to Use EXISTS and NOT EXISTS in SQL Queries

TL;DR

To use EXISTS and NOT EXISTS in SQL, they allow you to check for the presence of rows in a correlated nested query. EXISTS returns true if a corresponding row exists in the inner query for each row of the outer query, while NOT EXISTS returns true if no corresponding row exists. This helps filter results based on relationships between tables.

Transcript

Hello friends! Welcome to Gate Smashers So the topic is Exist and Not Exists In SQL Exist and Not Exist These keywords we use in correlated nested query We correlated nested query In this we use these both keywords Exist and Not Exist Why do we use? Because, I have already explained nested queries Over there what did we talk? That what is nested... Read More

Key Insights

  • 🤨 Exist and Not Exist keywords are used in correlated nested queries to check for the existence of a row in the inner table corresponding to the outer row.
  • 💨 Exist and Not Exist keywords execute in a different way compared to the In and Not In keywords.
  • ↩️ Exist and Not Exist keywords return true or false based on the existence of a row in the inner table.
  • 👻 Correlated nested queries allow us to join the outer and inner queries using keywords like Exist and Not Exist.
  • 🤨 Exist and Not Exist keywords work with a top-down approach, checking each row of the outer query against the inner table.
  • 🤨 The output of Exist and Not Exist keywords determines if the corresponding row from the outer query is included in the final result.
  • ⚾ Exist and Not Exist keywords are useful when we want to filter the results of a query based on the existence of related data in another table.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What are Exist and Not Exist keywords used for in SQL?

Exist and Not Exist keywords are used to relate the outer and inner queries in correlated nested queries, allowing us to check if a row exists in the inner table corresponding to the outer row.

Q: How does Exist and Not Exist execution differ from In and Not In keywords in SQL?

Exist and Not Exist keywords execute in a top-down approach, checking each row of the outer query and comparing it with the inner table. In contrast, In and Not In keywords compare the output of the inner query with the outer query as a whole.

Q: How do we use Exist keyword in a correlated nested query?

To use Exist keyword, we select * from the outer table and include the condition "Where [OuterTable].[Column] Exist(select [Column] from [InnerTable] where [OuterTable].[Column]=[InnerTable].[Column])".

Q: How do we use Not Exist keyword in a correlated nested query?

To use Not Exist keyword, we select * from the outer table and include the condition "Where [OuterTable].[Column] Not Exist(select [Column] from [InnerTable] where [OuterTable].[Column]=[InnerTable].[Column])".

Summary & Key Takeaways

  • Exist and Not Exist keywords are used in correlated nested queries to relate the outer and inner queries in SQL.

  • Exist and Not Exist keywords execute in a different way compared to the In and Not In keywords.

  • Exist and Not Exist keywords return true or false based on whether a row exists in the inner table corresponding to the outer row.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from Gate Smashers 📚

L-4.5: Deadlock Avoidance Banker's Algorithm with Example |With English Subtitles thumbnail
L-4.5: Deadlock Avoidance Banker's Algorithm with Example |With English Subtitles
Gate Smashers
Supervised, Unsupervised and Reinforcement Learning in Artificial Intelligence in Hindi thumbnail
Supervised, Unsupervised and Reinforcement Learning in Artificial Intelligence in Hindi
Gate Smashers
Lec-2: Introduction to DBMS (Database Management System) With Real life examples | What is DBMS thumbnail
Lec-2: Introduction to DBMS (Database Management System) With Real life examples | What is DBMS
Gate Smashers
Lec-7: Manchester encoding and differential Manchester encoding in Hindi | Computer Network thumbnail
Lec-7: Manchester encoding and differential Manchester encoding in Hindi | Computer Network
Gate Smashers
Lec-111: Primary Index With Example | GATE, PSU and UGC NET | DBMS thumbnail
Lec-111: Primary Index With Example | GATE, PSU and UGC NET | DBMS
Gate Smashers
Lec-3: Introduction to Cloud 🌧️ Computing with Real Life Examples | Key Characteristics & Benefits thumbnail
Lec-3: Introduction to Cloud 🌧️ Computing with Real Life Examples | Key Characteristics & Benefits
Gate Smashers

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots
  • Open Graph Checker

Company

  • About us
  • Our Story
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.