Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
 
 


 

Mysql date field

                         

Mysql date field help you to create the data field and their respective data type.

Understanding with Example

The Tutorial illustrate an example to create date field in Mysql. The create table statement is used to create a table 'employee2' with field name and date respectively. The data type used for date is date data type.  

Query for creating date field:-

CREATE TABLE employee2( Empid int(10),Empname varchar(60),date date );

Output:-

Query for insertion of data:-

The insert into add the records value into the table 'employee2'.The format of date date type is 'YYYY-MM-DD'.

mysql> insert into employee2 values('02','Girish','2008-12-23');
mysql> insert into employee2 values('01','Komal','2008-12-21');

Query for viewing data of the table:-

To view a table, we use select Query to display the records from a table 'employee2'. 

mysql> select * from employee2;

Output:-

+-------+---------+------------+
| Empid | Empname | date |
+-------+---------+------------+
| 2 | Girish | 2008-12-23 |
| 1 | Komal | 2008-12-21 |
+-------+---------+------------+
2 rows in set (0.00 sec)

                         

» View all related tutorials
Related Tags: sql mysql c orm form time make format display value this create for ie example values exam e it mms

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.