Database systems project report
-
Upload
mohammad-rahmat -
Category
Engineering
-
view
490 -
download
4
Transcript of Database systems project report
Database SystemsTERM PROJECT
Group Members
1. Mohammad Rahmat
2. Furkan Zumrut
3. Emin Avukat
4. Metin Tekin
5. Muhammet Samil Altin
Project Details
Car dealer company database:
Require information about car stock
Require information about details
Require information about visual looks
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
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
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
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
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
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
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
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
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)
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
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
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
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
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
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
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
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
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
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
Constraints
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
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
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.
Relationships
autofuel Entity:
@One-to-Many
Auto(autofuelid):
one fuel many cars
autogear Entity:
@One-to-Many
Auto(autogearlid):
one gear many cars
Relationships
autorim Entity:
@One-to-Many
Auto(autorimid):
one rim many cars
autotire Entity:
@One-to-Many
Auto(autotireid):
one tire many cars
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
Concept Of Database
Database Entity Relationships
E-R Diagram
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
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