Home Sql Mysql-table SQL All Column Names
Questions:Ask|Latest


 
 

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

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

Ask Questions?    Discuss: SQL All Column Names  

Post your Comment


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