--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)