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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:20:24+00:00 2026-05-25T00:20:24+00:00

create database Exer4 use Exer4 create table customer ( cus_code int, constraint PK_customer primary

  • 0
create database Exer4

use Exer4

create table customer ( 
    cus_code int,
    constraint PK_customer primary key (cus_code),
    cus_Lname varchar(20),
    cus_Fname varchar (30),
    cus_intial varchar (2),
    cus_areacode int,
    cus_phone int,
    cus_balance float
     )

create table charter (
    char_trip int,
    constraint PK_charter primary key (char_trip),
    char_date date,
    ac_number varchar(5),
    foreign key(ac_number) references aircraft,
    char_destination varchar(5),
    char_distance float,
    char_hours_flown float,
    char_hours_wait float,
    char_fuel_gallons float,
    cus_code int,
    foreign key(cus_code) references customer
    )


    create table aircraft(

    ac_number varchar(5),
    constraint PK_aircraft primary key(ac_number),
    mod_code varchar(10),
    foreign key(mod_code) references model,
    ac_itaf varchar(10),
    ac_tiel varchar(10),
    ac_tier varchar(10),
    )

    create table model(
    mod_code int,
    constraint PK_model primary key(mod_code),
    mod_manufacturer varchar(10),
    mod_name varchar(10),
    mod_seats int,
    mod_chg_mile int,
    )

create table crew (
    char_trip int,
    emp_num int,
    constraint PK_crew primary key (char_trip,emp_num),
    foreign key (char_trip) references charter,
    foreign key(emp_num) references employee,
    crew_job varchar(10)
    )


create table rating (
    rtg_code varchar(5),
    rtg_name varchar (30),
    constraint PK_rating primary key (rtg_code)
    )

create table employee (
    emp_num int,

    constraint PK_employee primary key (emp_num),
    emp_title varchar (4),
    emp_lname varchar (20),
    emp_fname varchar (30),
    emp_initial varchar (2),
    emp_dob date,
    emp_hire_date date, 
    )



create table pilot (
    emp_num int,
    pl_license varchar (3),
    pl_ratings varchar (30),
    pl_med_type int,
    pl_med_date date,
    pl_pt135_date date,
    constraint PK_pilot primary key (emp_num)
    )

why is that when i reference to “aircraft” it said invalid table??
what is wrong with my code??

  • 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-25T00:20:25+00:00Added an answer on May 25, 2026 at 12:20 am

    You have to specify which field to reference:

    foreign key (mod_code) references model (mod_code),
    

    The foreign key constraint consists of 2 parts:

    ALTER TABLE aircraft
    ADD CONSTRAINT fk_aircraft_model
    FOREIGN KEY (mod_code)  -- here you specify the field(s) to reference from in the aircraft table
    REFERENCES model (mod_code)  -- here you specify the field(s) to reference to in the model table
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a database table to store different changelog/auditing (when something was
The create database statement is: CREATE TABLE table_name ( column_name1 data_type, column_name2 data_type, column_name3
Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM
I need to create database objects (table, index, keys, views, functions, etc.) through the
How do you create a database from an Entity Data Model. So I created
How would you create a database in Microsoft Access that is searchable only by
How to create a database using T SQL script on a specified location? Let's
I would like to create a database backed interactive AJAX webapp which has a
I am using NHibernate's SchemaExport to create my database schema. I have 1 legacy
Is there an automatic way in SQL Server 2005 to create a database from

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.