1CREATE TABLE employee(emp_id SERIAL PRIMARY KEY, name VARCHAR(30),
2 sector_fk INT NOT NULL);
3
4CREATE TABLE process(emp_id SERIAL PRIMARY KEY, sector VARCHAR(20));
5
6ALTER TABLE employee ADD FOREIGN KEY (sector_fk)
7REFERENCES company(emp_id) ON DELETE CASCADE;
8
9-- Deletes cascade employees referencing deleted companies
10DELETE FROM company WHERE sector='industry';