intro to sql

16
SQL Http://iwt.bz

Upload: planet89

Post on 10-Mar-2016

213 views

Category:

Documents


0 download

DESCRIPTION

This is an Ebook on an introduction to SQL

TRANSCRIPT

Page 1: Intro to SQL

SQLHttp://iwt.bz

Page 2: Intro to SQL
Page 3: Intro to SQL

Structured

Query

Language

Page 4: Intro to SQL

ID Publication Issue Date

1 XML 2011

2 RelationalAlgebra

2011

Table: ebooks

Page 5: Intro to SQL

SELECTStatements

Page 6: Intro to SQL

SELECT PublicationFROM ebooks

SELECT ID, Publications, Issue DateFROM ebooks

SELECT *FROM ebooks

The asterisk will select all columns.

Page 7: Intro to SQL

WHEREStatements

Page 8: Intro to SQL

Operator Values= Equal

<> Not Equal

> Greater Than

< Less Than

>= Or Equal

<= Less than or equal

BETWEEN Between an Inclusive Value

LIKE Searches for patterns

IN Knowing the exact value you want to get from a

column.

Page 9: Intro to SQL

SELECT PublicationFROM ebooksWHERE Issue Date='2011'

Operator Value

Page 10: Intro to SQL

AND&OROperators

Page 11: Intro to SQL

The AND operator displays a record if both the frst condition and the second condition is true.

Page 12: Intro to SQL

The OR operator displays a record if either the frst condition or the second condition is true.

Page 13: Intro to SQL

SELECT publicationsFROM ebooksWHERE publications='XML'AND date='2011'

Page 14: Intro to SQL

The ORDER BY keyword is used to sort the result set.

Page 15: Intro to SQL

SELECT *FROM ebooksORDER BY dates ASC

Page 16: Intro to SQL

Http://IWT.bz