Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    2
    ReputationRep:
    Name:  users table (6), after,,, CHECK got entered in.PNG
Views: 64
Size:  87.1 KB

    Don't really get what I'm doing wrong there. Just don't get how to actually use the CHECK constraint keyword, how to actually deploy it in use in the SQL query I write.

    The way I wrote it in the PIC seems wrong - it's clear that after I performed the INSERT INTO query to get those 2 records added into the table, with IDs 4 and 7, only the latter should've been REALLY entered onto the table, as the former had ID as 4 which fails to be more than 5 clearly

    BIG THANKS for any help
    Offline

    16
    ReputationRep:
    Is this mySQL? I believe check constraints are ignored in mySQL (and most storage engines). Try use a trigger instead.
    • TSR Group Staff
    Offline

    10
    ReputationRep:
    TSR Group Staff
    @mashbbk is correct: http://stackoverflow.com/questions/2...is-not-working
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    What's your favourite Christmas sweets?
    Useful resources

    Featured recruiter profiles:

    CGI logo

    CGI is open for applications

    "Offering a range of apprentice and sponsored degree positions."

    Quick link:

    Unanswered IT and technology threads

    Groups associated with this forum:

    View associated groups
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Quick reply
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.