-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpracticeI.sql
More file actions
26 lines (19 loc) · 754 Bytes
/
practiceI.sql
File metadata and controls
26 lines (19 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
create database if not exists database1;
use database1;
create table if not exists table1(
id int primary key,
name varchar(50),
section varchar(20) not null default 'A',
language varchar(10) default 'English');
insert into table1(id, section) values(1, 'Abhishek Kumar'), (2, 'Himanshu Kumar');
alter table table1 rename column class to section;
alter table table1 drop column section;
alter table table1 add column marks int default 0;
update table1 set section='C' where id=1;
delete from table1 where id=1;
select * from table1;
insert into table1(id, name) values(3, "Catuu"), (4, "Bubba");
select * from table1;
select * from table1 where name='%Abhishek';
alter table table1 add column section varchar(1) default 'A';
select * from table1;