Database oracle [duplicate] - sql

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.

Related

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

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

Displaying the name and data type of every column in a table [duplicate]

This question already has answers here:
How To Find Datatypes information in oracle schema?
(2 answers)
Closed 9 years ago.
I am working on a Database Management Systems assignment and have been unable to find a way to display the name and datatype of every column in a specific table. I don't know if this is needed but here is the link to the schema I am using for this assignment.
http://mym.cdn.laureate-media.com/2dett4d/Walden/ITEC/ITEC2060/documents/Schema.sql
The employee table is what I am trying to display from.
To list all columns for a specific table:
select column_name, data_type
from all_tab_columns
where table_name = 'EMPLOYEES';
More details in the manual: http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_2103.htm#I1020277
If you are using SQL*Plus you can simply run
desc EMPLOYEES
instead.
Most other SQL clients have a similar feature.

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/

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'