Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130

    Unanswered: composite constraint

    how to use check constraint give one example
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    CREATE TABLE users
    ( username VARCHAR(50) NOT NULL PRIMARY KEY
    , userIQ INTEGER NOT NULL
    , CONSTRAINT smart_users_only CHECK (userIQ >= 110 )
    )
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130
    thanks can you explain in words plz
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    sure, i can explain in words

    the CHECK constraint on that table will ensure that any row inserted into the table will have a value of the userIQ column that is equal to or greater than 110
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jul 2010
    Location
    ISHHHH
    Posts
    130
    tnks again its a nice explanation
    WiTh Tnks & ReGaRdS
    mAtHuKuMaLi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •