Unit 2 DML & Views
Unit 2 DML & Views
1.SELECT Command
2.INSERT Command
3.UPDATE Command
4.DELETE Command
• SELECT :
• SELECT column_Name_1, column_Name_2, ….., column_Name_N
FROM Name_of_table;
SELECT * FROM table_name;
Emp_Id Emp_Salary
201 25000
202 45000
203 30000
204 29000
205 40000
Student_ID Student_Name Student_Marks
BCA1001 Abhay 80
BCA1002 Ankit 75
BCA1003 Bheem 80
BCA1004 Ram 79
BCA1005 Sumit 80
WHERE clause with the SELECT DML command.
BCA1001 Abhay 80
BCA1003 Bheem 80
BCA1005 Sumit 80
UPDATE DML Command
Product_Id Product_Name Product_Price Product_Quantity
P101 Chips 20 20
P102 Chocolates 60 40
P103 Maggi 75 5
P201 Biscuits 80 20
P203 Namkeen 40 50
UPDATE Table_name SET [column_name1= value_1,
….., column_nameN = value_N] WHERE CONDITION
;
• Changes made in table reflects on view ,and changes made in view reflects on
table
SELECT column1,column2,..
FROM table_name
WHERE condition;
If we want to update the view MarksView and add the field
AGE to this View from StudentMarks Table, we can do this
as: