The most basic SQL statement in Oracle

Source: Internet
Author: User

OracleHow to display all current user tables

Show all tables of a user (for example, Scott, uppercase is required)

Select table_name from all_tables where owner = 'Scott ';

Show all current user tables

Select * From user_tables

Display All Tables of the current database

Select * From tab;

Displays information about all columns in a table.

Select * From user_tab_columns where table_name in ('order _ status2 ');

Display the space name of the current data table

You can use sys User Login

Select tablespace_name from dba_tables where table_name = upper ('name of the table you operated ')

The displayed tablespace_name is the name of the tablespace you are currently operating on.

Run the Statement of the local SQL file (the file used in learning is number. SQL)

SQL> @ C:/number. SQL

Insert Date

Insert into order_status2 values (00001, 'good', to_date ('201312', 'yyyymmdd'), 2, to_date ('20170101', 'yyyymmdd '));

Add columns and set default values

Alter table order_status2 add initially_created date default sysdate not null;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.