I am new to MySql, I am trying to create a table which will store scores ranging from 0 to 5. I keep reading about the constraint CHECK but it fails, it allows me to input numbers greater than 5.
Here is a sample of my script
create table part2(
P2_Q1 int(1)
check (P2_Q1 >= 0 and P2_Q1 < 6), //this is one way I've read
P2_Q2 int(1)
check (P2_Q2 >= 0 and P2_Q2 < 6),
P2_Q3 int(1)
check (P2_Q3 between 0 and 5), //and this is the other way
P2_Q4 int(1)
check (P2_Q4 between 0 and 5)
);
Thanks ahead of time for any help I can get!