What is SQL


SQL (pronouncing as 'sequel') means Structured Query Language. It is a programming language to manage data in a DBMS or RDBMS. SQL is the back bone of any modern RDBMS.

History
SQL developed by IBM in 1970. In 1986 ANSI standardized the SQL.

SQL Statements
SELECT - Uses to fetches and displaying the data in a structured manner.
INSERT -  Uses to store data into the database.
UPDATE - Update or modify the stored data.
DELETE -  Removing the stored data.     

SELECT statement is the most widely and frequently used one. 
To explain the above statements we need to define a table first. Assume tat

EMP table stores employee details like Empno, Name, Age,

Structure of EMP Table

Empno Name Age
10 Mark 26
20 Adam 30
30 Gary 33
40 Lisa 27

There are 4 records in EMP table.


SELECT statement
Example :-  select * from EMP;     
Explanation :- 
The above statement will fetch all records from a table called EMP.
 
INSERT statement
Example :-  insert into EMP values(50,‘Lo‘,33);     
Explanation :- 
The above statement will insert one records into EMP table.

UPDATE statement
Example :-  update EMP set name = ‘Lopez‘ where Empno = 50;  
Explanation :- 
The above statement will update name column in EMP table.

Delete statement
Example :-  delete from EMP where Empno = 50;  
Explanation :- 
The above statement will update name column in EMP table.
We will discuss each SQL statements in a very detail manner.




No comments:

Post a Comment