0% found this document useful (0 votes)
10 views12 pages

Galgotias College of Engineering & Technology Department of Computer Science & Engineering

Uploaded by

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

Galgotias College of Engineering & Technology Department of Computer Science & Engineering

Uploaded by

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

Deeksha Tripathi (2100971540022)

Galgotias College of Engineering & Technology


Affiliated to Dr. A.P.J. Abdul Kalam Technical University, Lucknow

Department of Computer Science & Engineering

Database Management System Lab (KCS-551)


SESSION: 2023-24

Name

Roll no.

Section

Batch (D1/D2)
Deeksha Tripathi (2100971540022)

EXPERIMENT 1

1.Print the name of all products.

Select Prod_name

From home.prod;
Deeksha Tripathi (2100971540022)

2. Print the name and price of all products.

Select Prod_name,Prod_price

From home.prod;

3.Print the detail of all fridge.

Select * from home.prod

Where Prod_name = ‘Fridge’;

4.Print the detail of all the television.

Select * from home.prod

Where Prod_name = ‘Fridge’;

5.Print the price and color of Washing Machine.

Select Prod_price,Prod_color

from home.prod

Where Prod_name = ‘Fridge’;


Deeksha Tripathi (2100971540022)

6.Print the manufacturer name of all the television and vaccume cleaner.

Select Prod_price,Manufacturer

from home.prod

Where Prod_name = ‘Television’ or Prod_name=’Vaccume Cleaner’;

7.Print the name of product which have price is greater than 30000.

Select Prod_name

from home.prod

Where Prod_price = ‘30000’;

8.Print the name and color of product which have price is greater than 30000 and less then 40000.

Select Prod_name

from home.prod

Where Prod_price > ‘30000’ and Prod_price < ‘40000’ ;

9.Print the name of product which have color is black and price is less than 30000

Select Prod_name

from home.prod

Where Prod_price > ‘30000’ and Prod_color < ‘Black’ ;


Deeksha Tripathi (2100971540022)

DELETE:

1.Delete the product which have price is greater than 40000

Delete from house.prod

Where Prod_price > ‘40000’;

2.Delete the product which have color is black

Delete from house.prod

Where Prod_Color = ‘Black’;

3.Delete all the washing machine products.

Delete from house.prod

Where Prod_name = ‘Washing Machine’;


Deeksha Tripathi (2100971540022)

4.Delete the record of LG manufacturer.

Delete from house.prod

Where Manufacturer = ‘LG’;

5.Delete the products of ids 107,108 and 110.

Delete from house.prod

Where Prod_id = ‘107’ or Prod_id = ‘108’ or Prod_id = ‘110’;


Deeksha Tripathi (2100971540022)

EXPERIMENT 2 A
create schema store;

create table store.cust(

Cid int primary key,

Fname varchar(8),

Lname varchar(8),

Country varchar(4)

);

insert into store.cust

Values('1','John','Doe','USA'),

('2','Robert','Luna','USA'),

('3','David','Robinson','UK'),

('4','Mark','Cage','UK'),

('5','Betty','Taylor','UAE');

1.Add one column phone in table of varchar type

alter table store.cust

add column Phone varchar(20);

2.A update store.cust

set Phone='817-466-8833'

where Cid=1;

update store.cust

set Phone='412-862-0502'

where Cid=2;

update store.cust

set Phone='208-340-7906'
Deeksha Tripathi (2100971540022)

where Cid=3;

update store.cust

set Phone='307-242-6285'

where Cid=4;

update store.cust

set Phone='806-749-2958'

where Cid=5;dd phone following phone numbers in this table

3.Try to insert following record

5 Mark Alexander Denmark 990-267-9088


insert into store.cust

values('6','Mark','Alexander','Denmark','990-267-9088');

4.Perform suitable changes in table schema or values to store the record of ‘Mark Alexander’

alter table store.cust

Modify column Lname varchar(10),

Modify column Country varchar(10);

insert into store.cust

values('6','Mark','Alexander','Denmark','990-267-9088');
Deeksha Tripathi (2100971540022)

5.Remove column Lname from table

alter table store.cust

drop column Lname;

select * from store.cust;

EXPERIMENT 2 B
create schema office;

create table office.emplo(

Eid int primary key,

Ename varchar(20),

Salary varchar(20)

);

insert into office.emplo

values('1','Ajay','83020.561'),

('2','Ravi','50666.567'),

('3','Rajesh','78110.487'),

('4','Prakash','67230.678'),

('5','Anurag','777901.456'),

('6','Bharat','64000.287');

select * from office.emplo;


Deeksha Tripathi (2100971540022)

1.Print Salary and name of all the employees

select Ename,Salary

from office.emplo;

2.Select all employees who have salary greater than 55000 and less than 80000

select Ename

from office.emplo

where Salary > 55000 and Salary < 80000;

3.Change salary of Anurag to 80000.45

update office.emplo

set Salary='80000.45'

where Ename='Anurag';

4. Change salary of Ajay to 110000.45


Deeksha Tripathi (2100971540022)

update office.emplo

set Salary='110000.45'

where Ename='Ajay';

5.Remove salary of Ravi (do not remove the whole record)

update office.emplo

set Salary=''

where Ename='Ravi';
Deeksha Tripathi (2100971540022)

EXPERIMENT 3

You might also like