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.


 
Ads

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

Ads
Share on Google+Share on Google+

SQL All Column Names

Posted on: October 6, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: SQL All Column Names  

Post your Comment


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

Ads

 

Ads