You are on page 1of 16

DROP TABLE IF EXISTS cazari_anulate;

DROP TABLE IF EXISTS cazari;


DROP TABLE IF EXISTS studloc_camine;
DROP TABLE IF EXISTS ordine_facultate;
DROP TABLE IF EXISTS facultati;
DROP TABLE IF EXISTS universitati;
DROP TABLE IF EXISTS sume_datorate;
DROP TABLE IF EXISTS sume_plati;
DROP TABLE IF EXISTS restante;
DROP TABLE IF EXISTS reduceri;
DROP TABLE IF EXISTS sume_ramase;
DROP TABLE IF EXISTS chitante;
DROP TABLE IF EXISTS angajati;
DROP TABLE IF EXISTS program_angajati;
DROP TABLE IF EXISTS studenti;
DROP TABLE IF EXISTS persoane;
DROP TABLE IF EXISTS tip_sali;
DROP TABLE IF EXISTS Nr_sali_lectura;
DROP TABLE IF EXISTS etaje;
DROP TABLE IF EXISTS sali_lectura;
DROP TABLE IF EXISTS camere;
DROP TABLE IF EXISTS camine;
DROP TABLE IF EXISTS campusuri;

CREATE TABLE campusuri(


IdCampus NUMERIC(4)
CONsTRAINT pk_Campusuri PRIMARY KEY
CONsTRAINT nn_Campusuri NOT NULL,
DenCampus VARCHAR (30)
CONSTRAINT nn_dencampus NOT NULL,
Adresa VARCHAR (40)
CONSTRAINT nn_adresa NOT NULL,
NrCamine NUMERIC (1)
CONSTRAINT ck_Nrcamine CHECK (NrCamine >=1)
CONSTRAINT nn_Nrcamine NOT NULL);
CREATE TABLE camine(
IdCamin NUMERIC (3)
CONSTRAINT pk_idcamin PRIMARY KEY
CONsTRAINT nn_Campusuri NOT NULL
CONsTRAINT ck_check CHECK (IdCamin >=1),
NumeCamin VARCHAR (20)
CONSTRAINT nn_numecamin NOT NULL,
NrCamere NUMERIC (3)
CONSTRAINT nn_nrcamere NOT NULL,
IdCampus NUMERIC (4)
CONSTRAINT fk_idcampus REFERENCES campusuri(IdCampus));

CREATE TABLE camere(


IdCamera NUMERIC (2)
CONSTRAINT pk_idcamera PRIMARY KEY
CONSTRAINT nn_idcamera not null,
NrCamera NUMERIC (3)
CONSTRAINT nn_nrcamera NOT NULL
CONSTRAINT ck_nrcamera CHECK (NrCamera >=1),
Capacitate NUMERIC (1)
CONSTRAINT nn_capacitate NOT NULL,
Observatii VARCHAR (30));
CREATE TABLE sali_lectura(
IdSalaLectura NUMERIC (5)
CONSTRAINT pk_salalectura PRIMARY KEY
CONSTRAINT nn_salalectura NOT NULL
CONSTRAINT ck_salalectura CHECK (IdSalaLectura >=1),
Capacitate NUMERIC (2)
CONSTRAINT nn_capacitate NOT NULL,
Observatii VARCHAR (30),
IdCamin NUMERIC (3)
CONSTRAINT fk_idcamin1 REFERENCES camine(IdCamin));
CREATE TABLE etaje (
IdCamin NUMERIC (3)
CONSTRAINT nn_Idcamin NOT NULL
CONSTRAINT fk_etajecamin REFERENCES camine(IdCamin)
CONsTRAINT ck_checketaj CHECK (IdCamin >=1),
IdCamera NUMERIC (2)
CONSTRAINT nn_idcamera not null
CONSTRAINT fk_etajecamera REFERENCES camere(IdCamera),
Etaj VARCHAR (3),
CONSTRAINT pk_etaje PRIMARY KEY (IdCamin, IdCamera));
CREATE TABLE Nr_sali_lectura(
IdSalaLectura NUMERIC (5)
CONSTRAINT nn_salalectura NOT NULL
CONSTRAINT ck_salalectura CHECK (IdSalaLectura >=1)
CONSTRAINT fk_idsalaa REFERENCES sali_lectura(IdSalaLectura),
Etaj VARCHAR (2),

NrSalaLectura NUMERIC (1)


CONSTRAINT nn_nrsala NOT NULL,
CONSTRAINT pk_salilectura PRIMARY KEY (IdSalaLectura, NrSalaLectura));

CREATE TABLE tip_sali (


IdSalaSpeciala NUMERIC (2)
CONSTRAINT nn_idspecial NOT NULL,
TipSalaSpeciala VARCHAR (10),
Etaj VARCHAR (2),
IdCamin NUMERIC (3)
CONSTRAINT nn_idcaminn NOT NULL
CONSTRAINT fk_idcamin REFERENCES camine(IdCamin),
CONSTRAINT pk_tipsali PRIMARY KEY (IdCamin, IdSalaSpeciala));

CREATE TABLE persoane (


IdPersoana NUMERIC (4)
CONSTRAINT pk_idpers PRIMARY KEY
CONSTRAINT nn_idpers NOT NULL,
NumePrenume VARCHAR (30)
CONSTRAINT nn_nm NOT NULL
CONSTRAINT ck_nm CHECK (NumePrenume=LTRIM(INITCAP(NumePrenume))),
Telefon VARCHAR (25),
Cetatenie VARCHAR (10),
Email VARCHAR (30)
CONSTRAINT ck_email CHECK (Email LIKE '%@%'),
DataNastere DATE
CONSTRAINT ck_datanastere CHECK (DataNastere <= CURRENT_DATE));
CREATE TABLE studenti(
IdStudent NUMERIC (4)
CONSTRAINT pk_idstudent PRIMARY KEY
CONSTRAINT fk_idst REFERENCES persoane(IdPersoana),

NrMatricol VARCHAR (6)


CONSTRAINT nn_nrmatricul NOT NULL,
TipMatricol VARCHAR (10)
CONSTRAINT nn_tipmatricol NOT NULL,
AnStudiu NUMERIC (1));

