Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Mysql Alter Allow Null 
 

Mysql Alter Allow Null is used to change the Null Type of a column in a table.The Allow Null allows the null type characteristics in a column of the table.

 

Mysql Alter Allow Null

                         

Mysql Alter Allow Null is used to change the Null Type of a column in a table.The Allow Null allows the null type characteristics in a column of the table. The Null Type column can be leave empty.

Understand with Example

The section of Tutorial illustrate an example from 'Mysql Alter Allow Null'.To understand this example we create a table 'usertable' with required fieldname and datatype respectively.

 

 

 

Create table 'usertable':

CREATE TABLE `usertable` ( 
`username` varchar(200) NOT NULL, 
`first_name` varchar(200) NOT NULL, 
`last_name` varchar(200) NOT NULL 
)

Query to insert records or rows to the table 'usertable':

The insert into is used to add the records or rows to the table 'usertable'.


insert into usertable values('vin','Vineet','Bansal');
insert into usertable values(' srbh','Sourabh','Ranjan');
insert into usertable values(' amit','Amit','Kumar');

insert into usertable values('sandeep','Sandeep','Kumar');

Query to view the details of 'usertable':

The Select Query helps you to return the detail from table 'usertable'.

select * from usertable;

 

+----------+------------+-----------+
| username | first_name | last_name |
+----------+------------+-----------+
| vin | Vineet | Bansal |
| srbh | Sourabh | Ranjan |
| amit | Amit | Kumar |
| sandeep | Sandeep | Kumar |

Alter Table "usertable" last_name allow NULL

The Alter Query is used to modify or change the 'usertable ' definition and modify keyword allows the null value to be 'YES' in the table 'usertable'.

ALTER table usertable Modify last_name varchar(50) null;

Describe Table:

The Describe Table is used to describe the FieldType,Null,Key,etc of table 'usertable'..

Describe usertable;

 

+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| username | varchar(50) | NO | | | |
| first_name | varchar(200) | NO | | | |
| last_name | varchar(50) | YES | | | |
+------------+--------------+------+-----+---------+-------+

                         

» View all related tutorials
Related Tags: sql mysql c query rest table select io return tab show if condition ie record where records ci ws sh

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.