database systems project report
TRANSCRIPT
![Page 1: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/1.jpg)
Database SystemsTERM PROJECT
![Page 2: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/2.jpg)
Group Members
1. Mohammad Rahmat
2. Furkan Zumrut
3. Emin Avukat
4. Metin Tekin
5. Muhammet Samil Altin
![Page 3: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/3.jpg)
Project Details
Car dealer company database:
Require information about car stock
Require information about details
Require information about visual looks
![Page 4: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/4.jpg)
Data Required
Name
name as TEXT data given to each car for ease of data view and to avoid
confusion
Model
model of car as DATE data, given in terms of Gregorian calendar
Condition
condition as TEXT data, showing if car is new or used
0-100 KM Fuel Expense
fuel expense per 100 KM recorded as a DOUBLE data
![Page 5: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/5.jpg)
Data Required
Color
color of the car in the form of TEXT data
Horsepower
the amount of horsepower produced by the engine of the car stored as INTEGER data
Mileage
the distance travelled by car if it is used, zero in case its new – stored as INTEGER value
Price
price of car given in USD ($) stored as DOUBLE data
![Page 6: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/6.jpg)
Data Required
Registered Date
the date that the car was entered to database as DATE value
Type
the type of car stored as TEXT data
Category
the manufacturer name of the car as TEXT data
Sub-Category
the model line of the car as TEXT data
![Page 7: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/7.jpg)
Data Required
Gear
the gear type of the car – automatic or manual – stored as TEXT data
Interior
the interior design of car – either default or custom – stored as TEXT data
Rim
the rims the car has also stored as a TEXT data
Tire
the tire the car currently has, recorded as a TEXT data
![Page 8: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/8.jpg)
Data Required
Photograph
an image of the car stored by URL to hosting site, stored as TEXT data
User
credentials of store employee to manage stock and sales
![Page 9: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/9.jpg)
Entities – their attributes & restrictions
auto ENTITY:
Attributes:
01. autoid – id of car
Constraint – primary key (auto_pkey)
Constraint – NOT NULL
02. auto100km – fuel usage by car per 100 km
Constraint – NOT NULL
03. autocolor – color of the car
Constraint – NOT NULL
04. autohand – condition of car – first hand or second hand (used or new)
Constraint – NOT NULL
![Page 10: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/10.jpg)
Entities – their attributes & restrictions
05. autohp – horsepower of car
Constraint – NOT NULL
06. autokm – mileage of car
Constraint – NOT NULL
07. automodel – model of car
Constraint – NOT NULL
08. autoname – name for car
Constraint – NOT NULL
09. autoprice – price of car
Constraint – NOT NULL
10. autoregisterdate – date car was added to stock
Constraint – NOT NULL
![Page 11: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/11.jpg)
Entities – their attributes & restrictions
13. autotype – type of car
Constraint – NOT NULL
14. categoryid – manufacturer of car
Constraint – foreign key (fk2dddafaaaeeab)
REFERENCES autocategory (categoryid)
Constraint – NOT NULL
15. autofuelid – fuel type of car
Constraint – foreign key (fk2dddafa270b28a)
REFERENCES autofuel (autofuelid)
Constraint – NOT NULL
![Page 12: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/12.jpg)
Entities – their attributes & restrictions
16. autogearid – gear type of car
Constraint – foreign key (fk2dddafa3428ffc)
REFERENCES autogear (autogearid)
Constraint – NOT NULL
17. autointerriorid – interior design of car
Constraint – foreign key (fk2dddafead5dc64)
REFERENCES autointerrior (autointerriorid)
Constraint – NOT NULL
18. autorimid – rim type of car
Constraint – NOT NULL
Constraint – foreign key (fk2dddafe4d91de4)
REFERENCES autorim (autorimid)
![Page 13: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/13.jpg)
Entities – their attributes & restrictions
19. subcategoryid – sucategory of car, model line of car
Constraint – NOT NULL
Constraint – foreign key (fk2dddaf407318a3)
REFERENCES autosubcategory (subcategoryid)
20. autotireid – tires of the car
Constraint – foreign key (fk2dddafb9b7716e)
REFERENCES autotire (autotireid)
Constraint – NOT NULL
![Page 14: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/14.jpg)
Entities – their attributes & restrictions
autocategory ENTITY:
Attributes:
01. categoryid – id of category
Constraint – primary key (autocategory_pkey)
Constraint – NOT NULL
02. categoryname – name of category
Constraint – NOT NULL
![Page 15: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/15.jpg)
Entities – their attributes & restrictions
autofuel ENTITY:
Attributes:
01. autofuelid – id of fuel
Constraint – primary key (autofuel_pkey)
Constraint – NOT NULL
02. autofuelname – fuel type nam
Constraint – NOT NULL
![Page 16: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/16.jpg)
Entities – their attributes & restrictions
autogear ENTITY:
Attributes:
01. autogearid – id of gear
Constraint – primary key (autogear_pkey)
Constraint – NOT NULL
02. autogearname – gear type name
Constraint – NOT NULL
![Page 17: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/17.jpg)
Entities – their attributes & restrictions
autoimage ENTITY:
Attributes:
01. autoimageid – id of image
Constraint – primary key (autoimage_pkey)
Constraint – NOT NULL
02. autoid – car id from auto table
Constraint – foreign key (fk638f010cacd7b9fe)
REFERENCES auto (autoid)
Constraint – NOT NULL
03. autoimageurl – url of image
Constraint – NOT NULL
![Page 18: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/18.jpg)
Entities – their attributes & restrictions
autointerrior ENTITY:
Attributes:
01. autointerriorid – id of interior design
Constraint – primary key (autointerrior_pkey)
Constraint – NOT NULL
02. autointerriorname – name of car interior design
Constraint – NOT NULL
![Page 19: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/19.jpg)
Entities – their attributes & restrictions
autorim ENTITY:
Attributes:
01. autorimid – id of rim
Constraint – primary key (autorim_pkey)
Constraint – NOT NULL
02. autorimname – name of car rim
Constraint – NOT NULL
![Page 20: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/20.jpg)
Entities – their attributes & restrictions
autosubcategory ENTITY:
Attributes:
01. autosubcategoryid – id of subcategory
Constraint – primary key (autosubcategory_pkey)
Constraint – NOT NULL
02. categoryid – id of category from category table
Constraint – foreign key (fkfd684a2faaaeeab)
REFERENCES autocategory (categoryid)
Constraint – NOT NULL
03. autosubcategoryname – name of subcategory
Constraint – NOT NULL
![Page 21: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/21.jpg)
Entities – their attributes & restrictions
autotire ENTITY:
Attributes:
01. autotireid – id of tire
Constraint – primary key (autotire_pkey)
Constraint – NOT NULL
02. autotirename – name of tire
Constraint – NOT NULL
![Page 22: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/22.jpg)
Entities – their attributes & restrictions
user ENTITY:
Attributes:
01. userid – id of user
Constraint – primary key (user_pkey)
Constraint – NOT NULL
02. mail – email address of user
Constraint – NOT NULL
03. namesurname – name and surname of user
Constraint – NOT NULL
04. password – password for logging in
Constraint – NOT NULL
![Page 23: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/23.jpg)
Constraints
![Page 24: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/24.jpg)
Relationships
auto Entity:
@Many-to-One
AutoCategory(categoryid):
many cars one category
AutoFuel(autofuelid)
many cars one fuel
AutoGear(autogearid)
many cars one gear
AutoGear(autogearid)
many cars one gear
![Page 25: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/25.jpg)
Relationships
AutoRim(autorimid)
many cars one rim
AutoSubCategory(subcategoryid)
many cars one subcategory
AutoTires(autotireid)
many cars one tire
@One-to-Many
AutoImages(autoid)
one car many images
![Page 26: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/26.jpg)
Relationships
autocategory Entity:
@One-to-Many
AutoSubCategory(categoryid):
one category many subcategory
Auto(categoryid)
one category many cars
user Entity:
User has no relationship with other tables.
![Page 27: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/27.jpg)
Relationships
autofuel Entity:
@One-to-Many
Auto(autofuelid):
one fuel many cars
autogear Entity:
@One-to-Many
Auto(autogearlid):
one gear many cars
![Page 28: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/28.jpg)
Relationships
autorim Entity:
@One-to-Many
Auto(autorimid):
one rim many cars
autotire Entity:
@One-to-Many
Auto(autotireid):
one tire many cars
![Page 29: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/29.jpg)
Relationships
autoimage Entity:
@Many-to-One
Auto(autoid):
many images one car
autosubcategory Entity:
@Many-to-One
AutoCategory(categoryid):
many subcategories one category
@One-to-Many
Auto(subcategoryid)
one subcategory many cars
![Page 30: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/30.jpg)
Concept Of Database
Database Entity Relationships
![Page 31: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/31.jpg)
E-R Diagram
![Page 32: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/32.jpg)
Web Service to Provide 24/7 Service
The database includes a webservice defined
@http://54.72.196.42:8080/carsales-1.0/ws
The webservice is built through hibernate
framework and includes all the necessary HQL codes
![Page 33: Database systems project report](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a930d91a28ab8d2a8b45c4/html5/thumbnails/33.jpg)
SQL Codes
All sql codes for INSERT, UPDATE, DELETE, ADD can are at the file given
below:
METHOD'S SQL CODES.docx
All sql codes for creation of TABLES are at the file given below:
TABLE'S SQL CODES.docx