Basic Oracle Concepts and Programming Question:
Download Job Interview Questions and Answers PDF
How To List All Tables in Your Schema?
Answer:
If you log in with your Oracle account, and you want to get a list of all tables in your schema, you can get it through the USER_TABLES view with a SELECT statement, as shown in the following SQL script:
SQL> connect HR/globalguideline
Connected.
SQL> SELECT table_name, status, num_rows FROM USER_TABLES;
<pre>TABLE_NAME STATUS NUM_ROWS
------------------------------ -------- ----------
REGIONS VALID 4
LOCATIONS VALID 23
DEPARTMENTS VALID 27
JOBS VALID 19
EMPLOYEES VALID 107
JOB_HISTORY VALID 10
COUNTRIES VALID 25</pre>
7 rows selected.
SQL> connect HR/globalguideline
Connected.
SQL> SELECT table_name, status, num_rows FROM USER_TABLES;
<pre>TABLE_NAME STATUS NUM_ROWS
------------------------------ -------- ----------
REGIONS VALID 4
LOCATIONS VALID 23
DEPARTMENTS VALID 27
JOBS VALID 19
EMPLOYEES VALID 107
JOB_HISTORY VALID 10
COUNTRIES VALID 25</pre>
7 rows selected.
Download Oracle Database Interview Questions And Answers
PDF
Previous Question | Next Question |
How To Turn On or Off Recycle Bin for the Session? | What Is a Table Index? |