SQL Tutorials


create database SQL; use SQL;



create table details( ID int, Names varchar(100), Age int, Country varchar(50), Birth int);



insert into details values(001,'Kamal',22,'Sri Lanka',1988); insert into details values(002,'Sadamali',21,'Sri Lanka',1989); insert into details values(003,'Gayan',12,'India',1950); insert into details values(004,'Rumesh',20,'Amarica',1990); insert into details values(005,'Rajika',21,'Canada',1988);



select * from details; select Names from details; select Names,Country from details;



select distinct Age from details;



select * from details where Country='Sri Lanka'; select * from details where Age=21; select * from details where Birth <1988; select * from details where Birth between 1988 and 1989; select * from details where Age =21 and Country='Canada'; select * from details where Age =12 or Country='Canada'; select * from details where Names like 'G%';



select * from details order by names desc; select * from details order by names asc;



update details set Birth ='1985' where ID ='4';



delete from details where ID='1';



truncate table details;



drop table details;



drop database SQL;


Comments


Comment

Lashan | 2015-11-08 10:59:29

Good

Comment

Nilushi | 2016-01-03 12:29:49

nice

Comment

Udeni | 2016-08-13 03:59:12

Your web is interesting and thank you for the information shared

Comment

Telani | 2016-12-07 10:25:24

Your website helped me to get SQL knowledge.Thank you.

Post Comments