Discussion
The SQL statement: SELECT Number1 + Number 2 AS Total FROM NUMBER_TABLE; adds two numbers from each row together and lists the results in a column named Total.
Answer: A
Correct answer: True
The SELECT list may contain expressions as well as plain columns, so Number1 + Number2 is evaluated once per row and its value returned.
AS Total gives the resulting column a name; without it the heading would be the expression itself, which is awkward for a program or a report to reference. One caution: if either operand is null the whole expression is null, since arithmetic with an unknown value gives an unknown result. COALESCE is the usual remedy where zero is the sensible substitute.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development