This document provides an introduction to basic SELECT statements in database training taught by Mr. THAN Sare. It demonstrates using functions like NOW(), CURDATE() and YEAR() to return date values, changing column names using AS, and using the DUAL table to run a SELECT statement without referencing an actual table. Examples are provided for each concept to illustrate proper syntax.
4. Changing column
? Syntax:
SELECT val AS col_name,val1 AS col_name,¡¡¡¡¡¡¡¡¡¡..valn AS col_name;
? Example:
Select now() AS ¡®Datenow¡¯;
? sd
5. The DUAL table
? DUAL is a special table that is used when the SELECT statement doesn¡¯t
reference to any table.
? Example:
Select ¡®Mr.A¡¯ FirstName,year(now())-1990 ¡®Age¡¯ from DUAL;