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 6692355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:51:31+00:00 2026-05-26T05:51:31+00:00

Example scenario. In a flight schedule system, there are a pilot table which refers

  • 0

Example scenario.

In a flight schedule system, there are a pilot table which refers to a plane_type table indicating the planes the pilot is able to fly (assuming that is a many-to-one relation).

There are also a plane table and it refers to the plane_type table to indicate the plane’s type
(also many-to-one relation).

Now there is an associative table flight_plan which assigns a pilot to a plane for a given flight.

How do I make sure the pilot‘s qualification do match the plane‘s type for this flight?

Any possibility to implement this as a constraint in a database design? Thank you.

Edited:

Refering to the diagram below, how to make sure pilot.plane_type is equal to plane.plane_type?

enter image description here

  • 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-26T05:51:31+00:00Added an answer on May 26, 2026 at 5:51 am

    Plane has unique index (AK) on PlaneID, PlaneTypeID

    enter image description here

    EDIT

    create table Pilot (PilotID integer);
    alter table Pilot add constraint PK_Pilot primary key (PilotID);
    
    create table PlaneType (PlaneTypeID integer);
    alter table PlaneType add constraint PK_PlaneType primary key (PlaneTypeID);
    
    create table PilotQualification (PilotID integer, PlaneTypeID integer);
    alter table PilotQualification 
      add constraint  PK_PilotQual primary key (PilotID, PlaneTypeID)
    , add constraint FK1_PilotQual foreign key (PilotID)     references Pilot(PilotID)
    , add constraint FK2_PilotQual foreign key (PlaneTypeID) references PlaneType(PlaneTypeID) ;
    
    create table Plane (PlaneID integer, PlaneTypeID integer);
    alter table Plane
      add constraint  PK_Plane primary key (PlaneID)
    , add constraint FK1_Plane foreign key (PlaneTypeID) references PlaneType(PlaneTypeID) ;
    create unique index AK_Plane on Plane (PlaneID, PlaneTypeID) ;
    
    create table PlanePilot (PlaneID integer, PlaneTypeID integer, PilotID integer) ;
    alter table PlanePilot
      add constraint  PK_PlanePilot primary key (PlaneID, PlaneTypeID, PilotID)
    , add constraint FK1_PlanePilot foreign key (PilotID, PlaneTypeID) references PilotQualification(PilotID, PlaneTypeID)
    , add constraint FK2_PlanePilot foreign key (PlaneID, PlaneTypeID) references Plane(PlaneID, PlaneTypeID)
    , add constraint FK3_PlanePilot foreign key (PilotID) references Pilot(PilotID) ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so here's an example scenario. There is a student resource resources :students ,
example scenario is: from login screen - main screen - then when i clicked
Example scenario in an ASP.NET application using SQL Server membership provider : 1) a
I am trying to create a generic formatter/parser combination. Example scenario: I have a
Common scenario: I have a library that uses other libraries. For example, a math
I'm looking for example of how I would solve the scenario below: Imagine my
Here is my scenario. For the example lets say that I need to return
Having some trouble with what should be a very simple scenario. For example purposes,
Sorry for the unclear title, an example will clear things up: TABLE: Scenario_victories ID
Here is a simple example scenario - A 'Tag' has many 'Questions'. When I

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.