CREATE TABLE program_angajati (


IdProgramAngajat NUMERIC (4)
CONSTRAINT pk_idpro PRIMARY KEY
CONSTRAINT nn_Prog NOT NULL,
DataProgram date,
OraIntrare VARCHAR (5),
OraIesire VARCHAR (5));

CREATE TABLE angajati (


IdAngajat NUMERIC (4)
CONSTRAINT pk_ang PRIMARY KEY
CONSTRAINT nn_ida NOT NULL
CONSTRAINT fk_idajg REFERENCES persoane(IdPersoana),

Vechime NUMERIC (2),


TipAngajat VARCHAR (20),

IdProgramAngajat NUMERIC (4)


CONSTRAINT fk_idpro REFERENCES program_angajati(IdProgramAngajat));

CREATE TABLE chitante (


IdChitanta NUMERIC (3)
CONSTRAINT pk_chit PRIMARY KEY
CONSTrAINT nn_chit NOT NULL,
NrChitanta VARCHAR (6),
SumaPlatita VARCHAR (4),
DataEmitere date
CONSTRAINT ck_dataemit CHECK (DataEmitere >= TO_DATE ('2000/01/01','YYYY/MM/DD')
AND DataEmitere <= CURRENT_DATE));

CREATE TABLE sume_ramase (


IdChitanta NUMERIC (3)
CONSTRAINT fk_nrchit REFERENCES chitante(IdChitanta),
SumaDatorata NUMERIC (5)
CONSTRAINT nn_sume_dat NOT NULL
constraint un_sumedat UNIQUE,
SumaRamasa NUMERIC (5),
CONSTRAINT pk_sume_plati PRIMARY KEY (IdChitanta, SumaDatorata));

CREATE TABLE reduceri (


IdReducere NUMERIC (4)
CONSTRAINT pk_red PRIMARY KEY
CONSTRAINT nn_red NOT NULL,
Procent VARCHAR (4),
DenumireReducere VARCHAR (15));

CREATE TABLE restante (


IdRestanta NUMERIC (4)
CONSTRAINT pk_rest PRIMARY KEY
CONSTRAINT nn_rest NOT NULL,
ZileRestante NUMERIC (3),
Penalizare VARCHAR (4));
CREATE TABLE sume_plati(
IdSumaPlata NUMERIC(3)
CONSTRAINT pk_sumadat PRIMARY KEY
CONSTRAINT nn_suma NOT NULL,
SumaTeoretica NUMERIC (4),
DataLimita date);

CREATE TABLE sume_datorate (


IdStudent NUMERIC (4)
CONSTRAINT nn_idst NOT NULL
CONSTRAINT fk_idst REFERENCES studenti(IdStudent),
IdReducere NUMERIC (4)
CONSTRAINT fk_idred REFERENCES reduceri (IdReducere),
IdSumaPlata NUMERIC (3)
CONSTRAINT fk_idsum REFERENCES sume_plati(IdSumaPlata),
IdRestanta NUMERIC (4)
CONSTRAINT fk_idrest REFERENCES restante(IdRestanta),
SumaDatorata NUMERIC (5)
CONSTRAINT fk_smd REFERENCES sume_ramase(SumaDatorata),
CONSTRAINT pk_sumedat PRIMARY KEY (IdStudent, IdReducere, IdSumaPlata, IdRestant
a));
CREATE TABLE universitati (
IdUniversitate NUMERIC (2)
CONSTRAINT pk_iduniv PRIMARY KEY
CONSTRAINT nn_iduniv NOT NULL,
NumeUniversitate VARCHAR (20),
NumarFacultati NUMERIC (2));

CREATE TABLE facultati (


IdFacultate NUMERIC (2)
CONSTRAINT pk_idfac PRIMARY KEY
CONSTRAINT nn_idfac NOT NULL,
NumeFacultate VARCHAR (25)
CONSTRAINT nn_nume NOT NULL,
Adresa VARCHAR (30),
Telefon NUMERIC (10),
NumarSpecializari NUMERIC (2),
IdUniversitate NUMERIC (2)
CONSTRAINT fk_iduniv REFERENCES universitati (IdUniversitate));

CREATE TABLE ordine_facultate (


IdStudent NUMERIC (4)
CONSTRAINT fk_idst REFERENCES studenti(IdStudent)
CONSTRAINT nn_idst NOT NULL,
IdFacultate NUMERIC (2)
CONSTRAINT fk_fac REFERENCES facultati(IdFacultate),
NrOrdineFacultate NUMERIC (1),
CONSTRAINT pk_ordfac PRIMARY KEY (IdStudent, IdFacultate));

CREATE TABLE studloc_camine (


IdFacultate NUMERIC (2)
CONSTRAINT fk_studloc REFERENCES facultati (IdFacultate)
CONSTRAINT nn_idfac NOT NULL,

IdCamin NUMERIC (3)


CONSTRAINT fk_idcam REFERENCES camine(IdCamin)
CONSTRAINT nn_wdwad NOT NULL,
NumarStudentiAlocati NUMERIC (3),
DataAlocare date);

CREATE TABLE cazari (


IdCazare NUMERIC (6)
CONSTRAINT pk_idcaz PRIMARY KEY
CONSTRAINT nn_idcazare NOT NULL,
DataOraCazare date,
CONSTRAINT ck_data CHECK (DataOraCazare <= CURRENT_DATE),
Observatii VARCHAR (30),
IdStudent NUMERIC (4)
CONSTRAINT fk_stud REFERENCES studenti (IdStudent),
IdCamera NUMERIC (2)
CONSTRAINT fk_cam REFERENCES camere (IdCamera),
IdCamin NUMERIC (3)
CONSTRAINT fk_idcmk REFERENCES camine(IdCamin));

