i) City_Climate ( City , Climate, Week) [This relation shows the climate of the
ID: 3608178 • Letter: I
Question
i) City_Climate (City, Climate, Week)
[This relation shows the climate of the various cities in thefirst, second, third or fourth week of a month]
City
Climate
Week
Lahore
Sunny
first
Karachi
Hazy
second
Islamabad
Rainy
second
ii) Shop_Sales (Shop_num, Shop, Sales,Week)
[This relation shows the Sales of a particular shop in a soppingplaza]
Shop_num
Shop
Sales (in Rs.)
Week
62
Handicrafts
100000
first
41
Furniture
400000
third
32
Handicrafts
150000
fourth
27
Crafts
150000
third
26
Cutlery
50000
second
Write the SQL queries for the following:
a) Set all the values in theClimate column of City_Climate table to ‘Hazy’
b) Insert a City‘Faisalabad’ with ‘Moisty’ climate in thethird week
c) Change the climate ofIslamabad city in the City_Climate table, to Hazy
d) Displays the type(s) ofshop (handicrafts, cutlery, Furniture etc) from the Shop_Saleswhose sum of sales is greater than 20,000
e) Display the number ofdistinct entries in the Shop_Sales with respect to the column‘Shop’
f) Display the namesof the shops which contains the string 'craft', in Shop_Sales
City
Climate
Week
Lahore
Sunny
first
Karachi
Hazy
second
Islamabad
Rainy
second
Explanation / Answer
a) Update City_Climate set Climate = 'Haxy'; b) insert intoCity_Climate values('Faisalabad', 'Moisty', 'third'); c) UpdateCity_Climate set Climate = 'Hazy'where City = 'Islamabad'; d) select Shop from Shop_Sales where Sales > 20,000; e) selectdistinct Shop from Shop_Sales; f) select * from Shop_SaleswhereShop like '%Craft%'; I hope this will helpu....
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.