Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- B1
- CREATE TABLE BACALAUREAT (
- cnp VARCHAR(13),
- nume VARCHAR(50),
- nota1 DECIMAL(5 , 2 ),
- nota2 DECIMAL(5 , 2 ),
- nota3 DECIMAL(5 , 2 ),
- medie DECIMAL(5 , 2 ),
- an_examen INT,
- data_nastere DATE
- );
- insert into BACALAUREAT values("12341234", "1", 1, 2, 1, 123, 22-12-2002);
- insert into BACALAUREAT values('2234567890123', 'Floricica Dansatoarea2', 2, 5, 3, 123, 22-11-2002);
- insert into BACALAUREAT values('3234567890123', 'Floricica Dansatoarea3', 3, 6, 5, 123, 22-10-2002);
- insert into BACALAUREAT values('4234567890123', 'Floricica Dansatoarea4', 4, 7, 7, 123, 22-9-2002);
- insert into BACALAUREAT values('5234567890123', 'Floricica Dansatoarea5', 5, 8, 9, 123, 22-8-2002);
- insert into BACALAUREAT values('6234567890123', 'Floricica Dansatoarea6', 6, 9, 8, 123, 23-12-2002);
- insert into BACALAUREAT values('7234567890123', 'Floricica Dansatoarea7', 7, 10, 2, 123, 25-12-2002);
- select nume from BACALAUREAT order by (nota1 = 10 OR nota2 = 10 OR nota3 = 10);
- update BACALAUREAT
- set medie = (nota1 + nota2 + nota3) / 3;
- select max(medie) from BACALAUREAT;
- B3
- CREATE TABLE BACALAUREAT (
- cnp VARCHAR(13),
- nume VARCHAR(50),
- nota1 DECIMAL(5 , 2 ),
- nota2 DECIMAL(5 , 2 ),
- nota3 DECIMAL(5 , 2 ),
- medie DECIMAL(5 , 2 ),
- an_examen INT,
- data_nastere DATE
- );
- insert into BACALAUREAT values("12341234", "1", 1, 2, 1, 123, 22-12-2002);
- insert into BACALAUREAT values('2234567890123', 'Floricica Dansatoarea2', 2, 5, 3, 123, 22-11-2002);
- insert into BACALAUREAT values('3234567890123', 'Floricica Dansatoarea3', 3, 6, 5, 123, 22-10-2002);
- insert into BACALAUREAT values('4234567890123', 'Floricica Dansatoarea4', 4, 7, 7, 123, 22-9-2002);
- insert into BACALAUREAT values('5234567890123', 'Floricica Dansatoarea5', 5, 8, 9, 123, 22-8-2002);
- insert into BACALAUREAT values('6234567890123', 'Floricica Dansatoarea6', 6, 9, 8, 123, 23-12-2002);
- insert into BACALAUREAT values('7234567890123', 'Floricica Dansatoarea7', 7, 10, 2, 123, 25-12-2002);
- select nume from BACALAUREAT order by (nota1 = 10 OR nota2 = 10 OR nota3 = 10);
- update BACALAUREAT
- set medie = (nota1 + nota2 + nota3) / 3;
- select nume from BACALAUREAT where (medie >= 5 AND medie <= 8);
- select count(nume) from BACALAUREAT where (nota1 >= 5 AND nota2 >= 5 AND nota3 >= 5 AND medie >= 6);
- delete from BACALAUREAT where (data_nastere <= 15-01-1980);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement