Skip to Content
Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts
book

Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts

by John Adolph Palinski
August 2002
Intermediate to advanced content levelIntermediate to advanced
528 pages
10h 12m
English
Addison-Wesley Professional
Content preview from Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts

Identifying Table and Column Names

SQL*Plus has two tools for finding out the names of the database tables and the names of the columns in the tables:

  • SELECT TNAME FROM TAB; This SELECT statement will list the table and view names for which you have access.

  • DESC (table name) or Describe (table name) Either version of the command displays the names, data types, and NOT NULL constraints of the columns contained in the table or view.

Identifying table and column names are two of the common tasks you will perform when using a database. If you don’t have a table relationship diagram, these tools will be very useful to you.

Listing 4.1 illustrates the use of the former command.

Listing 4.1. Displays Table Names
 SQL> select tname from tab; TNAME ------------------------------ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Expert PL/SQL Practices for Oracle Developers and DBAs

Expert PL/SQL Practices for Oracle Developers and DBAs

John Beresniewicz, Adrian Billington, Martin Büchi, Melanie Caffrey, Ron Crisco, Lewis Cunningham, Dominic Delmolino, Sue Harper, Torben Holm, Connor McDonald, Arup Nanda, Stephan Petit, Michael Rosenblum, Robyn Sands, Riyaj Shamsudeen
Beginning Oracle SQL: for Oracle Database 12c, Third Edition

Beginning Oracle SQL: for Oracle Database 12c, Third Edition

Lex De Haan, Tim Gorman, Inger Jørgensen, Melanie Caffrey

Publisher Resources

ISBN: 0201752948Purchase book