carsales management group4
TRANSCRIPT
-
7/25/2019 CarSales Management Group4
1/3
Problem Description
Car Sales Management System
The Car sales management system that provides some basic
information related to Cars, like car company details, car modelnumber, dealer details, customer details, car price, car specication.
The application is used by the following user groups:
Car Company
Car Dealers &
Customers
ew Table structures are given below,
Company:
Column Name Data Type &
Size
Constrain
ts
Description
compid !archar"#$% rimary
'ey
(ni)ue *D for Car
Companycompname !archar"#+% -ame of the Companyhead)uarters !archar"#+% ead)uarters of the
companycontactno -umber#+% Contact -umber of
Companyemailid !archar"#"% /0cial mail1*D of
Companydescription !archar"#$% Description of the
Company
Model:
Column Name Data Type &
Size
Constrain
ts
Description
modelid !archar"#$% rimary
'ey
(ni)ue *D for Car 2odel
modelname !archar"#+% -ame of the Car 2odel
year -umber#3% 4ear of 5aunchtype !archar"#+% Type of Carprice -umber#+% rice of the Carcompid -umber#$% oreign
'ey
67isting Compid in
Company Table
Dealer:
-
7/25/2019 CarSales Management Group4
2/3
Column Name Data Type &
Size
Constrain
ts
Description
dealerid !archar"#$% rimary
'ey
(ni)ue *D for Car Dealer
dealername !archar"#+% -ame of the Car Dealer
dealerlocation -umber#3% 5ocation of Dealershiptype !archar"#+% oreign
'ey
67isting type in 2odel
Tablecompid -umber#$% oreign
'ey
67isting Compid in
Company Table
Customer:
Column Name Data Type &
Size
Constrain
ts
Description
customerid !archar"#$% rimary'ey
(ni)ue *D for CarCustomer
customername !archar"#+% -ame of the Customerpurchasedate -umber#3% Date of urchasestatus !archar"#+% 8tatus#9ooked,
6n)uired, purchased%dealerid !archar" #$% oreign
'ey
67isting dealerid in
Dealer Tablemodelid !archar"#+% oreign
'ey
67isting modelid in
2odel Table
/ther Constraints to be given as applicable.
Write SQL Queries or t!e scenarios listed belo"# $Ma%imum Mars:
'()
*# Display t!e Dealers+D, Location, Company name, price "!o
deal "it! Car Model - .+nno/a0#1# Display t!e purc!ase date, type o car, price, dealer +D o t!e
customer-02o!n0#3# 4etrie/e all petrol cars rom dealer +D - .D*((1#0
'# Write a 5uery to update t!e price o all Petrol cars by 67 & allDiesel cars by *(7#
8# 4etrie/e all t!e cars in t!e increasing order o t!eir Price &
decreasing order o Dealer+D9# Create t!e Table Company "!ere company +D must not be let
blan and it s!ould not accept duplicate /alues#
-
7/25/2019 CarSales Management Group4
3/3
6# Write a SQL Query to alter t!e size o description column to
*((## 4etrie/e t!e Car model details lie compname, model name,
price using ;oin "!ic! are in t!e range bet"een *(la!s to
*8la!s#