COMPE 341 FINAL REPORT BÜŞRA BILGILI EMIRHAN AYDOĞAN MERYEM ŞENTÜRK M. ARDA AYDIN ATILIM UNIVERSITY Department of Computer Engineering
Contents 1. Introduction... 2 1.1. General Information... 2 1.2. Description of the Problem... 2 1.3. Current Situation... 2 2. Requirement Analysis... 3 3. Conceptual Design... 4 4. Logical Design... 5 4.1. Logical Schema... 5 4.2. Normalization... 5 5. Database Choice & Implementation... 6 5.1. Creation of the Tables... 6 5.2. Sample Data Loading... 8 5.3. Sample Data Queries...10 6. Interfaces...13 Member Registration Screen:...13 Member Listing Screen:...14 Donation List Screen:...14 Donation Entry Screen:...15 1
1. Introduction 1.1. General Information We will develop database system for an organization, titled Altınpark Engelliler Derneği that aims to create a community for disabled people; to educate people to increase awareness the issues disabled people suffer in everyday life, to organize workshops and seminars to disabled people to make them become self-sufficient, and as well as to help financially. The information can be summarized as follows: Organization Name Website Contact Person Address Altınpark Engelliler Derneği (APED) www.aped.org.tr Taner Ünsal Altınpark Mah. Mahmut Şevket Paşa Cad. 15/A, ALTINDAĞ/ANKARA 1.2. Description of the Problem The organization does not have a database on electronic environment. It is not only mandatory for organizations to have databases migrated to electronic environment but also it is a necessity for the organization to get rid of current problems such as being unable to search for data of registered members in a fast way, having issues with making hard-copies of available data, having difficulties to keep track of members, being unable to alter existing data quickly and being unsure about the safety of the data. In addition, the organization has issues when it comes to managing events and donations. 1.3. Current Situation Currently, the organization keeps their data as hard-copies that is on files and folders. Each member of the organization has a separate file that contains related information such as name, surname, birth date, address and etc. Additionally, organization keeps events-related information as hard-copy files. The other information that is stored as hard-copy is related to donations, donation sources. 2
2. Requirement Analysis The expectations from developed system is to store members of the organization with related information, as well as data regarding donations, events. The system will be used to manage members, events, donations, too. The information the organization s website has been used to understand the data that is requried to be stored about the members, via member application form, which includes name, surname, and so forth as well as some information regarding handicapness status of the applicant. Data regarding events and donations have been provided by the organization, and it is learnt that donations may have two different sources, one being an individual and the other one as a company, where it is possible to have different kind of donations such as money, wheel-chair, etc. According to information given, the events are managed by the administrators and contains simple data such as title, date and description. We have asked some questions to administration of organization. The first question was about the reasons to migrate into an electronic database system. According to their answers, database system is a neccessary for their work as they have many data about members to be stored as well as other information such as events, donations and etc. as stated previously. Then, we have discussed about benefits of using a database. The authorized personnel replied that such a database would help them maintain their organization in a better way that would be helpful for the members and administrators. Finally, we have discussed about which type of data they want to keep in database system. They want to keep data of all members, administration, information related to events and donations as well as donation sources. Overall, it can be said that we have to keep the data in relevant tables with required information that is to be provided in the following parts of the report. 3
3. Conceptual Design 4
4. Logical Design 4.1. Logical Schema Based on the E-ERD, the design has been mapped to logical schema as follows: Üyeler (TCNo, ÜyeNo, Ad, Soyad, Yaş, Engel%, Tel., Adres, AileBilgileri, Açıklama) Yönetici (TCNo, Ad, Soyad, İşeGirişTarihi, Statü) Etkinlik (EtkinlikNo, İ sim, Tür, Açıklama, Tarih) Bağış Kaynağı (ID) Bağış (BağışNo, YöneticiTCNo (F.K. refers to Yönetici), BağışKID (F.K. refers to Bağış Kaynağı), Tür, Miktar, Tarih) Kişi (TCNo, Ad, Soyad, Adres, Tel, BağışKID (F.K. refers to Bağış Kaynağı)) Şirket (VergiNo, Ad, Adres, Tel., BağışKID (F.K. refers to Bağış Kaynağı)) EtkinlikDüzenle (YöneticiNo (F.K. refers to Yönetici), EtkinlikNo (F.K. refers to Etkinlik)) EtkinlikKatıl (ÜyeTCNo (F.K. refers to Üyeler), EtkinlikNo (F.K. refers to Etkinlik)) 4.2. Normalization 1NF: None of the tables contain multi-valued attirbute, that is all attributes are atomic, thus in 1NF. 2NF: No partial functional dependency in any of the tables, thus in 2NF. 3NF: All non-prime attributes in the tables are directly dependent on prime attributes, thus in 3NF. BCNF: - Üyeler, Yönetici, Etkinlik, Bağış Kaynağı, Kişi, Şirket tables have primary keys that are not composite and only CKs of respective tables, thus in BCNF. - Primary Key of Bağış table is composite but it is the only candidate key, thus in BCNF. - Primary Keys of EtkinlikDüzenle and EtkinlikKatıl are composite and has overlap of EtkinlikNo but they are the only candidate keys, thus in BCNF. 5
5. Database Choice & Implementation As database, MySQL has been chosen due to its ease of use and a better choice when to be used with PHP. It also has more support by the hosting services, when compared to Oracle. 5.1. Creation of the Tables create table Uyeler( TCNo varchar(11) primary key, UyeNo int unique, Ad varchar(25), Soyad varchar(25), Yas int(2), EngelYuzdesi int(3), Adres varchar(50), AileBilgileri varchar(30), Aciklama varchar(50), Tel varchar(15)) create table Yonetici( TCNo varchar(11) primary key, Ad varchar(25), Soyad varchar(25), IseGirisTarihi date, Statu varchar(20)) create table Etkinlik( EtkinlikNo varchar(10) primary key, Isim varchar(25), Tur varchar(10), Aciklama varchar(50), Tarih date) 6
create table BagisKaynagi( ID varchar(10) primary key) create table Bagis( BagisNo varchar(15), YoneticiTCNo varchar(11), BagisKID varchar(10), Tur varchar(10), Miktar int, Tarih date, primary key (BagisNo, YoneticiTCNo, BagisKID), foreign key (YoneticiTCNo) references Yonetici(TCNo), foreign key (BagisKID) references BagisKaynagi(ID)) create table Kisi( TCNo varchar(11) primary key, Ad varchar(25), Soyad varchar(25), Adres varchar(50), Tel varchar(15), BagisKID varchar(10), foreign key(bagiskid) references BagisKaynagi(ID)) 7
create table Sirket( VergiNo varchar(15) primary key, Ad varchar(25), Adres varchar(50), Tel varchar(15), BagisKID varchar(10), foreign key(bagiskid) references BagisKaynagi(ID)) create table EtkinlikDuzenle( YoneticiNo varchar(11), EtkinlikNo varchar(10), primary key(yoneticino,etkinlikno), foreign key(yoneticino) references Yonetici(TCNo), foreign key(etkinlikno) references Etkinlik(EtkinlikNo)) create table EtkinlikKatil( UyeTCNo varchar(11), EtkinlikNo varchar(10), primary key(uyetcno,etkinlikno), foreign key(uyetcno) references Uyeler(TCNo), foreign key(etkinlikno) references Etkinlik(EtkinlikNo)) 5.2. Sample Data Loading Note that Uyeler contains 10 data and other tables contain less than 10 records due to lacking information that is not properly provided by the organization. Yonetici table contains 2 records as there are 2 predefined records (Manager and Vice Manager), Etkinlik has 5 records (the amount of events organized so far is 5). Due to insufficient information regarding donations and donation sources (the organization preferred to keep related information confidential for this time), only a limited number of records have been inserted. EtkinlikDuzenle and EtkinlikKatil were relationship that needed to get mapped during previous step which do not contain any known information due to related events being past already. 8
insert into Uyeler values(87745873480,21,'ali','duven',35,20,'tip fakültesi cad. toprak sk. no:19/16','esi: Nuriye Düven','Yürüme Engelli','03123645698'); insert into Uyeler values(12829117604,15,'ferhat','çelebi',25,40,'john F. Kennedy Cd. 17/29','Baba: Faik Çelebi 05063298740','Zihinsel Engelli','05052859467'); insert into Uyeler values(76549801243,2,'kazim','candemir',42,10,'yaprak Sokak, No: 57/2, Küçükesat',NULL,'Yürüme Engelli','05398980908'); insert into Uyeler values(43609327865,34,'vahap','özçelik',65,30,'akin Cd. Bas Sk. 23/4 Yenimahalle','Esi:Feride Özçelik 05673259860','Yürüme Engelli','05674593209'); insert into Uyeler values(12728017925,11,'ayse','altindag',21,40,'baglar Cd. Sami Sk. no:12/6 Keçiören','Anne:Halide Altindag','Görme Engelli','05054322345'); insert into Uyeler values(87458329056,50,'ahmet','dündar',32,20,'kenan Cd. Işık Sk. 92/2 Sincan',NULL,'İşitme Engelli','03124567891'); insert into Uyeler values(12829014965,3,'atilla','canar',48,50,'esin Cd. Tek Sk. 23/2 Akdere','Esi:Nazmiye Canar','Görme Engelli','03124237831'); insert into Uyeler values(12435678945,39,'işık','ilık',58,40,'süt Cd. İç Sk. 23/1 Abidinpaşa','Kızı:Berrak Ilık','İşitme Engelli','03124434537'); insert into Uyeler values(12839045678,40,'ali','atabakan',58,60,'fiş Sk. 191/A Polatlı',Null,'Yürüme Engelli','03120987654'); insert into Uyeler values(12823046578,42,'saniye','dakik',52,40,'saatçi Sk.20/6 Aşağıeğlence','Eşi:Yıldırım Dakik','Görme Engelli','03122347644'); insert into Etkinlik values('p1','bilgisayar Eğitimi','Eğitim','Bedensel Engellilere Bilgisayar Yazılım Eğitimi','01.10.2010'); insert into Etkinlik values('p2','girişimcilik Eğitimi','Eğitim','Bölgesel Dezavantajlı Gençlere Eğitim:Girişimcilik','18.11.2010'); insert into Etkinlik values('e1','çocuk Bakım Projesi','Eğitim','Çocuk Bakımı Eğitimi','08.01.2011'); insert into Etkinlik values('e2','uluslararası Ticaret','Eğitim','Uluslararası Ticaret Eğitimi','05.07.2010'); insert into Etkinlik values('u1','eğitim Kalitesi Arttırımı','Eğitim','Uzaktan Eğitim ile Eğitim Kalitesinin Arttırılması','06.03.2011'); insert into Yonetici values(10984876209,'abidin','candır','01.02.2011','avukat'); insert into Yonetici values(49835293736,'hale','türker','24.07.2010','hr Uzmanı'); 9
insert into BagisKaynagi values('k1'); insert into BagisKaynagi values('ş1'); insert into Bagis values(00002010,10984876209,'k1','t.sandalye',3,'03.05.2011'); insert into Bagis values(00002042,49835293736,'ş1','para(tl)',5000,'13.09.2010'); insert into Kisi values(39875462100,'letafet','çalakalem','pirireis Cd. 6/3, Çankaya','5314986767','K1'); insert into Sirket values(345987000198109,'karakaş İnşaat','GMK Bulvarı, 65/5, Çankaya','3125460908','Ş1'); 5.3. Sample Data Queries Members who are visually impaired with their percentage, name and surname: select ad,soyad,engelyuzdesi as "Engel %" from Uyeler where aciklama like '%Görme%' Donations that are more than 10 in terms of amount done by companies: select b.bagisno, b.tur, b.miktar, b.tarih, s.ad as "Şirket Adı" from bagis b, sirket s where b.bagiskid=s.bagiskid and b.miktar>10 order by b.miktar Donations done by individuals: select b.bagisno, b.tur, b.miktar, b.tarih, k.ad as "Adı", k.soyad as "Soyadı" from bagis b, kisi k where b.bagiskid=k.bagiskid order by b.miktar 10
Members with percentage related their handicap with more than 50%: select ad, soyad, yas, aciklama as "Engel Durumu" from Uyeler where engelyuzdesi>50 Members younger than 40 years old who have the same handicap percentage as the one with visually impaired: select ad, soyad, yas, engelyuzdesi as "Engel %" from uyeler where engelyuzdesi= (select engelyuzdesi from uyeler where aciklama like 'Görme%' and yas<40) Member who have the same handicap condition with those who do not have family information and have handicap percentage of more than 50%: select ad, soyad, engelyuzdesi as "Engel %", aciklama from uyeler where aciklama like (select aciklama from uyeler where ailebilgileri is NULL and engelyuzdesi>50) Wheelchair donations with amount and date information: select b.tur, b.miktar, b.tarih from bagis b, bagiskaynagi k where b.bagiskid=k.id and b.tur like '%Sandalye%' 11
Events in type of training with date and details information: select isim, tarih, aciklama from etkinlik where tur like '%Eğitim%' General information of member whose name start with A and older than 40: select ad, soyad, yas, engelyuzdesi as Engel %, aciklama from Uyeler where ad like A% and yas>40 Members of organizations who have made donations: select u.ad, u.soyad, u.tcno, b.tur, b.miktar, k.tcno from uyeler u, bagis b, kisi k where u.tcno=k.tcno 12
6. Interfaces The screenshots of the interface are as follows: Member Registration Screen: 13
Member Listing Screen: Donation List Screen: 14
Donation Entry Screen: 15