0% found this document useful (0 votes)
104 views2 pages

Day 2 SQL Practice

The document contains 15 SQL queries related to a mobile database. The queries retrieve information like mobile models by manufacturer, models by camera quality, number of mobiles sold by date and model, details of mobiles supplied to distributors, mobile details regardless of being sold, distributor details for a specific model, unsold mobile details, highest net amount mobile, mobile prices with tax, models between a price range, details of a specific IME number mobile, mobiles by GPRS and memory capacity, customer details sorted by name, mobile details with discount as 'Not Sold' if unsold, and total sales amount between dates.

Uploaded by

Shikha Chauhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views2 pages

Day 2 SQL Practice

The document contains 15 SQL queries related to a mobile database. The queries retrieve information like mobile models by manufacturer, models by camera quality, number of mobiles sold by date and model, details of mobiles supplied to distributors, mobile details regardless of being sold, distributor details for a specific model, unsold mobile details, highest net amount mobile, mobile prices with tax, models between a price range, details of a specific IME number mobile, mobiles by GPRS and memory capacity, customer details sorted by name, mobile details with discount as 'Not Sold' if unsold, and total sales amount between dates.

Uploaded by

Shikha Chauhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Write a Query to Display the IME Number, Model Name of mobiles which is
manufactured by "Nokia". 

select IME_No, Model_Name from mobile_master where Manufacturer="Nokia";

2. Write a Query to display IME number, Model Name, Manufacturer and Camera Quality of
mobiles whose camera quality is 5MP. 

select m.IME_No,m.Model_Name,m. Manufacturer,s.Camera_Quality from mobile_master


m,mobile_specification s where m.IME_No-s.IME_no and s.Camera_Quality="5MP";

3. "Write a Query to display the Mobile Model Name and respective number of mobiles sold
on the date 23-Apr-2012 for each mobile model. 

Hint: For example, if 2 ""Nokia 1100"" and 1 ""Nokia C5-03"" are sold on the date 23-Apr-
2012 then display both the records. Use ""NoofMobilesSold"" as alias name for the number
of mobiles field." 

Select m.Model_Name,count(m.Model_Name) as Noofmobilessold from mobile_master


m,sales_info s where m.IME_No=s.IME_No and s.Sales_Date="2012-4-23" group by m.
Model_Name;

4. "Write a Query to display the distributor id, mobile model name, number of mobiles of
the particular model name supplied to the distributors group by model name and distributor
id and sort by the distributor id.
Hint: For example, if 3 ""Nokia 1100"" and 1 ""Nokia C5-03"" are sold to one distributor then
display both the records. Display the distributor id, model name and number of mobiles of a
particular model name. Use ""NoofMobilesSupplied"" as alias name for the number of
mobiles." 

select d.Distributor_ID,m.Model_Name,count(m.Model_Name) as Noofmobilessupplied


from distributor d, mobile_master m where d.Distributor_ID=m.Distributor_ID group by
m.Model_Name order by d.Distributor_ID;

5. "Write a Query to display the IME number, model name, manufacturer, price and
discount of all mobiles regardless of whether the mobile is sold or not. Hint: Fetch the price,
IME no and model name from mobile_master table. 

Example: For the mobile model ""Samsung GalaxyTAB with IME NO ""MC1000103"" is sold
and other with IME No ""MC1000110"" is not sold. Then both the mobiles details namely
IME number, model name, manufacturer, price and discount needs to be displayed. " 
6. Write a Query to display the distributor name, mobile number and email of distributors
selling model 'Nokia 1100'. 
7. Write a Query to display the IME Number and Model Name of mobiles which are not sold.
Hint: The details of the sold mobiles are available in the "SALES_INFO" table and the overall
mobile models are available in the mobile_master table. 
8. Write a Query to display the IME Number, Model Name and net amount of the mobile
which has the highest net amount. 
9. "Write a Query to display the IME Number, Model Name, Manufacturer, Price and New
Price of all mobiles. 

Hint: Fetch the price, name and IME number from mobile master table. Add 10% to the old
price to find new price and display with alias name ""NewPrice"". Formula = price + (price *
10/100)" 

10. Write a Query to display mobile model name, manufacturer and price for the mobiles
having a price range between 8500 and 25300. 
11. Write a Query to display the Model Name, Manufacturer, Price, Warranty, Internal
memory, memory card capacity, gprs support, Bluetooth, camera quality and OS for the
mobile with IME NO "MC1000104" 
12. "Write a Query to display IME Number, Model Name, Manufacturer, Price ,GPRS
information, Memory card capacity of mobiles which has GPRS support with memory card
capacity 16GB or above. 

Hint: For GPRS support use GPRS = “Yes”." 


13. Write a Query to display the customer name, IME Number, Model Name, Sales Date and
Net amount paid by the customer and sort by customer name in ascending order. 
14. "Write a Query to display the IME Number, model name, manufacturer, price and
discount of all mobiles regardless of whether the mobile is sold or not. Hint: If not sold,
display discount as ""Not Sold"" 

Hint: Fetch the price and model name from mobile_master table. Use “discount” as alias
name for displaying the discount of all mobiles." 
15. Write a Query to display the sales date and total net amount of all the mobiles based on
the sales date that are sold between 20-APR-12 and 25-APR-12. Hint: Total net amount
column should be displayed as "TotalNetAmount" (alias) 

You might also like