Download presentation
Presentation is loading. Please wait.
Published byJaime Beatson Modified over 9 years ago
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 = 200000
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.