0
About automatic creation of new column
Does the following statement create new column in table called SQRT(Salary) after calculating the average SELECT Salary, SQRT(Salary) FROM employees;
3 Respuestas
+ 2
No buddy, SQRT here is a function that is used to calculate and return the square root of the given argument. The query selects 'Salary' column and square root of 'Salary' column from 'employees' table. It does not create new column in 'employees' table.
Reference:
https://www.w3resource.com/sql/arithmetic-functions/sqrt.php
+ 1
Ipang then where will the square root of salary column come from?
0
Krishna Priyatham Potluri
Value used to calculate square root come from the same table 'employees', and same column 'Salary'. Each record in the resultset will have two column; the value of 'Salary' column itself, and square root of 'Salary' column.