Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5945287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:39:36+00:00 2026-05-22T16:39:36+00:00

From this site: Tables: CREATE TABLE PilotSkills (pilot_name CHAR(15) NOT NULL, plane_name CHAR(15) NOT

  • 0

From this site:

Tables:

CREATE TABLE PilotSkills
(pilot_name CHAR(15) NOT NULL,
plane_name CHAR(15) NOT NULL,
PRIMARY KEY (pilot_name, plane_name));

CREATE TABLE Hangar
(plane_name CHAR(15) NOT NULL PRIMARY KEY);

Query:

SELECT DISTINCT pilot_name
  FROM PilotSkills AS PS1
  WHERE NOT EXISTS
       (SELECT *
          FROM Hangar
         WHERE NOT EXISTS
               (SELECT *
                  FROM PilotSkills AS PS2
                 WHERE (PS1.pilot_name = PS2.pilot_name)
                   AND (PS2.plane_name = Hangar.plane_name)));

I understand the problem it’s used for (set division), including the analogy that describes it as “There ain’t no planes in this hangar that I can’t fly!”. What I don’t understand is exactly what’s at work here, and how it comes together to do what it says its doing.

Having trouble stating with specifics my difficulty at the moment…


Edit: Let me just first ask what something like this does, exactly:

SELECT DISTINCT pilot_name
  FROM PilotSkills
  WHERE NOT EXISTS
       (SELECT *
          FROM Hangar)

I think I’m missing some fundamental understanding here…

Edit: Irrelevant, and it wouldn’t be a meaningful without the third nested SELECT, right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:39:37+00:00Added an answer on May 22, 2026 at 4:39 pm

    What we want is a distinct list of pilots that can fly every plane in the hanger. For that to be true, for a given pilot, there cannot exist a plane they cannot fly. So, we want to get a list of all planes for each pilot and see if there is one they cannot fly. If there is one (the pilot cannot fly) we remove them from the list. Whomever is left, can fly all planes in the hanger.

    Said more formally, find a distinct list of pilot names such that for a given pilot, there does not exist a plane in the set of planes (Hanger) such that the plane does not exist in the set of the given pilot’s skills.

    “find a distinct list of pilot
    names…”

    Select Distinct pilot_name
    From PilotSkills As PS1
    ...
    

    “…such that for a given pilot, there
    does not exist a plane in the set of
    planes (Hanger)…”

    Select Distinct pilot_name
    From PilotSkills As PS1
    Where Not Exists    (
                        Select 1
                        From Hanger
    

    “…such that the plane does not exist
    in the set of the given pilot’s
    skills.”

    Select Distinct pilot_name
    From PilotSkills As PS1
    Where Not Exists    (
                        Select 1
                        From Hanger As H
                        Where Not Exists    (
                                            Select 1
                                            From PilotSkills As PS2
                                            Where PS2.pilot_name = PS1.pilot_name
                                                And PS2.plane_name = H.plane_name
                                            )
                        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

table: CREATE TABLE `deal` ( `id` int(11) NOT NULL default '0', `site` int(11) NOT
Given the following very simple table: Create Table tblUserLogins ( LoginNumber int PRIMARY KEY
I plan to create a YQL open table for a site which does not
From this site: http://www.toymaker.info/Games/html/vertex_shaders.html We have the following code snippet: // transformations provided by
I am using Eclipse to program in Java. I tried installing from this site
From browsing on this site and elsewhere, I've learned that serving websites as XHTML
I've got a couple django models that look like this: from django.contrib.sites.models import Site
I have a site with a SELECT statement like this: SELECT * FROM MyTable
This is an example code from the prototype site. var url = '/proxy?url=' +
Got this code for a viewscroller from the apple developers site. @synthesize scrollView1, scrollView2;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.