CLASS 12th IP Practical-3

Class 12th IP

SOLUTION

-> create database exam;

-> use exam; 

-> create table infant
(
item_code int primary key,
item varchar(100) not null,
DatePurchase date,
UnitPrice int,
Discount int);

-> Insert query
insert into infant values(101,'Frock','2016-01-23',700,10);
insert into infant values(102,'Cot','2015-09-23',5000,25);
insert into infant values(103,'Soft Toy','2016-06-17',800,10);
insert into infant values(104,'Baby Socks','2014-10-16',100,7);
insert into infant values(105,'Baby Suit','2015-09-20',500,5);

1. SELECT Item, UnitPrice FROM Infant WHERE UnitPrice < 800 AND Discount > 5;


2.SELECT COUNT(*) AS NumberOfItems FROM Infant WHERE Discount > 10;

3.SELECT ItemCode, UnitPrice FROM Infant ORDER BY UnitPrice DESC;

4.UPDATE Infant SET UnitPrice = UnitPrice * 1.10;

5.SELECT MAX(UnitPrice) AS HighestUnitPrice FROM Infant;

6.SELECT Item FROM Infant WHERE Item LIKE '%Baby%';

7. Output :- 
It
Co
So
Ba
Ba
8. Output :- 
AVG(UnitPrice)
1000.00

Output

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.