Method 1 for querying table field attributes in Oracle: search for all indexes in the table (including index names, types, and columns): select t. *, I. index_type from user_ind_columns t, user_indexes I where t. index_name = I. index_name and t. table_name = I. table_name and t. table_name = Name of the table to be queried 2. Search for the table's primary key (including the name and column composition): select cu. * from user_cons_columns cu, user_constraints au where cu. constraint_name = au. constraint_name and au. constraint_type = 'p' and au. table_name = table to be queried 3. uniqueness constraints of the query table (including names and columns): select column_name from user_cons_columns cu, user_constraints au where cu. constraint_name = au. constraint_name and au. constraint_type = 'U' and au. table_name = table to be queried 4. Search for the table's foreign key (including the name, referenced table name, and corresponding key name. The following is a multi-step query ): select * from user_constraints c where c. constraint_type = 'r' and c. table_name = Name of the column whose foreign key constraint is to be queried: select * from user_cons_columns cl where cl. constraint_name = foreign key name: select * from user_cons_columns cl where cl. constraint_name = foreign key reference table key name 5. query all columns of the table and their attributes select t. *, c. comments from user_tab_columns t, user_col_comments c where t. table_name = c. table_name and t. column_name = c. column_name and t. table_name = the table to be queried 6. query all non-empty fields in the table select * from user_tab_columns t where t. TABLE_NAME = 'table to be query' and t. NULLABLE = 'n'; query table space (allocated and total Scalable) select t. TABLESPACE_NAME, sum (t. BYTES) as the allocated tablespace size, sum (t. MAXBYTES) as a total scalable size from dba_data_files t where t. TABLESPACE_NAME = 'table space to be queried 'group by t. TABLESPACE_NAME; query the table space (idle tablespace size) select sum (bytes) from dba_free_space t where t. TABLESPACE_NAME = 'table space to be queried 'group by tablespace_name; used = allocated-idle;