Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- insert into studenti ( nr_matricol, nume) values ( 201,'Gigi');
- /
- update studenti set an = 3
- where nr_matricol = 201;
- /
- delete from note where nr_matricol = 200;
- /
- delete from studenti where nr_matricol =200;
- /
- select distinct bursa from studenti;
- /
- select nume || ', ' || prenume || ', ' || an as "Studenti pe an" from studenti order by an;
- /
- select nume,prenume from studenti where data_nastere between to_date('01/01/1995','dd/mm/yyyy') and to_date('10/06/1997','dd/mm/yyyy');
- /
- select nume,prenume,an from studenti where extract(year from data_nastere) = '1995';
- /
- select * from studenti where bursa is null;
- /
- select * from studenti where prenume like '%a%a%';
- /
- create table str_neretantieri
- ( nr_matricol varchar2(10),
- id_curs varchar2(10),
- valoare number(2) not null,
- primary key (nr_matricol, id_curs),
- constraint ck_valaore check (valoare between 5 and 10));
- /
- insert into STR_NERETANTIERI values (444,21,6);
- /
- drop table str_neretantieri;
- /
- select current_date as "Astazi" from dual;
- select nume , data_nastere, MONTHS_BETWEEN(current_date,data_nastere) from studenti ;
- /
- SELECT GREATEST('Mihai','Andrei','Anca') "GREATEST" FROM DUAL;
- /
- -- 6
- select 'b' || upper(substr(nume,1)), length(trim(nume)) from profesori where nume like 'B%';
- /
- --8
- select nume, prenume, to_char(data_nastere,'MON') as "MONTH" from studenti where bursa is not null;
- /
- --9
- select nume, bursa, decode(bursa, '450', 'primul' , 350,'premiul 2' , 250, 'premiul 3', null , 'mentiune') as "premiu" from studenti;
- --10
- select replace(replace(replace(nume,'i','a'), 'a','i'), 'i', 'a') from studenti;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement