Geeks Talk

Prepare for your Next Interview




Query to find structure of a table

This is a discussion on Query to find structure of a table within the SQL forums, part of the Databases category; Please give me the query.. How to findout the structure of a table? Question asked by visitor Mahesh.Mk...


Go Back   Geeks Talk > Databases > SQL

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 04-24-2007
Expert Member
 
Join Date: Feb 2007
Posts: 1,279
Thanks: 0
Thanked 164 Times in 138 Posts
Geek_Guest is on a distinguished roadGeek_Guest is on a distinguished road
Query to find structure of a table

Please give me the query.. How to findout the structure of a table?

Question asked by visitor Mahesh.Mk
Reply With Quote
The Following 2 Users Say Thank You to Geek_Guest For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 04-24-2007
Junior Member
 
Join Date: Apr 2007
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
yuvarajan2000 is on a distinguished road
Thumbs up Re: Query to find structure of a table

desc tablename
Reply With Quote
  #3 (permalink)  
Old 04-24-2007
Junior Member
 
Join Date: Apr 2007
Location: India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
prabhukalai is on a distinguished road
Re: Query to find structure of a table

DESC TABLE_NAME;

eg:

DESC EMP;

EMP is name of table.
Reply With Quote
  #4 (permalink)  
Old 04-24-2007
Moderator
 
Join Date: Sep 2006
Location: Delhi (India)
Posts: 866
Thanks: 12
Thanked 81 Times in 65 Posts
jainbrijesh is on a distinguished road
Re: Query to find structure of a table

yes Desc Table_name is the query.

Desc stands for describe.
__________________
Brijesh Jain
brijesh.tester@yahoo.co.in
http://softwaretestingexpertise.blogspot.com
Reply With Quote
  #5 (permalink)  
Old 04-25-2007
Expert Member
 
Join Date: Nov 2006
Location: Hyd-IND
Posts: 523
Thanks: 1
Thanked 55 Times in 46 Posts
sutnarcha is on a distinguished road
Re: Query to find structure of a table

All the answers given above are correct. But, as far as I know,

DESC /tablename/

is not a query. It is an SQL-Plus command.

Because only SELECT statements can be called as a query.
__________________
Lack of WILL POWER has caused more failure than
lack of INTELLIGENCE or ABILITY.

-sutnarcha-
Reply With Quote
  #6 (permalink)  
Old 04-25-2007
Contributing Member
 
Join Date: Mar 2007
Posts: 43
Thanks: 1
Thanked 2 Times in 2 Posts
varmakub is on a distinguished road
Re: Query to find structure of a table

Good one from sutnarcha !!!
Yes !!! its not a query - Which retrieves some data from the databse :-)
Reply With Quote
  #7 (permalink)  
Old 06-01-2007
Junior Member
 
Join Date: Apr 2007
Location: Chennai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Cguna is on a distinguished road
Re: Query to find structure of a table

Quote:
Originally Posted by Geek_Guest View Post
Please give me the query.. How to findout the structure of a table?

Question asked by visitor Mahesh.Mk
desc Table Name;
Reply With Quote
  #8 (permalink)  
Old 06-05-2007
Junior Member
 
Join Date: Dec 2006
Location: salem
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
kaarthi_bala is on a distinguished road
Re: Query to find structure of a table

SQL> desc table_name
eg
SQL> desc emp

or
SQL> describe table_name
Reply With Quote
  #9 (permalink)  
Old 09-04-2007
Junior Member
 
Join Date: Feb 2007
Location: pulivendula,kadapa(district),a.p,india
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
yagnam ramesh babu is on a distinguished road
Thumbs up Re: Query to find structure of a table

desc
Reply With Quote
  #10 (permalink)  
Old 10-23-2007
Junior Member
 
Join Date: Oct 2007
Location: delhi
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
arunendra kumar is on a distinguished road
Re: Query to find structure of a table

desc object_name.
Reply With Quote
  #11 (permalink)  
Old 10-23-2007
Contributing Member
 
Join Date: Aug 2007
Posts: 67
Thanks: 9
Thanked 9 Times in 8 Posts
raj1402 is on a distinguished road
Re: Query to find structure of a table

Desc tablename i think its also a query anything getting information is query i quess!!!
Reply With Quote
  #12 (permalink)  
Old 09-01-2008
Junior Member
 
Join Date: Sep 2008
Location: Bangladesh
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
tarikuzzaman is on a distinguished road
Re: Query to find structure of a table

select COLUMN_NAME, DATA_TYPE
from USER_TAB_COLUMNS
where TABLE _NAME = 'your table name'; .....(Like 'emp')
Reply With Quote
  #13 (permalink)  
Old 09-01-2008
Expert Member
 
Join Date: Jun 2007
Location: Australia
Posts: 242
Thanks: 6
Thanked 8 Times in 8 Posts
Sushma Mosali is on a distinguished road
Re: Query to find structure of a table

hi,

agree with sutnarcha

Thanks
Sushma
Reply With Quote
Reply

  Geeks Talk > Databases > SQL


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to find Table Size timmy Oracle 2 09-23-2008 04:52 AM
Structure of Salary nehalshah Companies 2 12-07-2007 07:10 AM
Creating a table by copying another table's structure Allan Paul Oracle 12 07-12-2007 07:53 AM
How a java table be brought to data table? dhandhan QTP 0 04-15-2007 06:14 AM
How to find Defined key fields in a table? sharifhere SQL 2 02-22-2007 01:01 AM


All times are GMT -4. The time now is 01:08 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved