Oracle Database Definition Language (DDL)

Source: Internet
Author: User

--Creating a table with Create encountersCreate Tabletable_name (column_name datatype[null|not NULL], COLUMN_NAME datatype[null|not NULL],...[constraint]);--Syntax Descriptiontable_name: Database table name. column_name: Table field name. DataType: The field type of the data column. [null|not NULL]: The non-null and allowable null limit for the field. [constraint]: Sets constraints in table fields, including: PRIMARY KEY constraint, FOREIGN KEY constraint, check constraint, and so on. --ExampleCreate TableProduct (Pdtidint, Pdtname nvarchar2 ( -),constraintPk_product_pdtidPrimary Key(Pdtid));--To delete a table using dropDrop Tabletable_name;--ExampleDrop TableProduct;--To modify table information by using ALTERAlter Tabletable_nameADDcolumn_name|Modify column_name| Drop columncolumn_name;--Syntax DescriptionADD: Used to add a table field. Modify: Used to modify the type of a table field. Drop column: Delete the columns in the table, if the columns in the tables are added with CASCADE constraints the constraints associated with that column are also removed.
View Code

Oracle Database Definition Language (DDL)

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.