Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Sql Mysql-table SQL All Column Names

Related Tutorials


 
 

Share on Google+Share on Google+

SQL All Column Names

Advertisement
SQL All Column Names is useful when you want to see the Field, Type, Null, Key etc from the table records.

SQL All Column Names

     

SQL All Column Names is useful when you want to see the Field, Type, Null, Key etc from the table records.

Understand with Example

The Tutorial briefs you on 'SQL All Column Names'. To understand and grasp the example we create a table 'Stu' with required fieldnames and datatypes respectively.

 

 

Create Table Stu:

Create Table Stu(Id int,Name Varchar(15));

Query:

The Query below is used to show the Field, Type, Null etc of the table 'Stu'.

SHOW COLUMNS FROM STU;

Result

+--------+-------------+------+-----+---------+-------+
| Field  | Type        | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| Id     | varchar(2)  | YES  |     |         |       |
| Name   | varchar(15) | YES  |     |         |       |
| Class  | varchar(10) | YES  |     |         |       |
| sub_id | varchar(2)  | YES  |     |         |       |
| marks  | varchar(3)  | YES  |     |         |       |
+--------+-------------+------+-----+---------+-------+
Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 6, 2010

Related Tutorials

Discuss: SQL All Column Names  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com