-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lecture12.txt
27 lines (25 loc) · 1.66 KB
/
Lecture12.txt
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
Lecture-12:
Delete Statement in SQL:
Update: It is used to delete record from database or table but never effect the structure of table.
Example: Amazon => Database => Customer
SlNo Name Address Age
1. Rupu Agarpara 22
2. Rup Salt Lake, Sector-2 20
3. Rupayan Fulia 24
4. Rupi Newtown 21
Syntax: delete from table_name
where column_name= ”condition”;
Command: delete Customer where SlNo= 2;
Output:
SlNo Name Address Age
1. Rupu Agarpara 22
3. Rupayan Fulia 24
4. Rupi Newtown 21
Important Points:
1. Always use where clause with update statement.
2. Risky Command.
Interview Questions:
1. What will delete command do to table/database?
Ans> Delete command is used to delete records from table. It is using where clause deletes the particular row/data from the table otherwise all data are deleted from the database, that’s why delete is a very risky command. But delete command never effects the database structure.
2. Difference between Delete and Drop command.
3. Difference between Delete and Drop and Truncate.