Question

 Display the mechanic name along with the total number of vehicles serviced by each mechanic.

08 Aug 2026
Answer :
Word Count : 876
In a database system used by a vehicle service centre, the information about mechanics and the vehicles serviced by them is generally stored in related tables. To display the mechanic name along with the total number of vehicles serviced by each mechanic, SQL aggregate functions can be used with the `GROUP BY` clause. The `COUNT()` function is particularly useful because it counts the number of records associated with each mechanic. Suppose the database contains two tables: `Mechanic` and `Vehicle`. The `Mechanic` table may contain attributes such as `Mechanic_ID` and `Mechanic_Name`, while the `Vehicle` table may contain `Vehicle_ID`, `Vehicle_Number`, and `Mechanic_ID`. The `Mechanic_ID` acts as a common attribute and establishes a relationship between the two tables. A suitable SQL query is: ```sql SELECT m.Mechanic_Name, COUNT(v.Vehicle_ID) AS Total_Vehicles_Serviced FROM Mechanic m JOIN Vehicle v ON m.Mechanic_ID = v.Mechanic_ID GROUP BY m.Mechanic_Name; ``` Here, `m` and `v` are aliases for the `Mechanic` and `Vehicle` tables respectively. The `JOIN` operation combines records from both tables where the `Mechanic_ID` in the two tables is the same. This allows the database to associate every serviced vehicle with the mechanic responsible for servicing it. The `COUNT(v.Vehicle_ID)` expression counts the vehicles associated with each mechanic. The result is given the alias `Total_Vehicles_Serviced`, which makes the output easier to understand. The `GROUP BY m.Mechanic_Name` clause groups all records ______ ________ _________ ________ ___ ___ _____ ________ _________.
______ ___ ___ __________ ________ ______.
______ _______ ________ ___ ____.
_________ _______ ____ _____ _______ ___ ____ _________ _________ ______ __________.
__________ ________ ______ ___ _________ _______ _________ _________.
_____ ______ ____ _____ ______ _________ ______ __________ _____ __________.
_______ ____ ________ __________ _____ _________ __________.
_______ _____ _____ ______ ____ ______ _______ ___ ________ __________ _______.
__________ _____ _____ ____ ___ _________ _____ ______ _________ ___.
_______ ______ ____ _________ _____ ________.
_________ ______ _____ ____ _________ _____ ___ ____ __________ __________ _____.
_________ ______ ________ _____ _______ _________ _________ ____.
______ _________ ____ ____ _____.
_________ ________ ________ _____ _______ ___ ______ ___ _______ _____ _____.
__________ __________ ________ ___ ___ _________ ______ ___ ____ ______.
_____ ________ ________ _________ __________ _____ ______ _________ __________.
______ ______ _________ ________ ______.
________ ________ _______ ____ ________ _________ ______ _________.
______ __________ _________ ________ _________ ______ _____ ________ ________.
_________ ________ _________ _______ ____.
_____ ___ ________ ____ ________ _________ ______ ____.
________ ________ _________ ____ ____ _____ __________.
________ _________ ___ _______ ___ ____ _________ ___ __________ _____.
__________ _____ _________ _____ _____ ________.
___ ____ ______ ______ ____ ________ ________.
__________ _____ _____ ________ ____ _______ __________ ______ _____ ________ _________.
________ ____ _____ _______ ________ ______ ________ ____ ______ __________.
______ _________ _________ ______ ______ ___ _____ _________ ____.
____ _________ _______ ______ ________ _________ ___ ______.
_____ ______ _________ ________ _____.
_____ ____ _______ _________ ______ __________ ________ ___ _______.
___ __________ _____ ________ __________.
______ _________ __________ _________ ___ ___ _______ ________.
________ _____ ___ ______ __________ ________ _______ __________ ____ _________ ________.
___ _________ _____ __________ ____ ____ ________ ________ _________ ________ _______ __________.
______ ______ __________ __________ _________ _______ ______ ___ __________ ___ ________ ________.
_______ ____ ______ __________ _____ _________ ___.
________ _____ ___ ________ _____ ___ ___ ___ ___ ___.
______ ___ ___ ___ _______ _____ _________ _______ __________ _________ ____.
______ _______ _______ ________ _______ ______ ______ _______.
____ __________ __________ ________ ____.
_________ _____ _______ _________ ____ ____ _____ _______ ___ ________ _________.
__________ ________ _____ _________ ______ ________ _________ _________ _____ __________ ______.
___ ______ ______ ______ __________ ___.
________ _____ ________ __________ _________ _______ ________ __________ ______.
___ _____ _____ _________ ____.
_______ _______ __________ _____ _____ _____ __________ ____ ________ _______.
_____ _____ ________ _______ _____ ____ ______ ________.
_______ ________ ______ _____ _____ _____ ______ ___.
_________ ___ _________ ____ _________ ______ ______ _____ ________ ________.
____ _________ _______ ____ _____ ____ ______ ________.
_________ ______ ____ ______ ___ ______ ______ ______ ______ _____ ______.
__________ ______ __________ ___ ____ ____.
______ _________ ________ ________ _______.
_______ _______ ___ _________ _________ ______ _______ ________ ____ ____.
_______ ___ _______ ________ _________ _______ __________ ________.
_________ ____ ___ _______ _______ _______ __________.
_________ __________ ____ ___ _______ ___ ________ ___ __________.
______ __________ ________ ________ __________ _________ _____ ___ _______ ____.
____ ______ _____ ___ _______ ____.
_________ ____ _____ ____ ______ __________ _____ ___ ________ ____ __________ ________.
___ _____ _________ ________ ___ ___ ______.
___ _________ ________ _____ ________ ________ ________ ________ ______.
______ _________ ___ ______ ____.
_____ _________ ___ ____ __________ ____ _____ ____ ______ _________ ____.
________ _____ _______ _______ _____ ________.
_____ _________ ________ ___ _______ ______ ________.
___ _____ ________ _____ ______ _____ ______.
__________ ____ __________ _____ _____ _______.
___ _____ __________ _______ ___ _________ ___ _________.
________ _______ _____ ____ ___ ___ _______.
______ _______ ________ ______ ___ ___ _____.
____ ___ ____ _____ ___.
______ ___ ______ _________ ________ _________.
_______ __________ __________ _________ ___.
_______ ____ _______ __________ ________ ________ ____ _____ _______.
_______ ____ _________ ____ _______ ________.
_______ ________ _______ ________ _____ ______ _____ ______ ___ ___ ___.
______ _______ ___ _____ ______ ____.
_______ _______ ___ _________ ____ ________.
_______ _________ ______ _________ ________ ___ _______ ________ ______.
___.
Get Full Answer on WhatsApp
IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance  Display the mechanic name along with the total number of vehicle
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→