Presentation is loading. Please wait.

Presentation is loading. Please wait.

The SELECT statement. Syntax SELECT columns FROM table SELECT columns FROM table SELECT columns FROM table WHERE condition SELECT columns FROM table WHERE.

Similar presentations


Presentation on theme: "The SELECT statement. Syntax SELECT columns FROM table SELECT columns FROM table SELECT columns FROM table WHERE condition SELECT columns FROM table WHERE."— Presentation transcript:

1 The SELECT statement

2 Syntax SELECT columns FROM table SELECT columns FROM table SELECT columns FROM table WHERE condition SELECT columns FROM table WHERE condition SELECT * FROM table SELECT * FROM table SELECT * FROM table WHERE condition SELECT * FROM table WHERE condition columns: column name, or position, or list of names/positions separated by columns columns: column name, or position, or list of names/positions separated by columns

3 Syntax SELECT columns FROM table SELECT columns FROM table SELECT columns FROM table WHERE condition SELECT columns FROM table WHERE condition SELECT * FROM table SELECT * FROM table SELECT * FROM table WHERE condition SELECT * FROM table WHERE condition table: name of the table table: name of the table

4 Syntax SELECT columns FROM table SELECT columns FROM table SELECT columns FROM table WHERE condition SELECT columns FROM table WHERE condition SELECT * FROM table SELECT * FROM table SELECT * FROM table WHERE condition SELECT * FROM table WHERE condition condition: expression involving columns. When exp is true for a row, that row is returned. condition: expression involving columns. When exp is true for a row, that row is returned.

5 Example SELECT SELECT NameJobSalaryDept SmithPrincip100,000Staff SherryTeacher20,000Teach JonesStudent0Student * FROM table WHERE Salary < 90000

6 Example SELECT SELECT NameJobSalaryDept SmithPrincip100,000Staff SherryTeacher20,000Teach JonesStudent0Student Job FROM table WHERE Salary < 90000

7 Example SELECT SELECT NameJobSalaryDept SmithPrincipal200,000Staff SherryTeacher20,000Teach JonesStudent0Student Job, DeptFROM table WHERE Salary =


Download ppt "The SELECT statement. Syntax SELECT columns FROM table SELECT columns FROM table SELECT columns FROM table WHERE condition SELECT columns FROM table WHERE."

Similar presentations


Ads by Google