Query that fetches all table names & column names in a schema [duplicate] - sql

This question already has answers here:
Get list of all tables in Oracle?
(24 answers)
Closed 8 years ago.
I want to retrieve all table names and column names IN A SCHEMA. So if I am in schema scott it should only show all the tables present in scott.
And can the query below only retrieve the tables in a schema?
Select * from tab;

select *
from all_tab_columns
where owner = 'SCOTT'
More details in the manual: http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_part.htm#i125539

This query should work:
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS

Related

Database oracle [duplicate]

This question already has answers here:
Get list of all tables in Oracle?
(24 answers)
Closed 8 years ago.
How can i know the total no of tables created with their names!!!in SQL oracle Commands ??
So that i can drop the unnecessary tables......
This question/answer should give you the details you need:
Get list of all tables in Oracle?
but in summary...
-- If you have access
SELECT owner, table_name
FROM dba_tables
-- Will show what your user has access to
SELECT owner, table_name
FROM all_tables
SHOW TABLES IN `db`;
Where db is the name of your database.

Query for All Tables and Fields in an Oracle Db [duplicate]

This question already has answers here:
Get list of all tables in Oracle?
(24 answers)
Closed 8 years ago.
I am using an Oracle DB with which I'm not familiar.
I would like to export something like a matrix of all tables and fields. Is this possible? Thanks.
Try to use a system table ALL_TAB_COLUMNS
SELECT table_name, column_name
FROM ALL_TAB_COLUMNS
More information
SELECT * FROM all_tables;
SELECT * fROM all_tab_columns;
http://www.techonthenet.com/oracle/sys_tables/

How can I SELECT that lists all the field names and their types for a given Db Table? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
SQL Server: How do you return the column names from a table?
Assume that I have Data base table: LunchMenuItems
For the MS-SQL Server, how can I write a TSQL query that :
Lists all the column names and their types in LunchMenuItems table?
Description
This Information can be found in information_schema.columns.
Sample
select column_name, DATA_TYPE from information_schema.columns
where table_name = 'LunchMenuItems'
More Information
COLUMNS (Transact-SQL)

Get list of table names in different schema of an Oracle database [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Oracle: get list of all tables?
How do I list all tables in a schema in Oracle SQL?
I want to list all table in another schema.
connect hr/hr;
select table_name from user_tables;
but I want to skip the "connect" command. I want to run query from another schema.
Is that possible to do?
SELECT TABLE_NAME
FROM ALL_TABLES
WHERE OWNER='OTHER-SCHEMA'

Finding the column in tables? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
SQL Server 2008: find all tables containing column with specified name
Hi all,
I have 30 tables in my database, in some of tables i have a common column, assume 'eno'. How can i find the tables of 'eno'. Thank you...
You could use the INFORMATION_SCHEMA.COLUMNS system view:
SELECT DISTINCT table_name
FROM information_schema.columns
WHERE column_name = 'eno'