SQL SELECT UPDATE and DELETE

December 4, 2026 · Team EasyExamNotes · 2 min read (est.) · 0 comments

Share on WhatsApp

← RGPV CS-502 DBMS December 2020 solved question paper

CS-502 (CBGS) | December 2020 | Q7(a) | 7 marks

Question (restated): Explain SELECT, UPDATE and DELETE with syntax.

Answer

SQL provides commands to retrieve and modify relational data. SELECT retrieves rows without changing the stored relation. UPDATE changes values in existing rows. DELETE removes rows satisfying a condition. Consider an illustrative Student table with rows (101,Amit,70), (102,Priya,85), (103,Rahul,60), where columns are RollNo, Name and Marks.

SELECT specifies the desired columns, source table and optional condition. The following query returns Priya with 85 marks. UPDATE changes Amit’s marks to 78. DELETE removes Rahul’s row. After executing these commands in order, the table contains Amit (78) and Priya (85).

The WHERE clause is crucial for UPDATE and DELETE: omitting it affects every row. Primary and foreign key constraints may reject changes, and triggers may execute additional actions. Within a transaction, changes can be committed or rolled back subject to the DBMS transaction mode. SELECT may also use ORDER BY, GROUP BY and aggregate functions. DELETE differs from DROP, which removes a database object rather than selected rows.

Syntax and worked example

SELECT Name, Marks FROM Student WHERE Marks > 75;
UPDATE Student SET Marks = 78 WHERE RollNo = 101;
DELETE FROM Student WHERE RollNo = 103;
RollNo Name Marks
101 Amit 78
102 Priya 85

Further reading: Silberschatz, Korth and Sudarshan, Database System Concepts.

← RGPV CS-502 DBMS December 2020 solved question paper

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion