DROP TABLE ETUDIANT2020;
CREATE TABLE ETUDIANT2020(nom varchar2(100), age number);
INSERT INTO ETUDIANT2020 VALUES('Alice', 12);
INSERT INTO ETUDIANT2020 VALUES('Bob', 15);
INSERT INTO ETUDIANT2020 VALUES('Charlie', 18);
INSERT INTO ETUDIANT2020 VALUES('Dave', 21);
INSERT INTO ETUDIANT2020 VALUES('Eve', 11);

DROP TABLE tligne;
CREATE TABLE tligne(DESCRIPTION VARCHAR2(300));


SET echo off;
SET verify off;
SET feedback off;

DECLARE
Dnbmineur number;
MINEUR EXCEPTION;

BEGIN
SELECT count(*) into Dnbmineur 
FROM ETUDIANT2020 
WHERE  AGE < 18;

IF (Dnbmineur > 0) THEN RAISE MINEUR;
END IF;

EXCEPTION 
WHEN MINEUR THEN
INSERT INTO tligne VALUES(Dnbmineur); 

END;
.
/

SET echo on;
SET verify on;
SET feedback on;

SELECT * FROM TLIGNE;
