You are on page 1of 2

/*

create database college;

use college;

create table BCA(


Id int primary key,
S_Name varchar(50),
Marks int,
Grade char(1)
);

-- Marks System (90+ = A), (70+ = B), (50+ = C),(30+ = D), (0+ = F)
insert into BCA values(1,'Aman', 74,'B');
insert into BCA values(2, 'Arushi', 92, 'A');

insert into BCA


(Id, S_Name, Marks, Grade)
Values
(3, 'Bobby', 67, 'C'),
(4, 'Bhanu', 69, 'C'),
(5, 'Danish', 89, 'B'),
(6, 'Drishti', 74, 'B');

alter table BCA


alter column Grade varchar(1);

alter table BCA


add City varchar(20);

update bca
set city = 'Rudrapur'
where id = 1 or id = 3;
update bca
set city = 'Haldwani'
where id = 2 or id = 5;
update bca
set city = 'Pune'
where id = 4 or id = 6;

alter table BCA


add Temp int;

alter table BCA


drop column Temp;

select * from BCA; --001


select S_Name,Marks from BCA; --002
select distinct City from BCA; --003

select S_Name as Student from BCA; --004


select * from BCA where marks>70; --005
select * from BCA where Id<5 and marks>80; --006
select * from BCA where Id<2 or marks>80; --007
*/

/*
*/

You might also like