CREATE TABLE cazari_anulate (


IdCazareAnulata NUMERIC (6)
CONSTRAINT pk_cazanul PRIMARY KEY
CONSTRAINT nn_cazanul NOT NULL
CONSTRAINT fk_cazanul REFERENCES cazari(IdCazare),
DataOraAnulare date
CONSTRAINT ck_data CHECK (DataOraAnulare <= CURRENT_DATE),
MotivAnulare VARCHAR (20));

------INSERTURI-----
INSERT INTO campusuri VALUES ( 0001, 'Codrescu', 'Bulevardul Carol I', 6);
INSERT INTO campusuri VALUES ( 0002, 'Targusor', 'Locotenet Stoicescu', 4);
INSERT INTO campusuri VALUES ( 0003, 'Tudor', 'Bulevardul Tudor Valdimirescu', 2
);
INSERT INTO campusuri VALUES ( 0004, 'Agronomie', 'Rond', 1);
INSERT INTO campusuri VALUES ( 0005, 'Titu Maiorescu', 'Bulevardul Carol I', 5);
INSERT INTO camine VALUES ( 111, 'C13', 455, 0001);
INSERT INTO camine VALUES ( 112, 'C10', 300, 0001);
INSERT INTO camine VALUES ( 113, 'C12', 155, 0001);
INSERT INTO camine VALUES ( 114, 'C11', 345, 0001);
INSERT INTO camine VALUES ( 115, 'Gaudeamus', 235, 0001);
INSERT INTO camine VALUES ( 116, 'Akademus', 215, 0001);
INSERT INTO camine VALUES ( 121, 'C1', 455, 0002);
INSERT INTO camine VALUES ( 122, 'C2', 300, 0002);
INSERT INTO camine VALUES ( 123, 'C3', 155, 0002);
INSERT INTO camine VALUES ( 124, 'C4', 345, 0002);
INSERT INTO camine VALUES ( 131, 'T1', 655, 0003);
INSERT INTO camine VALUES ( 132, 'T2', 700, 0003);
INSERT INTO camine VALUES ( 141, 'A4', 315, 0004);
INSERT INTO camine VALUES ( 151, 'C5', 300, 0005);
INSERT INTO camine VALUES ( 152, 'C6', 345, 0005);
INSERT INTO camine VALUES ( 153, 'C7', 345, 0005);
INSERT INTO camine VALUES ( 154, 'C8', 345, 0005);

INSERT INTO camere VALUES ( 01, 1, 4, 'usa rupta ');


INSERT INTO camere VALUES ( 02, 11, 2, ' ');
INSERT INTO camere VALUES ( 03, 111, 4, ' ');
INSERT INTO camere VALUES ( 04, 121, 2, ' ');
INSERT INTO camere VALUES ( 05, 82, 3, ' usa rupta');
INSERT INTO camere VALUES ( 06, 12, 4, ' ');
INSERT INTO camere VALUES ( 07, 112, 3, 'geam spart ');
INSERT INTO camere VALUES ( 08, 02, 2, ' ');
INSERT INTO camere VALUES ( 09, 78, 1, ' lipsa saltea');
INSERT INTO camere VALUES ( 10, 63, 2, ' ');
INSERT INTO camere VALUES ( 11, 56, 3, 'usa rupta');
INSERT INTO camere VALUES ( 12, 48, 4, ' ');
INSERT INTO camere VALUES ( 13, 134, 4, 'usa rupta ');
INSERT INTO camere VALUES ( 14, 58, 2, ' ');
INSERT INTO camere VALUES ( 15, 14, 4, ' ');
INSERT INTO camere VALUES ( 16, 114, 2, ' ');
INSERT INTO camere VALUES ( 17, 105, 3, ' usa rupta');
INSERT INTO camere VALUES ( 18, 15, 4, ' ');
INSERT INTO camere VALUES ( 19, 115, 3, 'geam spart ');
INSERT INTO camere VALUES ( 20, 205, 2, ' ');
INSERT INTO camere VALUES ( 21, 06, 1, ' lipsa saltea');
INSERT INTO camere VALUES ( 22, 20, 2, ' ');
INSERT INTO camere VALUES ( 23, 16, 3, 'usa rupta');
INSERT INTO camere VALUES ( 24, 116, 4, ' ');
INSERT INTO camere VALUES ( 25, 01, 4, 'usa rupta ');
INSERT INTO camere VALUES ( 26, 50, 2, ' ');
INSERT INTO camere VALUES ( 27, 100, 4, ' ');
INSERT INTO camere VALUES ( 28, 111, 2, ' ');
INSERT INTO camere VALUES ( 29, 78, 3, ' usa rupta');
INSERT INTO camere VALUES ( 30, 112, 4, ' ');
INSERT INTO camere VALUES ( 31, 59, 3, 'geam spart ');
INSERT INTO camere VALUES ( 32, 45, 2, ' ');
INSERT INTO camere VALUES ( 33, 103, 1, ' lipsa saltea');
INSERT INTO camere VALUES ( 34, 113, 2, ' ');
INSERT INTO camere VALUES ( 35, 13, 3, 'usa rupta');
INSERT INTO camere VALUES ( 38, 03, 4, ' ');
INSERT INTO camere VALUES ( 39, 12, 3, 'geam spart ');
INSERT INTO camere VALUES ( 40, 79, 2, ' usa dulap lipsa');
INSERT INTO camere VALUES ( 41, 1, 1, ' ');
INSERT INTO camere VALUES ( 42, 122, 5, 'geam spart ');
INSERT INTO camere VALUES ( 43, 56, 5, ' usa dulap lipsa');
INSERT INTO camere VALUES ( 44, 17, 5, ' saltea deteriorata');
INSERT INTO camere VALUES ( 45, 2, 1, ' ');
INSERT INTO camere VALUES ( 46, 13, 3, 'geam spart ');
INSERT INTO camere VALUES ( 47, 23, 2, ' usa dulap lipsa');
INSERT INTO camere VALUES ( 48, 123, 1, ' ');
INSERT INTO camere VALUES ( 49, 124, 5, 'geam spart ');
INSERT INTO camere VALUES ( 50, 126, 5, ' usa dulap lipsa');
INSERT INTO camere VALUES ( 51, 14, 5, ' saltea deteriorata');
INSERT INTO camere VALUES ( 52, 04, 1, ' ');
INSERT INTO camere VALUES ( 53, 23, 2, ' usa dulap lipsa');
INSERT INTO camere VALUES ( 54, 123, 1, ' ');
INSERT INTO camere VALUES ( 55, 124, 5, 'geam spart ');
INSERT INTO camere VALUES ( 56, 126, 5, ' usa dulap lipsa');
INSERT INTO camere VALUES ( 57, 14, 5, ' saltea deteriorata');
INSERT INTO camere VALUES ( 58, 04, 1, ' ');

