Você está na página 1de 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 model
number, dealer details, customer details, car price, car specification.
The application is used by the following user groups:

Car Company
Car Dealers &
Customers

Few Table structures are given below,


Company:
Column Name
compid

Data Type
Size
Varchar2(5)

compname
headquarters

Varchar2(10)
Varchar2(10)

contactno

Number(10)

emailid

Varchar2(20)

description

Varchar2(50)

Model:
Column Name
modelid

Data Type
Size
Varchar2(5)

modelname
year
type
price
compid

Varchar2(10)
Number(4)
Varchar2(10)
Number(10)
Number(5)

Dealer:

& Constrain
ts
Primary
Key

Description

& Constrain
ts
Primary
Key

Description

Foreign
Key

Unique
ID
for
Car
Company
Name of the Company
Headquarters of the
company
Contact
Number
of
Company
Official
mail-ID
of
Company
Description
of
the
Company

Unique ID for Car Model


Name of the Car Model
Year of Launch
Type of Car
Price of the Car
Existing
Compid
in
Company Table

Column Name
dealerid

Data Type
Size
Varchar2(5)

dealername
dealerlocation
type

Varchar2(10)
Number(4)
Varchar2(10)

compid

Number(5)

Customer:
Column Name
customerid

Data Type
Size
Varchar2(5)

customername
purchasedate
status

Varchar2(10)
Number(4)
Varchar2(10)

dealerid

Varchar2 (5)

modelid

Varchar2(10)

& Constrain
ts
Primary
Key
Foreign
Key
Foreign
Key

& Constrain
ts
Primary
Key

Foreign
Key
Foreign
Key

Description
Unique ID for Car Dealer
Name of the Car Dealer
Location of Dealership
Existing type in Model
Table
Existing
Compid
in
Company Table

Description
Unique
ID
for
Car
Customer
Name of the Customer
Date of Purchase
Status(Booked,
Enquired, purchased)
Existing
dealerid
in
Dealer Table
Existing
modelid
in
Model Table

Other Constraints to be given as applicable.


Write SQL Queries for the scenarios listed below. (Maximum Marks:
40)
1. Display the DealersID, Location, Company name, price who
deal with Car Model = Innova.
2. Display the purchase date, type of car, price, dealer ID of the
customer=John.
3. Retrieve all petrol cars from dealer ID = D1002.
4. Write a query to update the price of all Petrol cars by 7% & all
Diesel cars by 10%.
5. Retrieve all the cars in the increasing order of their Price &
decreasing order of DealerID
6. Create the Table Company where company ID must not be left
blank and it should not accept duplicate values.

7. Write a SQL Query to alter the size of description column to


100.
8. Retrieve the Car model details like compname, model name,
price using join which are in the range between 10lakhs to
15lakhs.
9. Create an index on modelno column of the model table.
10.
Create a view that consists of modelname & price that
was manufactured during the year 2000-2010.
11.
Display the car model name & price of each car company
with the highest price.
12. Retrieve the customer details who has purchased any car
model.

Você também pode gostar