Listing the contents of the scott/tiger schema [message #256153] |
Fri, 03 August 2007 03:48 |
greekozz
Messages: 8 Registered: August 2007
|
Junior Member |
|
|
I would like to know if there is a command in order to see the contents of the scott/tiger schema.
if i use DESCRIBE i get only the contents of the given table, but i want to see
every table existing with its description like doing an ls -l or dir .
even better does anybody have a link where i can see all that in a
picture-diagram with also the relationships showing?
I hope i am not asking too much.
ps. i am using sqlplus on unix.
[Updated on: Fri, 03 August 2007 03:52] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: Listing the contents of the scott/tiger schema [message #256210 is a reply to message #256199] |
Fri, 03 August 2007 07:33 |
S.Rajaram
Messages: 1027 Registered: October 2006 Location: United Kingdom
|
Senior Member |
|
|
I will give you the sql which output two of your required columns and you solve the output for the third column.
good luck
1 select case column_id when 1 then table_name else null end as table_name,
2 column_name
3* from user_tab_columns
SQL> /
TABLE_NAME COLUMN_NAME
------------------------------ ------------------------------
DEPT DEPTNO
DNAME
LOC
EMP EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
TABLE_NAME COLUMN_NAME
------------------------------ ------------------------------
BONUS ENAME
JOB
SAL
COMM
SALGRADE GRADE
LOSAL
HISAL
|
|
|
|
|
Re: Listing the contents of the scott/tiger schema [message #256374 is a reply to message #256241] |
Sat, 04 August 2007 01:40 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
No, your question was not strange.
It's just that you have to realize that 'regular' sql returns rows with values in each column.
You only want to see values in certain columns (table name, number of columns) under specific conditions (only for the first row per table). That requires more complicated sql; more complicated than you would understand at the point you are.
Remember: the more formatting you want in your sql-output, the more complicated the sql gets.
Good luck with your next steps on the sql-path (and enjoy! It really is fun), and don't hesitate to come back when you get stuck.
|
|
|