I'm, new to SQL. I have created few tables:
CREATE TABLE MAINTINANCE
(Maint_mname char(10),
Maint_date date,
Maint_duedate date NOT NULL,
Maint_mdesc char (15));
CREATE TABLE DESIGNERR
(Dez_emp_number varchar(11),
Dez_field char(12),
Dez_qualification char(10) NOT NULL,
Dez_experience smallint);
For the first table I am adding the following constraint:
ALTER TABLE MAINTINANCE ADD CONSTRAINT CHK_maintdate CHECK(Maint_date<MAint_duedate);
but I am getting the error invalid ALTER TABLE option
. Could you please let me know why this is appearing? The same is working for a friend but not for me.
For the second table I have to write a SQL command for the business rule:
If the Qualification of a Designer is BS then a Minimum of 4 years Experience is required. But, if the Qualification of the Designer is MS then a Minimum of 2 years Experience is sufficient.
How can we define this business rule in SQL?