0% found this document useful (0 votes)
36 views2 pages

Essential SQL Commands Guide

The document discusses various SQL commands like creating and deleting tables, inserting and deleting data from tables, selecting specific or all data from tables, and updating data in tables.

Uploaded by

Suman Mandal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

Essential SQL Commands Guide

The document discusses various SQL commands like creating and deleting tables, inserting and deleting data from tables, selecting specific or all data from tables, and updating data in tables.

Uploaded by

Suman Mandal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

SQL Commands

1. To create a table :

a) create table employee(id integer not null auto_increment primary key, name text, address
text not null, department text, basic double(8,2));

2. To delete a table :

a) drop table employee;

3. To insert data in a table :

a) insert into employee(name, address, department, basic) values('SAM', 'Kol-91', 'IRD',


19007.50);

4. Delete all the data from table :

a) delete from employee;

5. Delete a specific data from table :

a) delete from employee where id=100;

6. Selecting all data from table :

a) select * from employee;

7. Selecting a specific data from table :

a) select * from employee where id=100;

b) select * from employee where id=100 or id=400;

c) select * from employee where id>=200 and basic>=10000;

8. Selecting specific field from table :


Globsyn Skills Development (P) Ltd

XI – 11 & 12, Block EP, Sector V, Globsyn Crystals, Salt Lake Electronics Complex,
Kolkata – 700091, West Bengal (India)
Phone: +91-33-6453 0005 / 84201 68488 • Fax: +91-33-23573684
Web: [Link] • e-mail: skills4india@[Link]
a) select id, name, basic from employee where id=100;

9. Update a specific data of a column in a table :

a) update employee set address='Kol-78' where id=100;

b) update employee set basic=basic+500 where id=100;

Globsyn Skills Development (P) Ltd

XI – 11 & 12, Block EP, Sector V, Globsyn Crystals, Salt Lake Electronics Complex,
Kolkata – 700091, West Bengal (India)
Phone: +91-33-6453 0005 / 84201 68488 • Fax: +91-33-23573684
Web: [Link] • e-mail: skills4india@[Link]

You might also like