triggers Update and using Xampp and this table:
Hi
triggers Update and using Xampp and this table:
CREATE TABLE MEMBER(
STUDENT_ID CHAR(6) NOT NULL,
CLUB_CODE VARCHAR(4) NOT NULL,
MEMBER_DATE DATE NOT NULL,
MEMBER_POSITION VARCHAR(15) NOT NULL,
MEMBER_ATTENDANCE CHAR(2) NOT NULL,
PRIMARY KEY (STUDENT_ID,CLUB_CODE),
FOREIGN KEY (STUDENT_ID) REFERENCES STUDENT (STUDENT_ID) ON DELETE RESTRICT ON UPDATE CASCADE,
FOREIGN KEY (CLUB_CODE) REFERENCES CLUB (CLUB_CODE) ON DELETE RESTRICT ON UPDATE CASCADE);
INSERT INTO MEMBER VALUES
('100027','C201','2020-03-25','Secretary','12'),
('100027','C202','2020-04-11','Member','11'),
('100032','C201','2020-02-23','President','12'),
('100050','C201','2020-03-25','Member','10'),
('100132','C202','2020-04-11','Treasurer','10'),
('100074','C203','2020-04-09','President','12'),
('100074','C204','2020-04-25','Treasurer','12'),
('100051','C204','2020-04-25','Member','9'),
('100064','C207','2020-04-25','Vice President','11'),
('100064','C206','2020-04-11','President','12'),
('100106','C206','2020-04-11','Treasurer','12'),
('100123','C208','2020-04-25','Member','10'),
('100124','C202','2020-04-11','Member','11'),
('100124','C205','2020-03-29','Treasurer','12'),
('100132','C204','2020-04-25','President','12'),
('100132','C205','2020-03-29','Member','11'),
('100135','C208','2020-04-25','President','12'),
('100356','C203','2020-04-09','Treasurer','12'),
('100356','C207','2020-04-25','Member','12'),
('100706','C206','2020-04-11','Member','12'),
('100706','C205','2020-03-29','Member','11'),
('100301','C202','2020-04-11','Vice President','12'),
('100301','C201','2020-03-25','Member','10'),
('100125','C204','2020-04-25','Vice President','12'),
('100125','C206','2020-04-11','Secretary','12'),
('100009','C203','2020-04-09','Secretary','12'),
('100009','C204','2020-04-25','Member','10'),
('100481','C202','2020-04-11','President','12'),
('100481','C201','2020-03-25','Vice President','12'),
('100481','C206','2020-04-11','Member','9'),
('100012','C205','2020-03-29','President','12'),
('100012','C203','2020-04-09','Member','10'),
('100012','C207','2020-04-25','Member','11'),
('100100','C203','2020-04-09','Vice President','12'),
('100100','C207','2020-04-25','Secretary','12'),
('100234','C205','2020-03-29','Vice President','12'),
('100234','C203','2020-04-09','Member','11'),
('100482','C202','2020-04-11','Secretary','12'),
('100482','C201','2020-03-25','Treasurer','11'),
('100003','C204','2020-04-25','Secretary','12'),
('100003','C208','2020-04-25','Member','10'),
('100976','C207','2020-04-25','President','12'),
('100976','C203','2020-04-09','Member','12'),
('100042','C208','2020-04-25','Member','12'),
('100042','C206','2020-04-11','Vice President','12'),
('100004','C205','2020-03-29','Secretary','12'),
('100004','C207','2020-04-25','Treasurer','11'),
('100004','C204','2020-04-25','Member','10'),
('100342','C208','2020-04-25','Secretary','12'),
('100342','C202','2020-04-11','Member','10'),
('100343','C208','2020-04-25','Vice President','12'),
('100343','C201','2020-03-25','Member','9'),
('100765','C206','2020-04-11','Member','10'),
('100765','C208','2020-04-25','Member','12'),
('100213','C208','2020-04-25','Treasurer','12'),
('100213','C202','2020-04-11','Member','10'),
('100213','C206','2020-04-11','Member','9'),
('100235','C206','2020-04-11','Member','12'),
('100235','C207','2020-04-25','Member','12');
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 11 images