Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
Understanding Common SQL statements 
 

The commonly used SQL statements are: 1): Select 2): Insert 3): Update 4): Delete

 

Understanding Common SQL statements

                         

The commonly used SQL statements are:

1): Select
2): Insert
3): Update
4): Delete

SQL Select statement:

The SELECT statement is used to select data from a table.

Syntax: Select column_names FROM table_name;

The result from a SQL query is stored in a resultset. The SELECT statement has mainly three clauses.

1). Select
2.) From
3). Where

The Select specifies the table columns that are retrieved. The From clause tells from where the tables has been accessed. The Where clause specifies which tables are used. The Where clause is optional, if not used then all the table rows will be selected.

We can see that we have used semicolon at the end of the select statement. It is used to separate each SQL statement in database systems which helps us to execute more than one SQL statement in the same call to the server.

SQL INSERT Statement:

This statement allows you to insert a single or multiple records into the database. We can specify the name of the column in which we want to insert the data.

Syntax: Insert into table_name values (value1, value2..);

The Insert statement has mainly three clauses.

1). Insert: It specifies which table column has to be inserted in the table.
2). Into : It tells in which the data will be stored.
3). Values: In this we insert the values we have to insert.

We can also specify the columns for which we want to insert data.

The UPDATE Statement:

The Update statement is used to modify the data in the table. Whenever we want to update or delete a row then we use the Update statement.

The syntax is :

UPDATE table_name Set colunm_name = new_value WHERE column_name = some_name;

The Update statement has mainly three clauses.

1). UPDATE: It specifies which table column has to be updated.
2). Set: It sets the column in which the data has to be updated.
3). Where: It tells which tables are used.

SQL DELETE Statement:

This delete statement is used to delete rows in a table.

Systax:

DELETE FROM table_name WHERE column_name = some_name;

The Delete statement has following clauses.

1). Delete: It specifies which table column has to be deleted.
2). From: It tells from where the Table has been accessed.
3). Where: It tells which tables are used.

 


                         

» View all related tutorials
Related Tags: c ant jdbc null insert help tutorial ria this to e des ul in sta nt wan j dbc db

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

2 comments so far (
post your own) View All Comments Latest 10 Comments:

how do u get the date of next friday using jdbc

Posted by pavan on Wednesday, 08.29.07 @ 23:13pm | #24447

Hi friends
i want source of the jdbc.. how to connect jdbc n how to implement the JSP? send me ans..

Posted by karthik on Monday, 03.19.07 @ 11:56am | #12169

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.