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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:13:11+00:00 2026-06-13T23:13:11+00:00

I trying to add this sql check in ALTER TABLE School add Role check_role

  • 0

I trying to add this sql check in

ALTER TABLE School
add Role check_role
  CHECK (check_role IN ('Teaching Assistant', 'Lecturer', 'Professor'));

I get the error below

ERROR at line 3:
ORA-02438: Column check constraint cannot reference other columns

SQL> desc School;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 STAFFNUM                                  NOT NULL VARCHAR2(12)
 NAME                                      NOT NULL VARCHAR2(50)
 ADDRESS                                   NOT NULL VARCHAR2(300)
 DOB                                                DATE

I am trying add a column call Role, with the check constraint check_role

I am using Oracle SQL.

Thanks for all help!

  • 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-06-13T23:13:12+00:00Added an answer on June 13, 2026 at 11:13 pm

    To add Role column to the table

     alter table School
        add (Role   varchar(10));
    

    To Add constraint to the Role column.

    alter table School
      add constraint check_role
      check (Role IN ('Teaching Assistant', 'Lecturer', 'Professor'));
    

    =========

    ALTER TABLE School ADD COLUMN Role VARCHAR(50) 
    CONSTRAINT check_role CHECK 
      (Role IN ('Teaching Assistant', 'Lecturer', 'Professor'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've encountered this problem (while trying to add SQL Server Database (.mdf) file to
I am trying to add a new record to my internal table and this
I am trying to add this query to database and I can't get it
I am trying to add a column into mysql table using this query but
I'm trying to add Modernizr to this page: http://www.alternativeradio.org/pages/test . Modernizr works fine and
I'm trying to add some share this javascript in between the head tags of
I am trying to add some logic in this. But I am not sure
I'm trying to add a value (in this case the string I Added This)
I started by trying to add a .toggle() to this code so that the
I am trying to add a sqlite DB into an application using this: CoreData:

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.