I'm studying DDBB and we are using Oracle. Using too much tables can be really difficult for me because I have to remember table1.content2, table3.content1, etc.
So because of that, I would like to print (in paper) the header tables to make it easier.
I know my explanation is not very good so I tried to "draw it" below:
select * from user_tables;
↓
table_name|
-----------
table1 |
-----------
table2 |
-----------
table3 |
What I want:
table1
-----------------------------
content1| content2| content3|
table2
-----------------------------
content1| content2| content3|
table3
-----------------------------
content1| content2| content3|
How can I get this in paper?
Thanks!
Best Answer
You can do a describe using SQLplus or SQL Developer:
desc myschema.mytable
This way you'll also see the column's datatype and whether it can be null or not.If you want the fields listed horizontally, try
select * from myschema.mytable where rownum = 1
This will bring you back one row, with all the column names listed on one line, although they may be spaced out considerably. This way, you'd also have a row of sample data.