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

  • SEARCH
  • Home
  • 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 6917945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:47:46+00:00 2026-05-27T09:47:46+00:00

CREATE TABLE chartered flight(flight_no NUMBER(4) PRIMARY KEY , customer_id NUMBER(6) REFERENCES customer(customer_id) , aircraft_no

  • 0
CREATE TABLE chartered flight(flight_no NUMBER(4) PRIMARY KEY
, customer_id NUMBER(6) REFERENCES customer(customer_id)
, aircraft_no NUMBER(4) REFERENCES aircraft(aircraft_no)
, flight_type VARCHAR2 (12)
, flight_date DATE NOT NULL
, flight_time INTERVAL DAY TO SECOND NOT NULL
, takeoff_at CHAR (3) NOT NULL
, destination CHAR (3) NOT NULL)

Should I not use CHAR data type?

I hear it is bad practice to use it but I wanted to make it so takeoff_at and destination have to have minimum 3 characters because they are airport codes.

This is the error I am getting:

Error at Command Line:1 Column:23
Error report:
SQL Error: ORA-00922: missing or invalid option
00922. 00000 -  "missing or invalid option"
*Cause:    
*Action:
  • 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-27T09:47:47+00:00Added an answer on May 27, 2026 at 9:47 am

    The error you’re getting appears to be the result of the fact that there is no underscore between “chartered” and “flight” in the table name. I assume you want something like this where the name of the table is chartered_flight.

    CREATE TABLE chartered_flight(flight_no NUMBER(4) PRIMARY KEY
    , customer_id NUMBER(6) REFERENCES customer(customer_id)
    , aircraft_no NUMBER(4) REFERENCES aircraft(aircraft_no)
    , flight_type VARCHAR2 (12)
    , flight_date DATE NOT NULL
    , flight_time INTERVAL DAY TO SECOND NOT NULL
    , takeoff_at CHAR (3) NOT NULL
    , destination CHAR (3) NOT NULL)
    

    Generally, there is no benefit to declaring a column as CHAR(3) rather than VARCHAR2(3). Declaring a column as CHAR(3) doesn’t force there to be three characters of (useful) data. It just tells Oracle to space-pad data with fewer than three characters to three characters. That is unlikely to be helpful if someone inadvertently enters an incorrect code. Potentially, you could declare the column as VARCHAR2(3) and then add a CHECK constraint that LENGTH(takeoff_at) = 3.

    CREATE TABLE chartered_flight(flight_no NUMBER(4) PRIMARY KEY
    , customer_id NUMBER(6) REFERENCES customer(customer_id)
    , aircraft_no NUMBER(4) REFERENCES aircraft(aircraft_no)
    , flight_type VARCHAR2 (12)
    , flight_date DATE NOT NULL
    , flight_time INTERVAL DAY TO SECOND NOT NULL
    , takeoff_at CHAR (3) NOT NULL CHECK( length( takeoff_at ) = 3 )
    , destination CHAR (3) NOT NULL CHECK( length( destination ) = 3 )
    )
    

    Since both takeoff_at and destination are airport codes, you really ought to have a separate table of valid airport codes and define foreign key constraints between the chartered_flight table and this new airport_code table. That ensures that only valid airport codes are added and makes it much easier in the future if an airport code changes.

    And from a naming convention standpoint, since both takeoff_at and destination are airport codes, I would suggest that the names be complementary and indicate that fact. Something like departure_airport_code and arrival_airport_code, for example, would be much more meaningful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

CREATE TABLE Customer( customer_id INT NOT NULL, first_name VARCHAR(20), last_name VARCHAR(20), PRIMARY KEY (customer_id)
create table ImagenesUsuario { idImagen int primary key not null IDENTITY } This doesn't
create table snippet( id int not null auto_increment, primary key(id), idlanguage int not null,
CREATE TABLE Posts { id INT PRIMARY KEY AUTO_INCREMENT, title VARCHAR(200), url VARCHAR(200) }
CREATE TABLE SupplierQuote ( supplierQuoteID int identity (3504,2) CONSTRAINT supquoteid_pk PRIMARY KEY, PONumber int
create table [User] ( UserId int primary key identity(1,1), FirstName nvarchar(256) not null, LastName
Create table FavoriteDish ( FavID int identity (1,1) primary key not null, DishID int
Create Table A ( ID varchar(8), Primary Key(ID) ); Create Table B ( ID
CREATE TABLE jokecategory ( jokeid INT NOT NULL, categoryid INT NOT NULL, PRIMARY KEY
CREATE TABLE DEPARTMENTS (Department_Id varchar(5) Primary Key NOT NULL, Department_Name char(20) NOT NULL, Manager_Id

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.