Oracle:
- To get all the tables that you own: select * from user_tables;
- To get all the tables that you have access: select * from all_tables;
- If you have access to the DBA_TABLES data dictionary view: select * from dba_tables;
- From legacy CAT view: select * from CAT where TABLE_TYPE = 'TABLE';
- To get all the table columns: select * from all_tab_columns order by owner, table_name, column_id;
DB2:
- SELECT * FROM SYSCAT.TABLES
- To get all the table columns: SELECT COLNAME FROM SYSCAT.COLUMNS order by TABNAME;
MySQL
- SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' ;
- To list all the table columns: SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS order by TABLE_NAME
-------------------------------------------------------------------------------------------------------------------
If you have ever asked yourself these questions, this is the book for you. What is the meaning of life? Why do people suffer? What is in control of my life? Why is life the way it is? How can I stop suffering and be happy? How can I have a successful life? How can I have a life I like to have? How can I be the person I like to be? How can I be wiser and smarter? How can I have good and harmonious relations with others? Why do people meditate to achieve enlightenment? What is the true meaning of spiritual practice? Why all beings are one? Read the book free here.
do you know the query to select tables with a common string in its name ? please write a post on that
ReplyDeleteYou can add a WHERE clause to the end of the queries listed in this blog. An example for the Oracle database is, select * from all_tables WHERE TABLE_NAME like '%your string%';
DeleteHere is the link of the post.
Deletehttp://www.flyingjxswithjava.blogspot.com/2014/02/how-to-list-all-table-names-containing.html
Thanks for the quick reply. Your posts have very simple explanations, just what i need.
ReplyDeleteI am trying to comment using an AOL id, but it doesn't seem to work anyway thanks.
Selena
I am glad that you like my posts.
Delete