PRACTICAL
PRACTICAL
Source code
Create Databases general_store;
Output
PRACTICAL-14
Aim: To create Table
Source code
create table customer_record(CustomerName char(50),
CustomerAddress varchar(50), CustomerContact int(80),
Item char(60), AmountofPurchase int(60));
desc customer record;
Output
PRACTICAL-15
Aim: To insert the details in the table ‘customer_record’
Source code
insert into customer_record values("Ritik", "G-55", 98743456, "Dal", 200);
insert into customer_record values("yogesh", "G-56", 84937563, "soap", 30);
insert into customer_record values("Tannu", "G-45", 64854465, "chocolate", 100);
insert into customer_record values("harshita", "G-42",64876555, "biscuit", 80);
insert into customer_record values("shruti", "G-58", 86432223, "Noodles", 45);
Output
PRACTICAL-16
Aim: To show table “ customer_record ”
Source code
Select*from customer_record;
Output
PRACTICAL – 17
Aim: To add a new column in table.
Source code
Alter table customer_record add DueAmount int(80);
Output
PRACTICAL-18
Aim: To add details in a new column in table.
Source code
Update customer_record set DueAmount=0 where Item= “Dal”;
Update customer_record set DueAmount=5 where Item= “soap”;
Update customer_record set DueAmount=10 where Item= “chocolatel”;
Update customer_record set DueAmount=40 where Item= “biscuit”;
Update customer_record set DueAmount=15 where Item= “Noodles”;
Select*from customer_record;
Output
PRACTICAL-19
Aim: To delete a row from table.
Source code
Delete from customer_record where
CustomerName=”harshita”;
Output
PRACTICAL-20
Aim: To get the details of the customer with Due
Amount more than or equal to 5
Source code
Select*from customer_record where DueAmount >=5;
Output
PRACTICAL-21
Aim: To arrange the DueAmount in descending order.
Source code
Select *from customer_record order by DueAmount
DESC;
Output