A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
2 typos
source | link

Does this trigger make sencesense? SQL

Ive done upI've written a trigger for my database which is supposed to conduct the following business rule: So if a customer doesn't have a valid driving licence, they are not allowed to rent a car, But they. They are allowed to come back with a valid one (obviously). 

Does this make sencesense? I have a Columncolumn called status, but the receptionist will have to fill out the status anyway? Also, would you recommend doing a trigger for age separately? Thanks.

DELIMITER //

CREATE TRIGGER check_licence
AFTER UPDATE ON customers
FOR EACH ROW
BEGIN 
DECLARE Status ENUM('Approved','Unapproved');
IF NEW.valid_licence = 'Yes' THEN
SET Status='Approved';
ELSE 
SET Status='Unapproved';
END IF;
END //

DELIMITER ;

Does this trigger make sence? SQL

Ive done up a trigger for my database which is supposed to conduct the following business rule: So if a customer doesn't have a valid driving licence, they are not allowed to rent a car, But they are allowed to come back with a valid one (obviously). Does this make sence? I have a Column called status, but the receptionist will have to fill out the status anyway? Also, would you recommend doing a trigger for age separately? Thanks.

DELIMITER //

CREATE TRIGGER check_licence
AFTER UPDATE ON customers
FOR EACH ROW
BEGIN 
DECLARE Status ENUM('Approved','Unapproved');
IF NEW.valid_licence = 'Yes' THEN
SET Status='Approved';
ELSE 
SET Status='Unapproved';
END IF;
END //

DELIMITER ;

Does this trigger make sense?

I've written a trigger for my database which is supposed to conduct the following business rule: if a customer doesn't have a valid driving licence, they are not allowed to rent a car. They are allowed to come back with a valid one (obviously). 

Does this make sense? I have a column called status, but the receptionist will have to fill out the status anyway? Also, would you recommend doing a trigger for age separately? Thanks.

DELIMITER //

CREATE TRIGGER check_licence
AFTER UPDATE ON customers
FOR EACH ROW
BEGIN 
DECLARE Status ENUM('Approved','Unapproved');
IF NEW.valid_licence = 'Yes' THEN
SET Status='Approved';
ELSE 
SET Status='Unapproved';
END IF;
END //

DELIMITER ;
1
source | link

Does this trigger make sence? SQL

Ive done up a trigger for my database which is supposed to conduct the following business rule: So if a customer doesn't have a valid driving licence, they are not allowed to rent a car, But they are allowed to come back with a valid one (obviously). Does this make sence? I have a Column called status, but the receptionist will have to fill out the status anyway? Also, would you recommend doing a trigger for age separately? Thanks.

DELIMITER //

CREATE TRIGGER check_licence
AFTER UPDATE ON customers
FOR EACH ROW
BEGIN 
DECLARE Status ENUM('Approved','Unapproved');
IF NEW.valid_licence = 'Yes' THEN
SET Status='Approved';
ELSE 
SET Status='Unapproved';
END IF;
END //

DELIMITER ;