Documente Academic
Documente Profesional
Documente Cultură
-------------------
B A Z E D E D A T E
o Creare baza de date
use nume_baza_de_date;
T A B E L E - C R E A R E, S T E R G E R E, R E L
A T I I
o Creare tabel
Tipuri de date:
- intreg int unsigned
- real double
- data date , time, datetime
- sir caractere varchar
o Stergere tabel
o Redenumire tabel
1->M
alter table nume_tabel_M
add constraint fk_nume
foreign key fk_nume (nume_camp_tabel_M)
references nume_tabel_1 (nume_camp_tabel_1)
on delete restrict
on update restrict;
T A B E L E - P O P U L A R E, M O D I F I C A R E
o Inserare
o Modificare
o Stergere
T A B E L E - I N T E R O G A R E
o Interogare
select [*]nume_camp1[,nume_camp2,nume_camp3,...][,sum(camp1+camp2+...) as
nume_camp_nou][,count(...) as nume_camp_nou]
from nume_tabel
join nume_tabel_2 on nume_tabel_2.camp1=nume_tabel.camp
[join nume_tabel_3 on nume_tabel_3.camp1=nume_tabel2.camp2]
where [not] conditie [<,>,=, like '%text%']
group by nume_camp [, nume_camp2]
order by nume_camp [asc][desc][, nume_camp2]