SQL Day1
SQL Day1
SQL Day1
PRESENTED BY
A.RAJSARANYA
Sql Introduction
• Structured Query Language
• It allows people to access and work with
databases
• SQL became a standard of the American
National Standards Institute (ANSI) in
1986,
Versions of SQL(Oracle database version)
1 • Oracle 8i , 9i
• Where i stands for Internet
• Starting 1999 and support for XML
• Oracle 10g,11g
2 • Where g stands for Grid Computing
• Starting 2003 and standard servers
• Oracle 12c
• SYNTAX
• INSERT INTO table_name (column’s1)
VALUES (value’s);
• INSERT INTO Persons ( PersonID,LastName,
FirstName,Address,City)
VALUES ('0001','A','Rajsaranya','adambakkam','chennai');
• TO VIEW ENTIRE TABLE
• SYNTAX
• SELECT * FROM Tablename;
• SELECT * FROM Persons;
• TO VIEW PARTICULAR COLOUNM AND ITS
VALUES OF THE TABLE
• SYNTAX
• SELECT Coloumn name FROM Table name;
• SELECT FirstName ,LastName FROM Persons;
• TO PERFORM CONCATENATION USING
PIPELINE IN THE TABLE
• SYNTAX
• SELECT Coloumn name1 || Coloumn name 2
FROM Table name;
• SELECT FirstName || LastName From Persons;
• TO PERFORM CONCATENATION USING
PIPELINE IN THE TABLE WITH SPACES
• SYNTAX
• SELECT Coloumn name1 ||’ ‘|| Coloumn name 2
FROM Table name;
• SELECT FirstName || ' '|| LastName From
Persons;
• TO PERFORM CONCATENATION IN THE
TABLE WITH SPACES
• SYNTAX
• SELECT Coloumn name1 ||
’ anything to be printed ‘|| Coloumn name 2 FROM
Table name;
• SELECT FirstName || ' . '|| LastName From
Persons;
• TO PERFORM CONCATENATION IN THE
TABLE WITH SPACES
• SYNTAX
• SELECT Coloumn name1 ||
’ anything to be printed ‘|| Coloumn name 2 FROM
Table name;
• SELECT FirstName || ' . '|| LastName From
Persons;
• TO CONCAT COLOUMNS IN THE TABLE
• SYNTAX
• SELECT CONCAT(Column name , coloumn name)
from table name;
• SELECT Concat(FirstName,LastName) FROM
Persons;
• TO ADD COLOUMNS IN THE TABLE
• SYNTAX
• ALTER TABLE table_name
ADD column_name datatype(value);
• ALTER TABLE Persons
ADD Persons_Salary varchar(data);
• ALTER TABLE Persons
ADD Persons_Salary varchar(250);
• TO PERFORM OPERATIONS IN THE TABLE
USING ALIAS NAME
• SYNTAX
• SELECT Coloumn name Operator AS Newcoloumn
name FROM Table name;
• SELECT Salary * Sincrement AS fullsalary FROM
Persons;
• TO PERFORM OPERATIONS IN THE TABLE
• SYNTAX
• SELECT Coloumn name Operator FROM Table
name;
• SELECT Salary * Sincrement FROM Persons;
• TO DUAL TABLE AND OPERATION
• SYNTAX
• SELECT * from dual;