Hey there! Sign in to join this conversationNew here? Join for free to post

SQL - CHECK keyword help please

University Navigation

Announcements Posted on
Why bother with a post grad? Are they even worth it? Have your say! 26-10-2016
    • Thread Starter

    Name:  users table (6), after,,, CHECK got entered in.PNG
Views: 45
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

    Is this mySQL? I believe check constraints are ignored in mySQL (and most storage engines). Try use a trigger instead.

    @mashbbk is correct: http://stackoverflow.com/questions/2...is-not-working
Write a reply…


Submit reply


Thanks for posting! You just need to create an account in order to submit the post
  1. this can't be left blank
    that username has been taken, please choose another Forgotten your password?
  2. this can't be left blank
    this email is already registered. Forgotten your password?
  3. this can't be left blank

    6 characters or longer with both numbers and letters is safer

  4. this can't be left empty
    your full birthday is required
  1. Oops, you need to agree to our Ts&Cs to register
  2. Slide to join now Processing…

Updated: July 5, 2016
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Cats: Yay or nay?
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

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

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