0

I am using phpMyAdmin tool to construct a database. I have created a table : Vehicles. Whenever I try to put some condition on any of the fields it does not work. e.g. I try to put a restriction on the Age field so that Age >10. E.g.

ALTER TABLE Vehicles
ADD CHECK (Age>10)

But this doesn't work and whenever I enter any value less than ten the record is saved in the table

embert
  • 7,336
  • 10
  • 49
  • 78
stud91
  • 1,854
  • 6
  • 31
  • 56
  • `CHECK` is not supported in MySQL – Abdul Manaf Jan 29 '14 at 07:20
  • 2
    @AbdulManaf To be precise: the (correct) *syntax* for a check constraint is supported, it's just silently ignored (like so many things in MySQL) –  Jan 29 '14 at 07:21
  • as @AbdulManaf says `CHECK`is not supported, you should read this: [Simulate CHECK on mysql](http://stackoverflow.com/questions/9575604/want-to-restrict-the-value-of-a-mysql-field-to-specific-range-decimal-values) – Melon Jan 29 '14 at 07:21

0 Answers0