Professional Documents
Culture Documents
Phones
or
Change Profile to Silent
Mode
Writing Basic Sql Statement
SQL Fundamentals
SQL Characterization
SQL SELECT Statement
Sql Fundamentals
Structured Query Language (SQL) is a standard language for
accessing and manipulating databases.
• The SQL statements which fall under the DML category are as
follows:
SELECT Statement
INSERT Statement
UPDATE Statement
DELETE Statement
SQL Select Statement
SQL Select statement is used to retrieve information from the
database table.
Syntax:
SELECT [* | DISTINCT] columnname1 [, columnname2]
FROM tablename1 [, tablename2]
[WHERE condition] [And | or | LIKE condition . . .]
[GROUP BY column-list]
[HAVING “conditions”]
[ORDER BY “condition-list” [ASC | DESC]]
SQL Select Statement
SQL Select Statement
A simpler syntax for Select statement can be:
Example:
S E L E C T e m p lo y e e _ id , fir s t _ n a m e , la s t _ n a m e , j o b _ i d f r o m
employees;
SQL Select Statement
Capabilities of SQL Select Statements
Projection
Selection
Joining
SQL Select Statement
Displaying All columns in a table.
Example:
Limiting Rows
Finding top 5 highest paid employees
Using WHERE Clause
• WHERE clause uses different comparison operators: