Computer Science

Consider the table Student1 of Q. 13. Give the output of following SQL statement :

  1. SELECT TRUNCATE(AvgMark) FROM Student1 WHERE AvgMark < 75 ;
  2. SELECT ROUND(AvgMark) FROM Student1 WHERE Grade = 'B' ;
  3. SELECT CONCAT(Name, Stream) FROM Student1 WHERE Class = '12A' ;
  4. SELECT RIGHT(Stream, 2) FROM Student1 ;

SQL Queries

9 Likes

Answer

1. It will return error because no argument is passed as decimal places to truncate. Syntax of truncate function is TRUNCATE(number, decimals).

2.

Output
+----------------+
| ROUND(AvgMark) |
+----------------+
|             78 |
|             73 |
|             75 |
+----------------+

3.

Output
+----------------------+
| CONCAT(Name, Stream) |
+----------------------+
| RubinaNonmedical     |
| VikasNonmedical      |
+----------------------+

4.

Output
+------------------+
| RIGHT(Stream, 2) |
+------------------+
| al               |
| ce               |
| ce               |
| es               |
| al               |
| al               |
| es               |
| al               |
| al               |
| ce               |
+------------------+

Answered By

8 Likes


Related Questions