-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsqlquery5.sql
More file actions
28 lines (23 loc) · 788 Bytes
/
Copy pathsqlquery5.sql
File metadata and controls
28 lines (23 loc) · 788 Bytes
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
Problem Statement:
Given a table named stud_data, formulate a query to change the Fname and Age of the already entered record to ( Neelabh, 22 ) of roll number 17.
Information about the table
Table stud_data :
roll_no | Fname | Age
17 | Rishi | 23
7 | Shantnu | 21
10 | Ojasv | 19
50 | Lokesh | 23
21 | Kuldeep | 20
Note: Print the complete table after updating the data.
Solution:
UPDATE stud_data SET fname='Neelabh', Age=22 WHERE roll_no=17;
SELECT * FROM stud_data;
Output:
UPDATE 1
roll_no | fname | age
---------+------------------+-----
7 | Shantnu | 21
10 | Ojasv | 19
50 | Lokesh | 23
21 | Kuldeep | 20
17 | Neelabh | 22