-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert_data_L6.sql
More file actions
52 lines (42 loc) · 964 Bytes
/
insert_data_L6.sql
File metadata and controls
52 lines (42 loc) · 964 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use second;
drop table if exists akshay;
create table if not exists akshay(
emp_id varchar(50),
first varchar(20),
second varchar(10),
depat varchar(30));
select * from akshay;
# inserting data in single row
insert into akshay(
emp_id,first,second,depat)
values(1,'akshay','kuam','aiml');
select * from akshay;
# insert multiple rows
insert into akshay(
emp_id,first,second,depat)
values(2,'aks','jd','dj'),
(3,'djd','djd','dd');
select * from akshay;
# adding partial data
insert into akshay(
first,second)
values('ajs','djd');
select * from akshay;
# inserting order in diff order
# adding data without order
# updating data
update akshay
set first= 'ok'
where emp_id=1;
select * from akshay;
# deleting table
delete from akshay
where first='ok';
select * from akshay;
# delete data whose last name starts with w
delete from akshay
where second like 'k%';
select * from akshay;
# delete all rows from table
delete from akshay;
select * from akshay;