I have a table named problem. It has a column name type. I want to limit the user by allowing him to enter only six values. When I write my code, it says that my query has been successfully added by it still isn't working. I can still add values outside my constraints.
My code has been given below.
alter table problem
add constraint chk_type check (type in (
'adhoc', 'mathematics', 'graph_theory', 'data_structure',
'dynamic_programming', 'computational_geometry'
));