Limiting the input to a field as some pattern i have a table student having field admission no. i want to restrict its input to the pattern '-/----/--'. If the input does not match this format then it should show an error. I tried doing this using LIKE constraint but the table was accepting all the values matching the pattern or not.....
please help
This is what you're after:

delimiter $
create trigger student_validate before insert on student
for each row
begin
    if new.admission not rlike '^[0-9][/][0-9][0-9][0-9][0-9][/][0-9][0-9]$'
    then
        signal sqlstate '45000' set message_text = 'Bad Format Admission Number';
    end if;
end$
delimiter ;