...
GATE 2007
October 14, 2023
Database-Management-System
October 14, 2023
GATE 2007
October 14, 2023
Database-Management-System
October 14, 2023

Database-Management-System

Question 5

A table T1 in a relational database has the following rows and columns:

 roll no.	 marks
    1	          10
    2	          20
    3	          30
    4	         Null 

The following sequence of SQL statements was successfully executed on table T1.

Update T1 set marks = marks + 5
Select avg(marks) from T1 

What is the output of the select statement?

A
18.75
B
20
C
25
D
NULL
Question 5 Explanation: 
Update on null values gives null. Now, avg function ignores null values. So, here avg will be
(15+25+35)/3 = 25
Correct Answer: C
Question 5 Explanation: 
Update on null values gives null. Now, avg function ignores null values. So, here avg will be
(15+25+35)/3 = 25
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!