INSERT INTO sali_lectura VALUES (12345, 10,'scaun defect',111);


INSERT INTO sali_lectura VALUES(12346,40,'fara geam',112);
INSERT INTO sali_lectura VALUES(12347,50,'masa defecta',113);
INSERT INTO sali_lectura VALUES(12348,70,'fara usa',114);
INSERT INTO sali_lectura VALUES(12349,40,'fara geam',115);
INSERT INTO sali_lectura VALUES (12350, 10,' ',115);
INSERT INTO sali_lectura VALUES(12351,40,'fara geam',116);
INSERT INTO sali_lectura VALUES(12352,50,' ',116);
INSERT INTO sali_lectura VALUES(12353,70,'priza defecta',121);
INSERT INTO sali_lectura VALUES(12354,40,'fir internet lipsa',121);
INSERT INTO sali_lectura VALUES (12355, 10,'scaun defect',121);
INSERT INTO sali_lectura VALUES(12356,40,'fara geam',122);
INSERT INTO sali_lectura VALUES(12357,50,'masa defecta',122);
INSERT INTO sali_lectura VALUES(12358,70,'fara usa',122);
INSERT INTO sali_lectura VALUES(12359,40,'fara geam',123);
INSERT INTO sali_lectura VALUES (12360, 10,' ',123);
INSERT INTO sali_lectura VALUES(12361,40,'fara geam',123);
INSERT INTO sali_lectura VALUES(12362,50,' ',124);
INSERT INTO sali_lectura VALUES(12363,70,'priza defecta',131);
INSERT INTO sali_lectura VALUES(12364,40,'',131);
INSERT INTO sali_lectura VALUES(12365,70,' ',131);
INSERT INTO sali_lectura VALUES(12366,40,'fir internet lipsa',131);
INSERT INTO sali_lectura VALUES(12377,50,'masa defecta',132);
INSERT INTO sali_lectura VALUES(12378,70,'fara usa',132);
INSERT INTO sali_lectura VALUES(12379,40,'fara geam',132);
INSERT INTO sali_lectura VALUES (12380, 10,' ',132);
INSERT INTO sali_lectura VALUES(12381,40,'fara geam',132);
INSERT INTO sali_lectura VALUES(12382,50,' ',141);
INSERT INTO sali_lectura VALUES(12383,70,'priza defecta',141);
INSERT INTO sali_lectura VALUES(12384,40,'',151);
INSERT INTO sali_lectura VALUES(12385,70,' ',152);
INSERT INTO sali_lectura VALUES(12386,40,'fir internet lipsa',153);
INSERT INTO sali_lectura VALUES(12387,40,'fir internet lipsa',154);

INSERT INTO etaje VALUES (111, 01, '0');


INSERT INTO etaje VALUES (111, 02, '-1');
INSERT INTO etaje VALUES (111, 03, '2');
INSERT INTO etaje VALUES (111, 04, '0');
INSERT INTO etaje VALUES (112, 05, '-1');
INSERT INTO etaje VALUES (112, 06, '0');
INSERT INTO etaje VALUES (112, 07, '3');
INSERT INTO etaje VALUES (113, 08, '4');
INSERT INTO etaje VALUES (113, 09, '0');
INSERT INTO etaje VALUES (113, 10, '3');
INSERT INTO etaje VALUES (114, 11, '2');
INSERT INTO etaje VALUES (114, 12, '0');
INSERT INTO etaje VALUES (114, 13, '0');
INSERT INTO etaje VALUES (115, 14, '0');
INSERT INTO etaje VALUES (115, 15, '0');
INSERT INTO etaje VALUES (115, 16, '0');
INSERT INTO etaje VALUES (115, 17, '0');
INSERT INTO etaje VALUES (116, 18, '1');
INSERT INTO etaje VALUES (116, 19, '1');
INSERT INTO etaje VALUES (116, 20, '2');
INSERT INTO etaje VALUES (121, 21, '3');
INSERT INTO etaje VALUES (121, 22, '0');
INSERT INTO etaje VALUES (121, 23, '1');
INSERT INTO etaje VALUES (122, 24, '0');
INSERT INTO etaje VALUES (122, 25, '-1');
INSERT INTO etaje VALUES (122, 26, '1');
INSERT INTO etaje VALUES (123, 27, '0');
INSERT INTO etaje VALUES (123, 28, '-1');
INSERT INTO etaje VALUES (123, 29, '0');
INSERT INTO etaje VALUES (123, 30, '3');
INSERT INTO etaje VALUES (124, 31, '4');
INSERT INTO etaje VALUES (124, 32, '0');
INSERT INTO etaje VALUES (124, 33, '3');
INSERT INTO etaje VALUES (131, 34, '2');
INSERT INTO etaje VALUES (131, 35, '0');
INSERT INTO etaje VALUES (131, 36, '0');
INSERT INTO etaje VALUES (131, 37, '0');
INSERT INTO etaje VALUES (132, 38, '0');
INSERT INTO etaje VALUES (132, 39, '0');
INSERT INTO etaje VALUES (132, 40, '0');
INSERT INTO etaje VALUES (141, 41, '1');
INSERT INTO etaje VALUES (141, 42, '1');
INSERT INTO etaje VALUES (141, 43, '2');
INSERT INTO etaje VALUES (141, 44, '3');
INSERT INTO etaje VALUES (151, 45, '0');
INSERT INTO etaje VALUES (151, 46, '1');
INSERT INTO etaje VALUES (151, 47, '0');
INSERT INTO etaje VALUES (151, 48, '-1');
INSERT INTO etaje VALUES (152, 49, '1');
INSERT INTO etaje VALUES (152, 50, '0');
INSERT INTO etaje VALUES (152, 51, '-1');
INSERT INTO etaje VALUES (152, 52, '0');
INSERT INTO etaje VALUES (153,53 , '3');
INSERT INTO etaje VALUES (153, 54, '4');
INSERT INTO etaje VALUES (153, 55, '0');
INSERT INTO etaje VALUES (154, 56, '3');
INSERT INTO etaje VALUES (154, 57, '2');
INSERT INTO etaje VALUES (154, 58, '0');

