Structured Query Language
Structured Query Language
www. H2KINFOSYS.com
www. H2KINFOSYS.com
Accessing Database
Application
Database
SQL Tool
www. H2KINFOSYS.com
Database
Oracle MS SQL DB2 MySQL Sybase Postgres PointBase
Etc..
www. H2KINFOSYS.com
SQL Statements
www. H2KINFOSYS.com
SQL
Create Table Update Table Delete Table Insert Data
Select
www. H2KINFOSYS.com
Syntax of CREATE Statement Create table <tablename> (< Column 1> <Datatype>(Size), (< Column 2> <Datatype>(Size), (< Column 3> <Datatype>(Size), (< Column n> <Datatype>(Size));
www. H2KINFOSYS.com
You should not skip any column values, type NULL in case you want to omit a column value Char, Varchar and Date values should be enclosed in Single Quotes
www. H2KINFOSYS.com
SQL
Where clause Group by clause Having clause Joins Sub Queries
www. H2KINFOSYS.com
10
www. H2KINFOSYS.com
11
www. H2KINFOSYS.com
12
Functions
www. H2KINFOSYS.com
13
Joins
A Select Statement can be called a Join if, first, the FROM clause names at least two table specifications and second,if the WHERE clause has at least one condition that compares columns from the different tables. Types of Joins: Equi-Join Non-Equi Join Outer-Join Self Join
www. H2KINFOSYS.com
14
Integrity Constraints
Integrity Constraints are the rules with which the contents of a database must comply at all times, and they describe which updates to the database are permitted Types : Table Constraints, Column Constraints Not Null Primary Key Unique Check Foreign Key
www. H2KINFOSYS.com
15
Thank You!