Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
72.7k views
in Information Technology by (45.7k points)
closed by

A relation Vehicles is given below :

V_no  Type Company Price Qty
AW125 Wagon Maruti 250000 25
J0083 Jeep Mahindra 4000000 15
S9090 SUV Mitsubishi 2500000 18
M0892 Mini van Datsun 1500000 26
W9760 SUV Maruti 2500000 18
R2409 Mini van Mahindra 350000 15

Write SQLcommands to:

a. Display the average price of each type of vehicle having quantity more than 20.

b. Count the type of vehicles manufactured by each company.

c. Display the total price of all the types of vehicles.

1 Answer

+2 votes
by (45.0k points)
selected by
 
Best answer

a. select Type, avg(Price) from Vehicle group by Type having Qty>20;

b. select Company, count(distinct Type) from Vehicle group by Company;

c. Select Type, sum(Price* Qty) from Vehicle group by Type;

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...