Which of the following SQL statements can be used to display the list of available tables?
-
Select * from tables
-
Select * from tab
-
Select * from tabs
-
Select all from tab
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.