English

Consider the table ORDERS as given below: O_ID 100110021003 C_Name Jitendra Mustafa Dhwani Product Laptop Smartphone Headphone Quantity 1 2 1 Price12000 10000 1500 - Computer Science (Python)

Advertisements
Advertisements

Question

Consider the table ORDERS as given below:

O_ID  C_Name Product Quantity Price
1001 Jitendra Laptop 1 12,000
1002 Mustafa Smartphone 2 10,000
1003 Dhwani Headphone 1 1,500

Note: The table contains many more records than shown here.

Write the output

(I) Select c_name, sum(quantity) as total_quantity from orders group by c_name;
(II) Select * from orders where product like '%phone%';
(III) Select o_id, c_name, product, quantity, price from orders where price between 1500 and 12000;
(IV) Select max(price) from orders;

Answer in Brief

Solution

I. 

C_Name Total_Quantity
Jitendra 1
Mustafa 2
Dhwani 1

II. 

O_Id C_Name Product Quantity Price
1002 Mustafa Smartphone 2 10,000
1003 Dhwani Headphone 1 1,500

III. 

O_Id C_Name Product Quantity Price
1001 Jitendra Laptop 1 12,000
1002 Mustafa Smartphone 2 10,000
1003 Dhwani Headphone 1 1,500

IV. 

MAX(Price)
12,000
shaalaa.com
  Is there an error in this question or solution?
2024-2025 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×