SQL Strategy - A site to master SQL while executing it on the Web
Home >> SQL Strategy - Basics of SELECT statement (1)

Basics of SELECT statement (1)

Learn the basic syntax of the SELECT statement.

1. basic SELECT minute syntax

--Show all data
SELECTColumn name,Column name...
FROMTable name
■How to write a SELECT statement

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.

■practice

Now for the exercise, I will give you two questions.

2. use of operators

--Show SAL (salary) times 10
SELECTEMPNO,SAL * 10
FROMEMP

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.

operatormeaning
+addition
-subtraction
*multiplication
/division (arith)

Now for the exercise, I will give you one Question.


This concludes [Basics of SELECT statement (1)].