|SELECT||Column name,Column name...|
When using a SELECT statement, after the SELECT statement, enter a comma-separated list of column names; you can also use SELECT * (asterisk) to display all columns. Then, after the FROM statement, enter the Table name.
Now for the exercise, I will give you two questions.
From the EMP table, display ENAME (employee name), JOB (job), and SAL (salary).
SELECT ENAME,JOB,SAL FROM EMP
Describe the items to be displayed after SELECT, separated by commas, and the table after FROM.
Use * (asterisk) to display all records in the EMP table.
SELECT * FROM EMP
If you use "*", it means the same as if you had selected all columns.
|SELECT||EMPNO,SAL * 10|
The SELECT statement can contain arithmetic expressions to display the results of calculations. The following operators can be used. Parentheses can also be used to specify the precedence of calculations.
Now for the exercise, I will give you one Question.
You have decided to increase an employee's salary by 2%; from the EMP table, show the employee's name (ENAME) and the salary multiplied by 1.02 (SAL).
SELECT NAME,SAL * 1.02 FROM EMP
Arithmetic expressions can be used with the column operator number.
This concludes [Basics of SELECT statement (1)].