Baze de date
Utilitateaiilor/vederilor utilizatorUtilitatea Proiectiilor/vederilor utilizator O ultima etapa in proiectarea logica o reprezinta integrarea vederilor utilizatorilor, prin care se obtine modelul de date logic al bazei de date. Aceasta faza cuprinde subfazele de combinare ale evderilor utilizator, integrarea cu modelele existente de date si analizele privind stabilirea si posibilitatea dezvoltarii ulterioare. Combinarea vederilor utilizator presupune punerea de acord a diferitelor functii definite in vederi si a diferitelor grupuri de utilizatori cu identificarea notiunilor si relatiilor comune, eventual purtand nume diferite, a valorilor derivate, a constrangerilor de reprezentare, a regulilor de acces la date, etc. Pentru partile comune unor vedri trebuie rezolvate probleme legate de conflicte, de posibile inconsistente si de stabilire a unor relatii noi de legatura intre vederi pentru a obtine modelul logic de date compus. Integrarea cu modelele existente de date presupune examinarea raportului dintre modelul logic rezultatin raport cu modelele dezvoltatein alte scopuri. Se pot detecta zone comune si unele inconsistente in raport cu alte modele, care permit sau nu modificarea pentru a rezolva aceste probleme.
CNPA varchar(32), Tip_Apel varchar(32), Data Datetime, PRIMARY KEY (CNPA,Data)) /*cheia primara*/ GO /* Clientul rezerva masa la restaurantul cu un anumit specific */ CREATE TABLE RezervaM ( CNP varchar(32), Hotel_ID int not null, Specific varchar(32), Data Date, PRIMARY KEY (CNP,Hotel_ID,Specific), /*cheia primara*/ FOREIGN KEY (CNP) REFERENCES Client, /*cheia straina */ FOREIGN KEY (Hotel_ID,Specific) REFERENCES Restaurant) /*cheia straina */ GO /* Clientul rezerva o camera la hotel */ CREATE TABLE RezervaA( CNP varchar(32), Hotel_ID INT Not Null, Data_cazarii DATE, Camera INT Not null, PRIMARY KEY (CNP,Hotel_ID,camera,Data_cazarii), /*cheia primara*/ FOREIGN KEY (CNP) REFERENCES Client, /*cheia straina */ FOREIGN KEY (Hotel_ID,camera) REFERENCES Apartament) /*cheia straina */ GO /* Popularea entitatilor */ delete from oferte delete from ag_turism delete from restaurant delete from apartament delete from angajat delete from client delete from manager delete from Hotel insert into Hotel values(1,'Majestic','www.majestic.com','Cluj',5,'0729823612') insert into Hotel values(2,'Intercontinental','www.intercont.com',' insert into Hotel values(3,'RexPark','www.rexPark.com','Dej',3,'0728432345') insert into Hotel values(4,'Athos','www.athos.com','Bucuresti',5,'0789321342') insert into Hotel values(5,'Confort','www.confort.com',' insert into Hotel values(6,'Opera','www.opera.com','Bucuresti',4,'0744790073') insert into Hotel values(7,' insert into Hotel values(8,'Carol Park','www.CarolPark.com','Suceava',4,'0214347899') insert into Hotel values(9,'Tulip
Inn','www.tulipInn.com',' Select * From Hotel insert into ag_turism values('Alfatour',' insert into ag_turism values('Betatour',' insert into ag_turism values('Gamatour','Ungaria','Budapesta','0743234433') insert into ag_turism values('Infinity
Travel',' insert into ag_turism values('Giulia
Tour',' insert into ag_turism values('Ellada Travel','Grecia','Atena','0731435331') Select * From ag_turism insert into restaurant values(1,'Italienesc',34) insert into restaurant values(3,'Chinezesc',15) insert into restaurant values(3,'Grecesc',26) insert into restaurant values(4,'Frantuzesc',41) insert into restaurant values(5,'Thailandez',33) insert into restaurant values(5,'Portughez',19) insert into restaurant values(5,'Maghiar',22) insert into restaurant values(6,'Ardelenesc',31) insert into restaurant values(6,'Grecesc',37) insert into restaurant values(7,'Italienesc',28) insert into restaurant values(8,'Frantuzesc',14) Select * From restaurant insert into Oferte values(1,2008,1,11,12) insert into Oferte values(2,2009,2,6,8) insert into Oferte values(3,2008,3,4,5) insert into Oferte values(4,2009,4,2,5) insert into Oferte values(5,2009,5,2,6) insert into Oferte values(5,2008,6,11,12) insert into Oferte values(6,2008,7,9,11) insert into Oferte values(6,2009,8,7,9) insert into Oferte values(7,2009,9,1,5) insert into Oferte values(7,2009,10,6,7) Select * From Oferte insert into Manager values('Grigore Ureche','1772307123143','0264229213') insert into Manager values('Ion Popescu','1822311143134','0623123421') insert into Manager values('Marin Preda','1841122123143','0783213123') insert into Manager values('Anca Banu','2791221133344','0623245613') insert into Manager values('Cristian Cremene','1690212131183','0765323114') insert into Manager values('Dan Zicoane','1670617222133','0765458761') insert into Manager values('Flaviu Pop','1590122143445','0793476513') insert into Manager values('Georgeta Moldovan','1881122123143','0757638541') Select * From Manager insert into Angajat values(1,'Daniel Morar','1740102253771','receptioner',1500) insert into Angajat values(2,'Marius Manasturean','1591224333771','room service',1600) insert into Angajat values(2,'Crina Manzat','2791112253351','portar',1100) insert into Angajat values(3,'Adrian Stoian','1640405453472','sofer',1800) insert into Angajat values(4,'Nicoleta Pop','2780303354768','camerista',1200) insert into Angajat values(4,'Andrei Grecu','1680707423372','sofer',1900) insert into Angajat values(5,'Bogdan Lazar','1710104253173','portar',2100) insert into Angajat values(6,'Mihai Balan','1741101412412','receptioner',1600) insert into Angajat values(6,'Cristina Bob','2841201423374','room service',1900) insert into Angajat values(7,'Ioan Criste','1740915234452','portar',1700) insert into Angajat values(8,'Alexandru Rus','1611115213879','room service',2200) Select * From Angajat insert into Client values('1881021321875',1,130,'10/11/2008','10/14/2008') insert into Client values('2851211321835',2,240,'09/17/2008','10/10/2008') insert into Client values('2801111425865',2,239,'10/19/2008','11/10/2008') insert into Client values('1780911321344',4,450,'06/21/2008','06/30/2008') insert into Client values('2790211431575',4,450,'09/30/2008','10/10/2008') insert into Client values('1611115213879',4,450,'10/28/2008','11/07/2008') insert into Client values('2841201423374',5,120,'03/30/2008','04/10/2008') insert into C
Analiza privind stabilitatea si
posibilitatile de dezvoltare consta in considerarea
schimbarilor viitoare care pot sa afecteze baza de date. Pentru
schimbarile semnificative, inevitabile sau probabile, se prevad
elemente incorporate in modelul logic sau, se face o documentare ce permite realizarea
cu mai multa usurinta a unor schimbari ulterioare.
Scopul este de a asigura o perioada cat mai mare de strabilitate a
modelului logic, perioada in care corectitudinea si utilitatea bazei
de date se mentin la diferite schimbari in scheemle conceptuale, dar
fara sa fie afectat modelul logic.
|