Advertisements
Advertisements
प्रश्न
Consider a table "MYPET" with the following data:
Table: MYPET | |||||
Pet_id | Pet_Name | Breed | LifeSpan | Price | Discount |
101 | Rocky | Labrador Retriver | 12 | 16000 | 5 |
202 | Duke | German Shepherd | 13 | 22000 | 10 |
303 | Oliver | Bulldog | 10 | 18000 | 7 |
404 | Cooper | Yorkshire Terrier | 16 | 20000 | 12 |
505 | Oscar | Shih Tzu | NULL | 25000 | 8 |
Write SQL queries for the following:
- Display the Breed of all the pets in uppercase.
- Display the total price of all the pets.
- Display the average life span of all the pets.
कोड लेखन
उत्तर
SELECT UPPER(Breed) FROM MYPET;
SELECT SUM(Price) FROM MYPET;
SELECT AVG(LifeSpan) FROM MYPET;
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?