Proiect SGBD - LITA MIHAI

May 23, 2021 | Author: Anonymous | Category: N/A
Share Embed Donate


Short Description

Download Proiect SGBD - LITA MIHAI...

Description

Proiect Baze de date Gestiunea cartilor unei biblioteci I. Descrierea bazei de date Baza de date aferenta temei alese, de a realiza gestiunea cartilor unei biblioteci contine sase tabele cu urmatoarea semnificatie: 1. Tabela MIH_CARTE - contine informatii privind fiecare carte detinuta de catre biblioteca si are urmatoarele campuri : id_carte – codul cartii, cheie primara a tabelei; nume – numele cartii; cod_autor – codul autorului (cheie externa catre nomenclatorul de autori); editura – editura care a tiparit cartea; an_apar – anul in care a aparut cartea; locatie – locul in care se afla cartea la un moment dat (poate fi imprumutata la student ( valoarea student ) sau in biblioteca( valoarea biblioteca )); cod_dom – codul domeniului de care apartine cartea (cheie externa catre nomenclatorul de domenii). 2. Tabela MIH_ARHIVE – tabela de intersectie intre tabela MIH_STUDENTI si MIH_CARTE, contine practic informatii despre fiecare imprumut realizat si are urmatoarele campuri: cod_arhiva – codul imprumutului respectiv, cheie primara; cnp_stud – cnp-ul studentului care a imprumutat cartea (cheie externa catre tabela MIH_STUDENTI); id_carte – codul cartii imprumutate (cheie externa catre tabela MIH_CARTE); data_impr – data la care s-a realizat imprumutul cartii; data_return – data la care cartea trebuie returnata; cnp_bibl – cnp-ul bibliotecarului care a realizat imprumutul (cheie externa catre tabela MIH_BIBLIOTECAR). 3. Tabela MIH_STUDENTI – contine informatii privind datele de identificare ale studentilor care imprumuta carti de la bilblioteca: cnp – cnp-ul studentului, cheie primara; nume – numele studentului; prenume – prenumele studentului; facultatea – facultatea la care invata studentul; nr_tel – numarul de telefon al studentului; e-mail – e-mailul studentului.

4. Tabela MIH_AUTORI – este nomenclator care contine numele autorilor cartilor din biblioteca: cod – codul de identificare al autorilor, cheie primara; nume – numele autorului; prenume – prenumele autorului. 5. Tabela MIH_DOMENII – este nomenclator care contine domeniile cartilor din biblioteca: cod_domeniu – codul de identificare al domeniilor, cheie primara; denumire – numele domeniului. 6. Tabela MIH_BIBLIOTECARI – contine informatii privind datele de identificare ale bibliotecarilor care realizeaza imprumutul cartilor din bilblioteca: cnp – cnp-ul bibliotecarului, cheie primara; nume – numele bibliotecarului; prenume – prenumele bibliotecarului; adresa – adresa bibliotecarului; nr_tel – numarul de telefon al bibliotecarului; e-mail – e-mailul bibliotecarului. II. Schema conceptuala CARTE

ARHIVA

id_carte nume cod_autor editura an_apar locatie cod_dom

cod_arhiva cnp_stud id_carte data_impr data_return cnp_bibl

AUTOR cod nume prenume

DOMENIU cod_domeniu denumire

STUDENT cnp nume prenume facultatea nr_tel e-mail

BIBLIOTECAR cnp nume prenume adresa nr_tel e-mail

CREAREA TABELELOR

BEGIN EXECUTE IMMEDIATE 'create table MIH_BIBLIOTECAR (cnp varchar2(13) constraint pkey_mih_bibliotecar primary key, nume varchar2(15), prenume varchar2(15), adresa varchar2(40), nr_tel varchar2(10), e_mail varchar2(25))'; END;

BEGIN EXECUTE IMMEDIATE 'create table MIH_DOMENIU( cod_domeniu varchar2(5) constraint pk_mih_domeniu primary key, denumire varchar2(25))'; END;

BEGIN EXECUTE IMMEDIATE 'create table MIH_AUTOR( cod varchar2(5)constraint pk_mih_autor primary key, nume varchar2(15), prenume varchar2(15))'; END;

BEGIN EXECUTE IMMEDIATE 'create table MIH_CARTE( id_carte varchar2(5) constraint pk_mih_carte primary key, nume varchar2(15), cod_autor varchar2(5), editura varchar2(25), an_apar varchar2(4), locatie varchar2(10), cod_dom varchar2(5), constraint fk1_mih_carte foreign key (cod_autor) references MIH_AUTOR(cod), constraint fk2_mih_carte foreign key (cod_dom) references MIH_DOMENIU(cod_domeniu))'; END;

BEGIN EXECUTE IMMEDIATE 'create table MIH_STUDENT( cnp varchar2(13) constraint pk_mih_student primary key, nume varchar2(25), prenume varchar2(15), facultatea varchar2(25), nr_tel varchar2(10), e_mail varchar2(25))'; END;

BEGIN EXECUTE IMMEDIATE 'create table MIH_ARHIVE( cod_arhiva varchar2(12) constraint pk_mih_arhive primary key, cnp_stud varchar2(13), id_carte varchar2(5), data_impr date not null, data_return date not null, cnp_bibl varchar2(13), constraint fkey1_mih_student foreign key (cnp_stud) references MIH_STUDENT(cnp), constraint fkey2_mih_carte foreign key (id_carte) references MIH_CARTE(id_carte), constraint fkey3_mih_bibl foreign key (cnp_bibl) references MIH_BIBLIOTECAR(cnp))'; END;

