LearnDataModeling.Com
Learn Testing! - Software Testing Life Cycle and Mobile Apps Testing.

Learn BI & Informatica! Fundamentals and concepts with real-time examples.
 
  • Home
  • Business Process
  • Data Modeling(DM)
  • DM & Database
  • DW & ETL
  • Software & Mobile Apps Testing
  • BI
  • Cloud Computing




You are here: Home Data Modeling & Database Oracle DDL Statements - ALTER Commands

Oracle Database Data Definition Language(DDL Statements) - ALTER Commands:

In this section, we will try to explain about important database ALTER commands that are used by a data modeler by relating it with our example data.

ALTER TABLE - Add column:

ALTER TABLE EMPLOYEE_DTL ADD JOIN_DATE DATE;

ALTER TABLE - Rename column:

ALTER TABLE EMPLOYEE_DTL RENAME column JOIN_DATE TO EMP_JOIN_DT;

ALTER TABLE - Modify column's datatype:

ALTER TABLE EMPLOYEE_DTL MODIFY EMP_JOIN_DT VARCHAR2(10);


         


ALTER TABLE - Drop column:

ALTER TABLE EMPLOYEE_DTL DROP COLUMN EMP_JOIN_DT;

ALTER TABLE - Add check constraint:

ALTER TABLE EMPLOYEE_DTL ADD CONSTRAINT CH_SAL CHECK(SLRY_AMT BETWEEN 4000 AND 7000);

ALTER TABLE - Add unique constraint:

ALTER TABLE EMPLOYEE_DTL ADD CONSTRAINT UN_SSN UNIQUE(SSN);

ALTER TABLE - Disable/Enable/Drop constraint:

ALTER TABLE EMPLOYEE_DTL DISABLE CONSTRAINT UN_SSN;
ALTER TABLE EMPLOYEE_DTL ENABLE CONSTRAINT UN_SSN;
ALTER TABLE EMPLOYEE_DTL DROP CONSTRAINT UN_SSN;

ALTER TABLE - Modify constraint:

ALTER TABLE EMPLOYEE_DTL MODIFY SLRY_AMT NUMBER(7,2) NULL;
ALTER TABLE EMPLOYEE_DTL MODIFY SLRY_AMT NUMBER(7,2) NOT NULL;




DDL Statements - Create Commands       DML Statements





Blog
This Blog is an extension of LearnDataModeling.com and in here we post the latest articles and topics related to this site. Users can also post their questions and suggestions so that, it will be easier for us to answer the questions then and there!

Quick Links
» Business/Data Modeling Types
» Business Process Modeling
» Data Modeling Overview
» Steps to create a Data Model
» Supertype & Subtype
» Erwin Tutorial
» Dimensions
» Slowly Changing Dimensions
» Star Schema
» Data Warehouse Concepts
» ETL Concepts
» What is Business Intelligence?
Home     |     About Us     |     Contact Us     |     Testimonial     |     Articles     |     Blog

Copyright© LearnDataModeling.com. All Rights Reserved. Contact: Admin@LearnDataModeling.Com.