INSERT INTO Nr_sali_lectura VALUES (12345,'4',2 );


INSERT INTO Nr_sali_lectura VALUES (12346,'1',5 );
INSERT INTO Nr_sali_lectura VALUES (12347,'3',6);
INSERT INTO Nr_sali_lectura VALUES (12348,'2',5);
INSERT INTO Nr_sali_lectura VALUES (12349,'1',46);
INSERT INTO Nr_sali_lectura VALUES (12350,'4',15 );
INSERT INTO Nr_sali_lectura VALUES (12351,'1',12 );
INSERT INTO Nr_sali_lectura VALUES (12352,'3',1);
INSERT INTO Nr_sali_lectura VALUES (12353,'2',26);
INSERT INTO Nr_sali_lectura VALUES (12354,'1',100);
INSERT INTO Nr_sali_lectura VALUES (12355,'4',20 );
INSERT INTO Nr_sali_lectura VALUES (12356,'1',13 );
INSERT INTO Nr_sali_lectura VALUES (12357,'3',18);
INSERT INTO Nr_sali_lectura VALUES (12358,'2',17);
INSERT INTO Nr_sali_lectura VALUES (12359,'1',10);
INSERT INTO Nr_sali_lectura VALUES (12360,'4',25 );
INSERT INTO Nr_sali_lectura VALUES (12361,'1',19 );
INSERT INTO Nr_sali_lectura VALUES (12362,'3',12);
INSERT INTO Nr_sali_lectura VALUES (12363,'2',13);
INSERT INTO Nr_sali_lectura VALUES (12364,'1',11);
INSERT INTO Nr_sali_lectura VALUES (12365,'4',29 );
INSERT INTO Nr_sali_lectura VALUES (12366,'1',10 );
INSERT INTO Nr_sali_lectura VALUES (12377,'3',100);
INSERT INTO Nr_sali_lectura VALUES (12378,'2',11);
INSERT INTO Nr_sali_lectura VALUES (12379,'1',10);
INSERT INTO Nr_sali_lectura VALUES (12380,'4',222 );
INSERT INTO Nr_sali_lectura VALUES (12381,'1',18 );
INSERT INTO Nr_sali_lectura VALUES (12382,'3',15);
INSERT INTO Nr_sali_lectura VALUES (12383,'2',133);
INSERT INTO Nr_sali_lectura VALUES (12384,'1',154);
INSERT INTO Nr_sali_lectura VALUES (12385,'4',14 );
INSERT INTO Nr_sali_lectura VALUES (12386,'1',13 );
INSERT INTO Nr_sali_lectura VALUES (12387,'3',145);

INSERT INTO tip_sali VALUES (99,'Bucatarie', '-1',111);


