Computer Science, asked by raj16520, 3 months ago

To find the sum of two number and Their Avenge.
Database management system: SQL commands.​

Answers

Answered by allysia
0

Answer:

If you haven't pre defined the columns and want it as columns per record in a temporary column do as followed,

Select marks1+marks2 as sum, (marks1+marks2)/2 as average from table_name;

Commands I used and why:

  • Select command to get desired columns.
  • marks1+marks2 will return these two column's sum and as command will return this sum under a new column named sum.
  • (marks1+ marks2) /2 as average will return average value under column named average. Using avg() here will return average of all the values in the records under marks1 and marks2 in a one record which is not what we intended to do here..
Similar questions