-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDML.txt
More file actions
73 lines (61 loc) · 1.78 KB
/
DML.txt
File metadata and controls
73 lines (61 loc) · 1.78 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
DML COMMANDS:-
INSERT:-
mysql> insert into employee
-> values(101,'Charmi','EXTC'),
-> (201,'Bhavya','CS'),
-> (301,'Disha','IT'),
-> (401,'Mansi','CS'),
-> (501,'Komal','EXTC'),
-> (601,'Rahul','CS');
Query OK, 6 rows affected (0.03 sec)
Records: 6 Duplicates: 0 Warnings: 0
SELECT:-
mysql> select * from employee;
+--------+----------+--------+
| emp_no | emp_name | branch |
+--------+----------+--------+
| 101 | Charmi | EXTC |
| 201 | Bhavya | CS |
| 301 | Disha | IT |
| 401 | Mansi | CS |
| 501 | Komal | EXTC |
| 601 | Rahul | CS |
+--------+----------+--------+
6 rows in set (0.00 sec)
DELETE:-
mysql> delete from employee where emp_no=501;
Query OK, 1 row affected (0.05 sec)
mysql> select * from employee;
+--------+----------+--------+
| emp_no | emp_name | branch |
+--------+----------+--------+
| 101 | Charmi | EXTC |
| 201 | Bhavya | CS |
| 301 | Disha | IT |
| 401 | Mansi | CS |
| 601 | Rahul | CS |
+--------+----------+--------+
5 rows in set (0.00 sec)
SELECT:-
mysql> select emp_name from employee where branch='IT';
+----------+
| emp_name |
+----------+
| Disha |
+----------+
1 row in set (0.00 sec)
UPDATE:-
mysql> update employee set emp_name='Shreya' where emp_no=601;
Query OK, 1 row affected (0.03 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from employee;
+--------+----------+--------+
| emp_no | emp_name | branch |
+--------+----------+--------+
| 101 | Charmi | EXTC |
| 201 | Bhavya | CS |
| 301 | Disha | IT |
| 401 | Mansi | CS |
| 601 | Shreya | CS |
+--------+----------+--------+
5 rows in set (0.00 sec)