INSERT INTO tip_sali VALUES (98,'BaieComuna', '2',111);
INSERT INTO tip_sali VALUES (97,'Bucatarie', '1',111);
INSERT INTO tip_sali VALUES (96,'Bucatarie', '2',112);
INSERT INTO tip_sali VALUES (95,'BaieComuna', '1',112);
INSERT INTO tip_sali VALUES (94,'Bucatarie', '1',113);
INSERT INTO tip_sali VALUES (93,'Bucatarie', '-1',114);
INSERT INTO tip_sali VALUES (92,'BaieComuna', '-1',114);
INSERT INTO tip_sali VALUES (91,'Bucatarie', '1',115);
INSERT INTO tip_sali VALUES (90,'Bucatarie', '2',116);
INSERT INTO tip_sali VALUES (89,'BaieComuna', '1',121);
INSERT INTO tip_sali VALUES (88,'Bucatarie', '1',121);
INSERT INTO tip_sali VALUES (87,'Bucatarie', '-1',122);
INSERT INTO tip_sali VALUES (86,'BaieComuna', '-1',122);
INSERT INTO tip_sali VALUES (85,'Bucatarie', '1',124);
INSERT INTO tip_sali VALUES (84,'Bucatarie', '2',131);
INSERT INTO tip_sali VALUES (83,'BaieComuna', '1',131);
INSERT INTO tip_sali VALUES (82,'Bucatarie', '1',132);
INSERT INTO tip_sali VALUES (81,'Bucatarie', '-1',141);
INSERT INTO tip_sali VALUES (80,'BaieComuna', '-1',141);
INSERT INTO tip_sali VALUES (79,'Bucatarie', '1',151);
INSERT INTO tip_sali VALUES (78,'Bucatarie', '2',152);
INSERT INTO tip_sali VALUES (77,'BaieComuna', '1',152);
INSERT INTO tip_sali VALUES (76,'Bucatarie', '1',153);
INSERT INTO tip_sali VALUES (75,'Bucatarie', '2',154);
INSERT INTO tip_sali VALUES (74,'BaieComuna', '1',154);
INSERT INTO persoane VALUES ( 2345, 'Vasile Ion', '+398 0987654321', 'romana','v
asileion@yahoo.com', '1997-05-12');
INSERT INTO persoane VALUES ( 2344, 'Negrescu Maria', '+40 987654321', 'romana',
'negrmaria@yahoo.com', '1990-11-09');
INSERT INTO persoane VALUES ( 2343, 'Vasile Ana', '0987654321', 'engleza','vasil
eana@gmail.com', '1994-03-12');
INSERT INTO persoane VALUES ( 2342, 'Madalin Ion', '+09 0987654321', 'romana','m
adalinion@yahoo.com', '1980-07-12');
INSERT INTO persoane VALUES ( 2341, 'Andreea Ioan', '243587654321', 'engleza','a
ndreeaioan@yahoo.com', '1987-04-12');
INSERT INTO persoane VALUES ( 2340, 'Maria Ioana', '098762324321', 'romana','mar
iaion@gmail.com', '1967-05-12');
INSERT INTO persoane VALUES ( 2339, 'Viorel Marcel', '0243287634321', 'romana','
viorelmarcel@yahoo.com', '1977-05-12');
INSERT INTO persoane VALUES ( 2338, 'Viorica Ion', '042364344321', 'italiana','v
ioricaion@yahoo.com', '1994-05-12');
INSERT INTO persoane VALUES ( 2337, 'Violeta Georgiana', '023254321', 'italiana'
,'violetageorgiana@yahoo.com', '1996-04-22');
INSERT INTO persoane VALUES ( 2336, 'Violeta Georgiana', '023254321', 'italiana'
,'violetageorgiana@yahoo.com', '1996-04-22');
INSERT INTO persoane VALUES ( 2335, 'Laura Ioana', '02342654321', 'romana','laur
aioana@yahoo.com', '1987-06-12');
INSERT INTO persoane VALUES ( 2334, 'Marian Silviu', '0987654321', 'romana','mar
iansilviu@yahoo.com', '1987-05-12');
INSERT INTO persoane VALUES ( 2333, 'Vasile George', '0987654321', 'romana','vas
ilegeorge@yahoo.com', '1994-05-12');
INSERT INTO persoane VALUES ( 2332, 'Vasilescu Ionut', '+398 0987654321', 'roman
a','vasilescuionut@yahoo.com', '1997-05-12');
INSERT INTO persoane VALUES ( 2331, 'Negrescu Georgian', '+40 987654321', 'roman
a','negrmaria@yahoo.com', '1990-11-09');
INSERT INTO persoane VALUES ( 2330, 'Ionescu Ana', '0987654321', 'franceza','vas
ileana@gmail.com', '1986-06-26');
INSERT INTO persoane VALUES ( 2329, 'Musly Ion', '+09 098454654321', 'romana','m
uslyion@yahoo.com', '1980-06-12');
INSERT INTO persoane VALUES ( 2328, 'Andreea Ioan', '243534837654321', 'engleza'
,'andreeaioan@yahoo.com', '1987-04-18');
INSERT INTO persoane VALUES ( 2327, 'Marioara Ioana', '098762324321', 'romana','
marioaraioana@gmail.com', '1967-05-16');
INSERT INTO persoane VALUES ( 2326, 'Madalina Roca', '024326887634321', 'romana'
,'madaliaroca@yahoo.com', '1987-04-14');
INSERT INTO persoane VALUES ( 2325, 'John Smith', '0423647344321', 'italiana','j
ohnsmith@yahoo.com', '1994-05-12');
INSERT INTO persoane VALUES ( 2324, 'Jon Annderson', '04354323254321', 'italiana
','joannderson@yahoo.com', '1996-04-22');
INSERT INTO persoane VALUES ( 2323, 'Laura Deleanu', '0234264554321', 'franceza'
,'lauradeleanu@yahoo.com', '1982-06-14');
INSERT INTO persoane VALUES ( 2322, 'Marian Silviu Andrei', '098537654321', 'rom
ana','mariansilviu98@yahoo.com', '1985-05-12');
INSERT INTO persoane VALUES ( 2321, 'Vasile Gabriel', '09876543321', 'romana','v
asilegabriel@yahoo.com', '1994-05-12');
INSERT INTO persoane VALUES ( 2320, 'Vasile Mitica', '+398 0987784321', 'romana'
,'vasilemitica@yahoo.com', '1997-05-21');
INSERT INTO persoane VALUES ( 2319, 'Negrescu Ioana', '+40 987655421', 'romana',
'negrscuioana@yahoo.com', '1990-03-09');
INSERT INTO persoane VALUES ( 2318, 'Vasile Maria', '0985634321', 'engleza','vas
ilemaria@gmail.com', '1994-07-05');
INSERT INTO persoane VALUES ( 2317, 'Madalin Ioana', '+09 09896554321', 'romana'
,'madalinioana@yahoo.com', '1980-12-12');
INSERT INTO persoane VALUES ( 2316, 'Andreea Vasilica', '243589964321', 'engleza
','andreeavasilica@yahoo.com', '1987-07-12');
INSERT INTO persoane VALUES ( 2315, 'Maria Violeta', '098762325421', 'romana','m
aria56@gmail.com', '1967-05-16');
INSERT INTO persoane VALUES ( 2314, 'Viorel Nicu', '0243287354321', 'romana','vi
ore32@yahoo.com', '1987-05-10');
INSERT INTO persoane VALUES ( 2313, 'Popescu Ion', '042364321521', 'italiana','v
123ion@yahoo.com', '1994-05-20');
INSERT INTO persoane VALUES ( 2312, 'Popescu Georgiana', '005454321', 'italiana'
,'v.ageorgiana@yahoo.com', '1996-04-21');
INSERT INTO persoane VALUES ( 2311, 'Ghita Florea', '02342655481', 'romana','ghi
ta.a@yahoo.com', '1987-06-30');
INSERT INTO persoane VALUES ( 2310, 'Ionescu Silviu', '0987602521', 'romana','i.
silviu@yahoo.com', '1987-05-05');
INSERT INTO persoane VALUES ( 2309, 'Nica George', '0987665421', 'romana','n_vas
ilegeorge@yahoo.com', '1994-05-14');
INSERT INTO persoane VALUES ( 2308, 'Vasilescu Vasile', '+398 9877654321', 'roma
na','vasilescuionut.v@yahoo.com', '1997-05-18');
INSERT INTO persoane VALUES ( 2307, 'Negura Catalin', '+40 987321321', 'romana',
'neg_catalin@yahoo.com', '1990-11-22');
INSERT INTO persoane VALUES ( 2306, 'Ionesc Bogdana ', '0987653251', 'franceza',
'vasileana@gmail.com', '1986-06-25');
INSERT INTO persoane VALUES ( 2305, 'Musly Jhon', '+09 098454665421', 'romana','
muslyjhon@yahoo.com', '1980-06-05');
INSERT INTO persoane VALUES ( 2304, 'Andreea Marian', '243534825154321', 'englez
a','andreeamatian@yahoo.com', '1987-04-18');
INSERT INTO persoane VALUES ( 2303, 'Marioara Mioara', '098762652321', 'romana',
'marioara1_12@gmail.com', '1967-05-16');
INSERT INTO persoane VALUES ( 2302, 'Madalina Roca', '02435554321', 'romana','ma
dalinaroca@yahoo.com', '1987-04-14');
INSERT INTO persoane VALUES ( 2301, 'John Surma', '04236625321', 'italiana','joh
nsurma@yahoo.com', '1994-05-20');
INSERT INTO persoane VALUES ( 2300, 'Jon Fgpirk', '0435654254321', 'italiana','j
oan89@yahoo.com', '1996-04-21');
INSERT INTO persoane VALUES ( 2299, 'Laura Druta', '0233254554321', 'franceza','
laura_dr@yahoo.com', '1992-06-14');
INSERT INTO persoane VALUES ( 2298, 'Mary Andrei', '09954654321', 'romana','mary
ansilviu.a98@yahoo.com', '1985-05-18');
INSERT INTO persoane VALUES ( 2297, 'Vicuta Gabriel', '08765462521', 'romana','v
icutagabriel@yahoo.com', '1994-09-12');

INSERT INTO studenti VALUES (2328,'150879', 'temporar', 2);


INSERT INTO studenti VALUES (2322,'150878', 'permanent', 2);
INSERT INTO studenti VALUES (2323,'150548', 'permanent', 3);
INSERT INTO studenti VALUES (2321,'150468', 'permanent', 2);
INSERT INTO studenti VALUES (2327,'150368', 'permanent', 1);
INSERT INTO studenti VALUES (2334,'150558', 'permanent', 3);
INSERT INTO studenti VALUES (2337,'151558', 'temporar', 3);

INSERT INTO program_angajati VALUES (4441, '1997-07-29', '02:00', '20:15');


INSERT INTO program_angajati VALUES (4442, '1997-08-09', '09:00', '12:00');
INSERT INTO program_angajati VALUES (4443, '2007-04-09', '12:00', '21:30');
INSERT INTO program_angajati VALUES (4444, '2004-05-12', '12:00', '23:00');
INSERT INTO program_angajati VALUES (4445, '2008-06-29', '01:00', '22:00');
INSERT INTO program_angajati VALUES (4446, '1998-07-19', '12:00', '20:00');
INSERT INTO program_angajati VALUES (4447, '1999-07-09', '13:30', '20:00');
INSERT INTO program_angajati VALUES (4448, '20017-07-09', '12:00', '10:00');
UPDATE program_angajati SET DataProgram = '2007-07-09' where IdProgramAngajat =
4448;

INSERT INTO angajati VALUES ( 2334, 20, 'bibliotecar', 4441);


INSERT INTO angajati VALUES ( 2342, 21, 'bibliotecar', 4442);
INSERT INTO angajati VALUES ( 2336, 22, 'profesor', 4441);
INSERT INTO angajati VALUES ( 2325, 12, 'secretar', 4444);
INSERT INTO angajati VALUES ( 2329, 10, 'secretar', 4443);
INSERT INTO angajati VALUES ( 2327, 30, 'bibliotecar', 4445);
INSERT INTO angajati VALUES (2343, 40, 'bibliotecar', 4441);
INSERT INTO angajati VALUES ( 2330, 33, 'serviciu', 4446);
INSERT INTO angajati VALUES ( 2332, 20, 'bibliotecar',4448);
INSERT INTO angajati VALUES ( 2344, 20, 'mecanic', 4441);

INSERT INTO chitante VALUES ( 999,'ch1234', '200', '2017-03-12');


INSERT INTO chitante VALUES ( 998,'ch1235', '150', '2017-04-22');
INSERT INTO chitante VALUES ( 997,'ch1236', '200', '2017-05-03');
INSERT INTO chitante VALUES ( 996,'ch1237', '214', '2017-03-12');
INSERT INTO chitante VALUES ( 995,'ch1238', '145', '2017-01-18');

INSERT INTO sume_ramase VALUES (999, 12345, 123);


INSERT INTO sume_ramase VALUES (998, 123, 0);
INSERT INTO sume_ramase VALUES (997, 134, 343);
INSERT INTO sume_ramase VALUES (996, 125, 323) ;

INSERT INTO reduceri VALUES (5555, '16%','zile libere');


INSERT INTO reduceri VALUES (5556, '32%','vacanta');
INSERT INTO reduceri VALUES (5557, '12%','craciun');
INSERT INTO reduceri VALUES (5558, '46%','vacanta');
INSERT INTO reduceri VALUES (5559, '22%','paste');
INSERT INTO reduceri VALUES (5550, '52%','vacanta');
INSERT INTO reduceri VALUES (5554, '18%','ziua ta');

INSERT INTO restante VALUES (20, 12, '12');


INSERT INTO restante VALUES (21, 122, '122');
INSERT INTO restante VALUES (22, 121, '121');
INSERT INTO restante VALUES (23, 125, '125');
INSERT INTO restante VALUES (24, 113, '113');
INSERT INTO restante VALUES (25, 112, '112');
INSERT INTO restante VALUES (26, 124, '124');
INSERT INTO restante VALUES (27, 128, '128');
INSERT INTO restante VALUES (28, 14, '14');
INSERT INTO restante VALUES (29, 192, '192');

INSERT INTO sume_plati VALUES (1, 123, '2017-09-30');


INSERT INTO sume_plati VALUES (2, 343, '2017-08-30');
INSERT INTO sume_plati VALUES (3, 233, '2017-07-30');
INSERT INTO sume_plati VALUES (4, 233, '2017-06-30');
INSERT INTO sume_plati VALUES (5, 123, '2017-04-30');
INSERT INTO sume_plati VALUES (6, 323, '2017-03-30');
INSERT INTO sume_plati VALUES (7, 273, '2017-02-25');
INSERT INTO sume_plati VALUES (8, 293, '2017-01-30');

INSERT INTO sume_datorate VALUES ( 2328,5555,3,21,125);


INSERT INTO sume_datorate VALUES ( 2322,5550,6,26,134);
INSERT INTO sume_datorate VALUES ( 2322,5555,8,24,123);
INSERT INTO sume_datorate VALUES ( 2322,5554,1,26,12345);
INSERT INTO sume_datorate VALUES ( 2323,5558,5,27,125);
INSERT INTO sume_datorate VALUES ( 2321,5550,6,29,134);
INSERT INTO sume_datorate VALUES ( 2323,5555,5,22,134);
INSERT INTO sume_datorate VALUES ( 2328,5554,1,23,134);

INSERT INTO universitati VALUES (91,'Alexandru Ioan Cuza',15);


INSERT INTO universitati VALUES (92,'USAMV',15);
INSERT INTO universitati VALUES (93,'UMF',15);
INSERT INTO universitati VALUES (94,'G.T. Popa',15);
INSERT INTO universitati VALUES (95,'Gheorghe Asachi',25);

INSERT INTO facultati VALUES (11, 'FEAA','Bulevardul Carol I','0765432198',7,91)


;
INSERT INTO facultati VALUES (12, 'Psihologie','Bulevardul Carol I','07654522198
',5,91);
INSERT INTO facultati VALUES (13, 'AC','Bulevardul Carol I','07653432198',10,95)
;
INSERT INTO facultati VALUES (14, 'Litere','Bulevardul Carol I','0565432198',3,9
1);
INSERT INTO facultati VALUES (15, 'Medicina','Bulevardul Independentei','0435432
198',15,93);
INSERT INTO facultati VALUES (16, 'Agronomie','Bulevardul Copou','0565432198',6,
92);
INSERT INTO facultati VALUES (17, 'Biologie','Bulevardul Carol I','0565445198',2
,91);
INSERT INTO facultati VALUES (18, 'BD','Bulevardul Carol I','0734532198',9,94);

INSERT INTO ordine_facultate VALUES (2328,12,1 );


INSERT INTO ordine_facultate VALUES (2322,11,2 );
INSERT INTO ordine_facultate VALUES (2323,14,1);
INSERT INTO ordine_facultate VALUES (2321,13,1 );
INSERT INTO ordine_facultate VALUES (2327,15,1 );
INSERT INTO ordine_facultate VALUES (2334,16,1 );
INSERT INTO ordine_facultate VALUES (2337,15,2 );
INSERT INTO ordine_facultate VALUES (2337,16,1 );
INSERT INTO ordine_facultate VALUES (2322,14,1 );
INSERT INTO ordine_facultate VALUES (2327,11,2 );

INSERT INTO studloc_camine VALUES (11,111,345,'01/10/2017');


INSERT INTO studloc_camine VALUES (12,112,356,'01/10/2017');
INSERT INTO studloc_camine VALUES (13,113,245,'01/10/2017');
INSERT INTO studloc_camine VALUES (15,114,135,'01/10/2017');
INSERT INTO studloc_camine VALUES (16,115,389,'01/10/2017');
INSERT INTO studloc_camine VALUES (14,123,235,'01/10/2017');
INSERT INTO cazari VALUES (98765,'2017/03/12',' ',2328, 03,111);
INSERT INTO cazari VALUES (98764,'2017/01/12',' ',2322, 04,112);
INSERT INTO cazari VALUES (98763,'2017/02/11',' ',2323, 05,113);
INSERT INTO cazari VALUES (98762,'2016/10/12',' ',2321, 06,114);
INSERT INTO cazari VALUES (98761,'2014/11/13',' ',2327, 07,115);
INSERT INTO cazari VALUES (98760,'2017/03/14',' ',2334, 08,116);
INSERT INTO cazari VALUES (98759,'2012/10/11',' ',2337, 09,121);

INSERT INTO cazari_anulate VALUES (98761, '2015/04/09','renuntare facultate');


INSERT INTO cazari_anulate VALUES (98762,'2016/11/11','mutare in chirie');
INSERT INTO cazari_anulate VALUES (98763,'2017/03/08','scaun rupt');
INSERT INTO cazari_anulate VALUES (98764,'2017/02/07','saltea deteriorata');
INSERT INTO cazari_anulate VALUES (98765,'2017/04/06',' ');