This discussion is archived
4 Replies Latest reply: Aug 3, 2013 11:27 PM by 979801 RSS

Check Constraint

979801 Newbie
Currently Being Moderated

Hello experts,

                     I am new in oracle using sql developer in windows 7.I have a problem in which I have to  make two tables first:

Tbl_State(S_Id,S_Name,Country_Id)

and

tbl_City(C_Id,,C_Name,State_Id)

.

I have  to add a constraint to table tbl_city so that it could accept values for State_Id column only which are exist in S_Id column in tbl_state.For this I have tried to add a sub query in check constraint to mach the values from tbl_state.S_Id but I think Oracle sql does not allow sub query in check constraint.Give me suggestion  that how can  I solve this Problem.

thnak You

regrads

aditya

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points