Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
SQL Auto increment Primary Key 
 

SQL Auto increment Primary Key is used to allow a unique number to be generated when a new record is inserted into a table.

 

SQL Auto increment Primary Key

                         

SQL Auto increment Primary Key is used to allow a unique number to be generated when a new record is inserted into a table.

Understand with Example

The Tutorial illustrate an elaborative example from 'SQL Auto increment Primary Key'. To understand this example we use a query 'use mysqltutorialabc' that show the database is selected.

 

 

 

 

Create table employee_roseindia:

The create table employee_roseindia is used to create a table 'employee_roseindia' with required fieldname and data type. The following SQL statement is used to define the "Emp_id" to be an auto-increment primary key field in the table "employee_roseindia".

 Show Tables in datebase

Once the table is created ,the show tables shows you the list of tables in database.

Insert into Table :

The insert into adds the records or rows into the table'employee_roseindia'. If we don't insert any values into the primary key column, the auto_increment increment the value by 1 for each new records. 

insert into employee_roseindia values('1','Ranjan','Saurabh','5000');

insert into employee_roseindia values('2','Kumar','Satish','8000');

insert into employee_roseindia values('3','Kumar','Rajesh','10000');

insert into employee_roseindia values(' ','Saxena','Amit','15000');

To View the detail of Table employee_RoseIndia:

select * from employee_roseindia;

Output is displayed as below :

                         

» View all related tutorials
Related Tags: sql mysql c table io multiple sed column ip definition name columns rename tab if to ini modify e it

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 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
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.