0% found this document useful (0 votes)
15 views4 pages

Create Database Mydb9

Uploaded by

pr.im12me
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
15 views4 pages

Create Database Mydb9

Uploaded by

pr.im12me
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 4

create database mydb9;

use mydb9;

create table Client_Master(Client_No integer,Name varchar(30),City varchar(30),Pincode


integer,State varchar(30),Balance_Due integer,primary key (Client_NO));
create table Product_Master(Product_No varchar(10),Description varchar(30),profit
integer,Unit_Measure varchar(30),Qty_on_Hand integer,Reaorder_lvl integer,Selling_Price integer,
Cost_Price integer, primary key(Product_No));

drop table Product_Master;


show tables;

insert into Client_Master (Client_No,Name,City,Pincode,State,Balance_Due) values


(0001,'Ivan','Bombay',40054,'Maharastra',15000),
(0002,'Vandana','Madras',780001,'Tamilnadu',0),
(0003,'Pramada','Bombay',400057,'Maharastra',5000),
(0004,'Basu','Bombay',400056,'Maharastra',0),
(0005,'Ravi','Delhi',100001,'NULL',2000),
(0006,'Rukmani','Bombay',400050,'Maharastra',0);

insert into
Product_Master(Product_No,Description,profit,Unit_Measure,Qty_on_Hand,Reaorder_lvl,Selling_Pri
ce,Cost_Price) values
('P00001', '1.44floppies', 5, 'piece', 100, 20, 525, 500),
('P03453', 'Monitors', 6, 'piece', 10, 3, 12000, 11200),
('P06734', 'Mouse', 5, 'piece', 20, 5, 1050, 500),
('P07865', '1.22 floppies', 5, 'piece', 100, 20, 525, 500),
('P07868', 'Keyboards', 2, 'piece', 10, 3, 3150, 3050),
('P07885', 'CD Drive', 2.5, 'piece', 10, 3, 5250, 5100),
('P07965', '540 HDD', 4, 'piece', 10, 3, 8400, 8000),
('P07975', '1.44 Drive', 5, 'piece', 10, 3, 1050, 1000),
('P08865', '1.22 Drive', 5, 'piece', 2, 3, 1050, 1000);

1.
Code:

update Product_Master set Selling_Price=1150 where Description='1.44floppies';


select * from Product_Master;

Output:
2.

Code:

delete from Client_Master where Client_No=0001;

select *from Client_Master;

Output:

3.

Code:

update Client_Master set city='Bombay' where Client_No=0005;

select * from Client_Master;

Output:
4.

Code:

update Client_Master set balance_due=1000 where Client_No=0001;

select * from Client_Master;

Output:

5.

Code:

update Product_Master set Selling_Price=Selling_Price*15 where selling_Price>=1500;

select *from Product_Master;

Output:
6.

Code:

select * from Client_Master where city like '_a%';

Output:

7.

Code:

select * from Client_Master where name like '_a%';

Output:

You might also like