vtcbca / internal-exam-iameet301

23bca-python-sqlite-internal-exam-303-PYTHON-EXAM created by GitHub Classroom
0 stars 0 forks source link

how to create trigger #3

Open iameet301 opened 2 months ago

iameet301 commented 2 months ago

Create table team(tid, country, totalmatch, win,loss). Insert 8 team detail. Create trigger to verify totalmatch is not 0. export data into csv file. Read file using reader object and print record with winning %age.

iameet301 commented 2 months ago

Screenshot (1)

23bca300 commented 2 months ago

Screenshot (1)

here you write a table name instead of trigger name . And also you using select case statement that is not necssary here.

23BCA305 commented 2 months ago

why you write match is not

in trigger

23bca274 commented 2 months ago

You can create trigger with the help of following syntax :

CREATE TRIGGER trigger_name AFTER | BEFORE INSERT | UPDATE | DELETE ON table_name FOR EACH ROW BEGIN -- Trigger logic here END;

@iameet301