Oracle SQL in 10 Minutes - Asim Abbasi

CH1: SQL Basics | CH2:  SQL Operators | CH3:  SQL Built-in Functions | CH4: SQL Joins | CH5: UPDATE, INSERT & DELETE Statements | CH6: CREATE, ALTER & DROP Statements | CH7: Constraints | CH8: Linking Tables vs Joining Tables | CH9: SQL Statements for Other Database Objects | CH10: SQL Statements for Database Security

Chapter 6: CREATE, ALTER & DROP Statement

Page #: 1 | 2 | 3 | 4

 

Once you write this statement in SQL*Plus or iSQL after logging in, a table with the name “album” will get created having four columns viz., id, title, artist and activity. In the last column we will insert the date when the record got submitted.

You can create as many tables you want and they all will be under your schema. No one else beside DBA can have access to them unless you or DBA grant access explicitly.

Example:

CREATE TABLE emp_dept
AS SELECT *
FROM scott.emp
WHERE deptno = 10;
This is another way of creating table. Not only the structure but the data will get copied too in the emp_dept table.

Chapter 6: CREATE, ALTER & DROP Statement

Page #: 1 | 2 | 3 | 4

CH1: SQL Basics | CH2:  SQL Operators | CH3:  SQL Built-in Functions | CH4: SQL Joins | CH5: UPDATE, INSERT & DELETE Statements | CH6: CREATE, ALTER & DROP Statements | CH7: Constraints | CH8: Linking Tables vs Joining Tables | CH9: SQL Statements for Other Database Objects | CH10: SQL Statements for Database Security

Share with others: