Professional Documents
Culture Documents
SQL-3
SQL-3
SQL-3
Total marks : 16 marks ( 16*1=16)
Number of questions expected for board exam : 16
Consider the table Studentgiven above to understand and write queries in the example
given below:
17
2024-25/ COMPUTER SCIENCE XII/ SQL NOTES JISHA T P
(b) Updating to NULL values
The values for the attributes in a relation can also be entered as NULL using
UPDATE command.
For example,
UPDATE STUDENT SET MARKS = NULL WHERE ROLLNO = 9;
The above statement shall change the value of the field Marks to NULL for the
student whose roll number is 9.
11) DELETECOMMAND:
The DELETE statement is used to delete rows from a table.
Syntax :
DELETE FROM <table_name> WHERE <condition>;
The WHERE clause is optional and it identifies the rows in the column that get deleted.
If you do not include the WHERE clause, all the rows in the table are deleted.
For example,
DELETE FROM STUDENT WHERE ROLLNO = 10;
The above statement shall delete the record only for roll number 10
For example,
To delete all the rows from the student table,
DELETE FROM STUDENT;