Skip to main content

SQL Query to find number of columns of a table


I have been receiving lots of mails on how to find number of columns of a table without using DESCRIBE command or using a statement.

This is very simple, you just have to know another Data Dictionary Table USER_TAB_COLUMNS.

SELECT count(*)
from USER_TAB_COLUMNS
where table_name = 'EMP';





Happy Reading........

 

Comments

Unknown said…
Hello sir..i have a query..actually i was using ORACLE 10G software for SQL in my windows 7, 64 bit...at first it was working properly but after some time i was not able to use it and started getting an error i.e. ORA-01033: ORACLE initialization and shutdown in progress.
Unknown said…
What should i do to fix it and i have re-installed it many times..
is there any other way to fix this problem ?

Popular posts from this blog

Basics of RDBMS

Data Small set of information becomes data, this set of information helps make decision. Data is always some useful information. Database Place where you store the data. Database represents some aspect of the real world called "miniworld". A database is designed, built and populated with data for a specific purpose. It has intended group of users and some preconceived applications in which these users are interested. In other words, a database has some source from which data is derived, some degree of interaction with events in the real world and an audience that is actively interested in the contents of the database. Database can also be defined as collection of one or more tables. Ex: Mobile, human brain etc DBMS (Database Management System ) Is a program that stores retrieves and modifies data in the database on request. Study of different techniques of design, development and maintenance of the database Types of DBMS These types are based upon their m...

SQL Interview Questions

1. CLICK HERE FOR QUESTIONS ON BASIC SELECT     2. CLICK HERE FOR QUESTIONS ON BASIC SELECT WITH CONDITION   3.  CLICK HERE FOR QUESTIONS FROM QSPIDERS   4. CLICK HERE FOR QUESTIONS ON FUNCTIONS   5. CLICK HERE FOR QUESTIONS ON SUBQUERIES 6. CLICK HERE FOR MORE QUESTIONS ON SQL       CLICK HERE FOR ANSWERS   Some more Online Questions.   On WIZIQ.COM  -- 66 Questions and its answers Found by Neha Abhay Kumar   On SCRIBD.COM   -- 235 Questions and its answers