INSERAREA DE INREGISTRARI In tabela BIBLIOTECAR: insert into mih_bibliotecar values('1898983858783','Lita','Mihai','str.Exercitiu,bl.31,sc.E,ap.10,Pitesti',’073355779 9','[email protected]'); insert into mih_bibliotecar values('1898983858783','Izina','Cristian','sect.3,Bucuresti','0248645389','[email protected] m');

insert into mih_bibliotecar values('1919834567878','Maftei','Alexandru','sect.6,Crangasi','0244668892','maf_alex@ gmail.com'); insert into mih_bibliotecar values('1863456782334','Macovei','Irina','str.Dimitrie Cantemir,sect.7,Bucuresti','0657890987','[email protected]'); insert into mih_bibliotecar values('1859834556463','Alexandru','Mihai','str.Eroilor,Bucuresti','0743215672','alex_m [email protected]'); insert into mih_bibliotecar values('1839834123856','Dragos','Andrei','str.Exercitiu,bl.P4,Bucuresti','0312556623','d [email protected]'); insert into mih_bibliotecar values('1829834567877','Tulpea','Paul','bl.p9,str.Frumoasei,Brasov','0214567765','tulpe [email protected]'); insert into mih_bibliotecar values('1799838867828','Mircea','Andreea','str.Banatului,bl.32,Bucresti','0445136458',' [email protected]'); insert into mih_bibliotecar values('1889839967829','Sabin','Cristian','str.Razboieni,cartier Colentina,Bucuresti','0788903456','[email protected]'); insert into mih_bibliotecar values('1729836767820','Robert','Florin','str.Timpurie,bl.A5,sect.1,Bucuresti','01234588 92','[email protected]'); insert into mih_bibliotecar values('1719833567853','Calin','Andrei','str.Alba,sect.4,Bucuresti','0733557799','calin_a [email protected]');

In tabela DOMENIU : insert into mih_domeniu values('12','Baze de date'); insert into mih_domeniu values('13','Informatica'); insert into mih_domeniu values('14','Economie'); insert into mih_domeniu values('15','Programare'); insert into mih_domeniu values('18','Analiza');

insert into mih_domeniu values('19','Algebra'); insert into mih_domeniu values('22','Cercetari Operationale'); insert into mih_domeniu values('33','Finante'); insert into mih_domeniu values('08','Marketing');

In tabela AUTOR : insert into mih_autor values('1234','Izina','Cristian'); insert into mih_autor values('234','Lita','Mihai'); insert into mih_autor values('235','Veghes','Andrei'); insert into mih_autor values('236','Velicanu','Anda'); insert into mih_autor values('237','Gheorghe','Rosca'); insert into mih_autor values('238','Gherghina','Rodica'); insert into mih_autor values('331','Uscatu','Florin'); insert into mih_autor values('339','Alba','Andreea'); insert into mih_autor values('337','Mircea','Andreea'); insert into mih_autor values('335','Florin','Dragos'); insert into mih_autor values('334','Manole','Alexandru');

In tabela CARTE : insert into mih_carte values('1','Pl/SQL','236','ASE','2008','student','12'); insert into mih_carte values('2','Limbajul C++','237','ASE','2005','biblioteca','13'); insert into mih_carte values('3','Analiza','235','ASE','2008','student','18'); insert into mih_carte values('4','Cercetari op.2','334','Corint','2009','student','22'); insert into mih_carte values('5','Microeconomie','335','ASE','2010','student','14'); insert into mih_carte values('6','Algebra liniara','1234','Meteora','2007','biblioteca','19'); insert into mih_carte values('7','Finante Publica','238','Teora','2004','student','33'); insert into mih_carte values('8','Marketing','337','ASE','1999','student','08');

In tabela STUDENT : insert into mih_student values('1890804035555','Mihai','Andrei','CSIE','0773335556','[email protected]'); insert into mih_student values('1885678900087','Cosmin','Florin','EAM','0321432325','[email protected]'); insert into mih_student values('1903423244556','Izina','Cristian','CSIE','0773234446','[email protected]'); insert into mih_student values('1874543543534','Toma','Dragos','FABB','0772345678','[email protected]'); insert into mih_student values('1904387654334','Mircea','Radu','Universitate','0734442341','[email protected] m'); insert into mih_student values('2875056895594','Mircea','Andreea','CGM','0721890800','[email protected]'); insert into mih_student values('2884354355467','Macovei','Irina','IE','0788900870','[email protected]'); insert into mih_student values('2905865455232','Pavel','Anca','ADM.P','0788807060','[email protected]'); insert into mih_student values('2894357679945','Ilie','Georgiana','FABB','0745342537','[email protected]'); insert into mih_student values('1890845798765','Gigi','Dragos','EAM','0745678900','[email protected]');

In tabela ARHIVA: insert into mih_arhive values('12','1890804035555','1','11-jun-09','14-jun09','1829834567877'); insert into mih_arhive values('3','1885678900087','2','03-oct-09','10-oct09','1729836767820'); insert into mih_arhive values('13','1874543543534','3','07-oct-08','11-oct08','1889839967829'); insert into mih_arhive values('14','1904387654334','4','01-apr-09','02-apr09','1799838867828'); insert into mih_arhive values('15','2875056895594','5','06-mar-09','12-mar07','1829834567877'); insert into mih_arhive values('17','2884354355467','7','09-nov-10','11-nov10','1839834123856'); insert into mih_arhive values('189','2905865455232','6','03-feb-09','12-feb09','1859834556463'); insert into mih_arhive values('11','2894357679945','8','01-jan-09','06-jan09','1919834567878');

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF