[Assignments] Simple Queries in SQL — Chapter 12 Assignments (Q/A)
Table of Contents
20. Consider the table Student1 of Q14.
Give the output of following SQL statement:
- SELECT TRUNCATE(AvgMark) FROM Student1 WHERE AvgMark < 75;
- SELECT ROUND(AvgMark) FROM Student1 WHERE Grade = ‘B’;
- SELECT CONCAT(Name, Stream) FROM Student1 WHERE Class = ’12A’;
- SELECT RIGHT(Stream, 2) FROM Student1;
Solution:
+------------------------+
| TRUNCATE(AvgMark) |
+------------------------+
| 78 |
| 68 |
| 73 |
+------------------------+
+------------------+
| ROUND(AvgMark) |
+------------------+
| 79 |
| 75 |
+------------------+
+-------------------------+
| CONCAT(Name, Stream) |
+-------------------------+
| KaranMedical |
| RubinaNonmedical |
| VikasNonmedical |
+-------------------------+
+--------------------+
| RIGHT(Stream, 2) |
+--------------------+
| al |
| ce |
| ce |
| es |
| al |
| es |
| es |
| al |
| al |
| ce |
+--------------------+