Category: 01. Oracle Tables
-
CREATE TABLE AS Statement
The CREATE TABLE AS statement is used to create a table from an existing table by copying the columns of existing table. Note: If you create the table in this way, the new table will contain records from the existing table. Syntax: Create Table Example: copying all columns of another table In this example, we…
-
Oracle CREATE TABLE
In Oracle, CREATE TABLE statement is used to create a new table in the database. To create a table, you have to name that table and define its columns and datatype for each column. Syntax: Parameters used in syntax Oracle CREATE TABLE Example Here we are creating a table named customers. This table doesn’t have…
-
Selecting Data
Syntax: To retrieve data from a table: Example: Selecting All Columns: Use an asterisk (*) to select all columns:
-
Deleting Data
Syntax: To remove records from a table: Example Truncating a Table: To delete all records without logging each row: Example:
-
Updating Data
Syntax: To modify existing records in a table: Example: Notes: The WHERE clause is crucial; omitting it will update all rows in the table.
-
Inserting Data
Syntax: To insert new records into a table: Example Bulk Insert: Multiple rows can be inserted at once:
-
Dropping a Table
Syntax: To remove a table and its data from the database: Example: Notes: This operation is irreversible; once executed, all data stored in the table is permanently deleted, and the table structure is removed.
-
Altering a Table
Add a Column: To add a new column to an existing table: Example Modify a Column: To change the datatype or constraints of an existing column: Example Drop a Column: To remove a column from a table: Example