Multiple choice

Which of the following SQL statements can be used to display the list of available tables?

  1. Select * from tables

  2. Select * from tab

  3. Select * from tabs

  4. Select all from tab

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The above statement is a valid statement and will display a list of tables available in a user's account. The statement will also print the names of the available view, synonyms etc. The select * from tab statement actually queries a synonym named tab which is in the System user account. All the users created in Oracle have a default access to the synonym. Therefore when we are issuing the above statement we are in fact querying the said synonym.