Question

Retrieve the details of vehicles whose total service cost exceeds ₹50,000.

08 Aug 2026
Answer :
Word Count : 1125
The requirement to retrieve the details of vehicles whose total service cost exceeds ₹50,000 is a common database query problem in a DBMS and C++ Lab. It involves storing vehicle information, maintaining service records, calculating the total service cost for each vehicle, and displaying only those vehicles for which the accumulated service expenditure is greater than ₹50,000. This type of query demonstrates the practical use of relational tables, aggregate functions, grouping, joins, and the `HAVING` clause in SQL. A suitable database design can contain two related tables: `Vehicle` and `Service`. The `Vehicle` table stores basic information about each vehicle, while the `Service` table stores individual service transactions. For example, the `Vehicle` table may contain attributes such as `Vehicle_ID`, `Vehicle_No`, `Vehicle_Model`, `Owner_Name`, and `Vehicle_Type`. The `Service` table may contain `Service_ID`, `Vehicle_ID`, `Service_Date`, `Service_Type`, and `Service_Cost`. The `Vehicle_ID` acts as the primary key in the `Vehicle` table and as a foreign key in the `Service` table. An example structure can be represented as follows: ```sql CREATE TABLE Vehicle ( Vehicle_ID INT PRIMARY KEY, Vehicle_No VARCHAR(20), Vehicle_Model VARCHAR(50), Owner_Name VARCHAR(50), Vehicle_Type VARCHAR(30) ); CREATE TABLE Service ( Service_ID INT PRIMARY KEY, Vehicle_ID INT, Service_Date DATE, Service_Type VARCHAR(50), Service_Cost DECIMAL(10,2), FOREIGN KEY (Vehicle_ID) REFERENCES Vehicle(Vehicle_ID) ); ``` The service table can contain multiple records for the same vehicle because a vehicle may be serviced many times. For example, a vehicle with `Vehicle_ID = 101` might have service costs of ₹15,000, ₹20,000, and ₹25,000 on different dates. Its total service cost would therefore be ₹60,000. Since ₹60,000 is greater than ₹50,000, the vehicle must be included in the result. The SQL query to retrieve the required vehicle details is: ```sql SELECT v.Vehicle_ID, v.Vehicle_No, v.Vehicle_Model, v.Owner_Name, v.Vehicle_Type, SUM(s.Service_Cost) AS Total_Service_Cost FROM Vehicle v JOIN Service s ON v.Vehicle_ID =
___ _____ _____ ________ _____ ___ ________ __________ ____.
___ _____ ____ ____ _____ _________ ___ ________.
________ _________ ___ ___ ___ _____ _____ ________ ________ _________ ___ ____.
_______ _____ ________ _____ ______ _______ ______ ________ __________ _______.
_______ _________ ___ __________ ____ __________ _______ ___ __________.
___ ____ ____ _____ _____ _______ __________.
____ ____ ________ ____ _________ _______ ___ __________ _________.
____ _____ ____ ____ __________ ________ _______ _________ ___ ________ _______.
_____ ____ ____ ________ ___ ____ _______ ______ ___ _______ ______ ____.
_______ _____ _____ ____ _______ _________ _____ _________ _________ ___.
_____ ____ _______ ___ _________ __________ _________ _____ ____ ____ ______ _____.
_________ ______ ____ _________ ________ ________.
________ _____ ___ _______ ____ ____ ________.
_______ ___ _________ _________ ____.
____ ________ _______ _________ __________ ________.
________ _______ ____ ___ ____ ___.
_________ _____ ________ ________ _____ ________ ___.
__________ _______ _________ ________ __________ ____ _______.
_________ _____ _______ ____ ______ _________ ________.
___ _________ ________ ______ ______ __________ _________.
____ ____ ____ ___ ___ _____ ______ _________.
____ ________ _______ __________ __________ _______ _______ _________ __________ ______ _____.
____ _________ _______ _________ _______ _____ _________ ______ _______.
__________ ___ ___ ______ ________ ________ _______ ________.
____ ______ _______ ____ _______ _____ ________ __________ ________ _________ ____.
_______ ___ ____ _________ _____ ________ ________ ______ ____ ______.
________ _______ _______ _______ ___ ______ ________ _____.
________ ______ _____ ______ ________ _______ __________ _________ ______ ________ __________ _________.
_____ ___ ____ __________ __________ _______ _________ ________ ________.
___ ______ __________ ______ __________ _________ _________ ____.
___ _____ _______ _________ ___ _________ _______ ____ _____ ________ __________.
________ ______ ____ _____ _____ ___ ___.
_________ ___ ___ __________ ________ _________ ____ ____.
_____ _______ ___ ___ _______ __________ ________ _______ ___.
______ _________ ________ _________ __________ _____ ___ ______ _____ ____ ___.
_________ __________ __________ ________ ________ ___ ____ ______.
________ ________ ______ ___ ________ ______ ____ ___ _____ _______ ______.
__________ _______ ______ _____ ______ _______ ________ ______ ________ _______ __________ __________.
________ ____ _______ ____ _____ _____ ______ _____.
_______ ________ ________ _______ ________.
________ __________ __________ _________ _____.
____ _________ ______ ______ _____ _______ _______.
_________ ________ _______ _________ __________ __________ ___ ____ _______ _______ _____.
____ ___ _________ _____ _____ ____ _________ _________.
______ _________ ___ _________ ______ ___ _________ ______ ______.
_______ ______ _________ __________ ______ _______.
______ ___ ________ ____ ________ ______ ____ _____ _________ _______.
_________ ___ ___ _________ _____.
____ ______ _______ ___ _________ _________.
_____ __________ _____ _____ ______.
__________ _________ ____ ______ _________ _____ _________ ______ _________ _________ ____ ______.
_____ ______ ___ __________ _______ ___ _________ __________ ______ _________ ___ _____.
______ ___ ________ ___ ____ __________ ________ ________ _____.
_______ __________ _____ __________ ________ ___ _______ _________ ________ __________ ____.
___ ____ ____ ______ ____ _______.
__________ ___ ____ _______ _______ ______ ________ _________ _________ ________ ______ _____.
________ _______ _______ _____ __________ ______.
______ ____ ______ ____ _______ __________ _______ _________ ___ _____ ______.
_________ ____ ________ ___ ______ ________ ____.
________ ________ _______ ____ ______ ______ ___ _________ _______.
_____ ________ ______ __________ _____ __________ _______ __________ ____ _________ _________ ___.
______ ____ ____ __________ ___ ______ _________ ___.
__________ ____ ________ ____ ________ _______ _______ _________.
_______ ________ ____ _______ ________ ______ _______ _____ ___ _____ ____ _________.
________ __________ ______ _____ __________ ________ _____.
_____ __________ ___ _______ __________.
_________ ____ ____ _______ ________ ____ ___ ________ ___ ___ ________ ___.
________ ___ ______ ___ ___ ___ _____.
_____ ______ _____ _________ _________ __________ _______ _____ __________.
______ _______ ___ _________ _____ _______ ____.
______ _______ __________ ______ ____ _________ ________.
_______ ________ ________ ________ _____ ____ _________ _______ ______ _____ _____ ___.
_______ ______ _____ _________ ________ ______.
____ __________ ____ ________ _____ ___ _______ ____ _______ _____ _____.
________ ___ _____ ___ __________ _____ ___ ___.
____ ________ ___ __________ _________ __________ _________ _______ ___.
__________ _______ ________ ______ ___ __________ ______ _____ ________ ____ _________.
____ ________ ______ _____ _______ ___ ___ ______ ______ _______ ________ ___.
_________ ____ ______ ________ ____ _________ ___.
_____ _______ _________ _________ __________ ________ ___ ___.
_____ _____ ___ _______ _______ _______ _______.
______ _______ _____ ______ ____ _____ _______ ________ ___ _______.
_______ __________ ___ ________ _____ ____ _____ ______ ________ ___ _____ ___.
_________ ______ __________ _______ ___ __________ ___ _____ ____ _______.
_________ __________ ___ ____ _______ ___.
____ ______ ____ __________ __________ _______ _______ ______ _____ __________ __________ ____.
_____ ______ _________ ________ _____ ________.
___ _________ _____ ________ ________ ___ _______ ______ _________.
______ ________ ______ __________ ____ _____ _______ _______ ____ _____ ______ _________.
___ ______ ________ _____ ________ _________ ________ _____ ____ ____ ___ _____.
_____ __________ ____ ____ __________ _________.
______ ___ ____ ________ ______ _________ _____ _____ ______ ___.
_________ _______ __________ _________ ________ ______.
________ _________ __________ ____ ___ _________.
_________ ______ _____ ___ __________ ___ ___ _________ ____ _____.
____ _______.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU BCSL 135 2026 2027 - Retrieve the details of vehicles whose total service cost exceeds ₹50, | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→