-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuestion_2.sql
More file actions
28 lines (20 loc) · 762 Bytes
/
Question_2.sql
File metadata and controls
28 lines (20 loc) · 762 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
27
28
use hw_student;
create table teachers(
id_no int auto_increment,
Name varchar(60) not null default 'UNKNOWN USER',
Address varchar(100) null,
Age int not null,
primary key(id_no)
);
desc teachers;
insert into teachers(Name,Address,Age) VALUES ('Priety Goel','Shimla Road, Himachal Pradesh',35),
('Sunil Kumar Verma', 'LodhiRoad, New Delhi',28),
('Priyanka','Tonk,Rajasthan',31);
insert into teachers(Name) VALUES ('Anshika kapoor');
insert into teachers(Address,Age) VALUES ('Dwarka, Delhi',25),('Tonk,Rajasthan',38);
insert into teachers(Name,Age) VALUES ('Sakshi',28),('Sangam Jha',31);
select * from teachers;
UPDATE teachers SET Address='N/A' WHERE Address is null;
select * from teachers;
drop table students_data,teachers;
drop database hw_student;