Oracle Database Common Statements

Source: Internet
Author: User

To build a table statement:
CREATE TABLE test1 (ID varchar2 () NOT null primary key);
Add a table field:
ALTER TABLE test1 Add (name VARCHAR2 () default ' null ' NOT NULL);
Add multiple table fields:
ALTER TABLE test1 Add (name VARCHAR2 () default ' null ' not null,age ' null ' for integer default ' not ');
Modify Table Name:
ALTER TABLE table1 Rename to test1;
To delete a table:
1.delete from table name,---is DML, does not take effect when commit is not executed, does not delete table structure, only deletes table contents;
2.drap table name,---the immediate effect cannot be rolled back; execution deletes table structure and dependencies; it does not free up space;
3.truncate table name,---the direct effect can not be rolled back, do not delete the table structure, only delete the table content, will free up space;


To modify a statement:
Update table name set field 1 = ' Value ', field 2 = ' value ' WHERE field = ' value ';

Insert statement:
Insert into table name (Field 1, Field 2, ...) VALUES (' Value ', ' value ', ...) );

Or
Insert INTO (select A1,a2,... from table name) VALUES (' Value ', ' value ', ... );

Undo operation: Rollback;
Commit action: Commit;

Oracle Database Common Statements

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.