ALTER COMMAND syntaxes:----------------------
ADDING COLUMN:
SYNTAX: ALTER TABLE <TABLENAME> ADD <COLUMNNAME> <DATATYPE>
EG: ALTER TABLE PARTY ADD JDATE DATE
DROPING COLUMN:
SYNTAX: ALTER TABLE <TABLENAME> DROP <COLUMNNAME>
EG: ALTER TABLE PARTY DROP JDATE
INCREASING DATATYPE LENGH:
SYNTAX:ALTER TABLE <TABLENAME> ADD COLUMNNAME DATATYPE<NEWLENGTH>
EG: ALTER TABLE PARTY ADD PARTYNAME VARCHAR(50)
ADDING CONSTRAINT:
SYNTAX: ALTER TABLE <TABLENAME> ADD CONSTRAINT <CONSTRAINTAME> PRIMARY/UNIQUE/CHECK
/REFERENCES(COLUMNS OR EXPRESSION)
EG:ALTER TABLE PARTY ADD CONSTRAINT CHK_SAL CHECK (PARTYSAL>100000)
Note: to add primary key or unique the column should have not null defined on it.
EG: ALTER TABLE PARTY ADD CONSTRAINT uk UNIQUE(PARTYNAME)
MODIFYING CONSTRAINT:
SYNTAX: ALTER TABLE <TABLENAME> MODIFY CONSTRAINT <CONSTRAINTAME> PRIMARY/UNIQUE
/CHECK/REFERENCES
EG:ALTER TABLE PARTY MODIFY CONSTRAINT CHK_SAL
CHECK (PARTYSAL>100000 AND PARTYSAL<200000)
DROPING CONSTRAINT:
SYNTAX:ALTER TABLE <TABLENAME> DROP CONSTRAINT <CONSTRAINTNAME>
EG: ALTER TABLE PARTY DROP CONSTRAINT CHK_SAL
NO FALLBACK TO FALLBACK:
SYNTAX: ALTER TABLE <TABLENAME>,FALLBACK
EG: ALTER TABLE PARTY,FALLBACK
CHANGING DATA BLOCKSIZE:
SYNTAX:ALTER TABLE <TABLENAME>, DATABLOCKSIZE=<MEMORY>BYTES IMMEDIATE
EG: ALTER TABLE <TABLENAME>, DATABLOCKSIZE=1200 BYTES IMMEDIATE
RENAMING THE COLUMN:
SYNTAX: ALTER TABLE <TABLENAME> RENAME <OLDNAME>TO <NEWNAME>
EG: ALTER TABLE PARTY RENAME PARTYCD TO PARTYCODE
RENAMING A TABLE:
SYN: RENAME TABLE <OLDTABLE> TO <NEW TABLE>
EG: RENAME TABLE PARTY TO PARTY_NEW
ADDING COMPRESS:
ALTER TABLE PARTY ADD PARTYCODE COMPRESS NULL;
ALTER TABLE PARTY ADD ACCOUNTTYPE COMPRESS 'sAVINGS';
ALTER TABLE PARTY ADD ACCOUNTTYPE COMPRESS 'sAVINGS','Current';
ADDING COLUMN:
SYNTAX: ALTER TABLE <TABLENAME> ADD <COLUMNNAME> <DATATYPE>
EG: ALTER TABLE PARTY ADD JDATE DATE
DROPING COLUMN:
SYNTAX: ALTER TABLE <TABLENAME> DROP <COLUMNNAME>
EG: ALTER TABLE PARTY DROP JDATE
INCREASING DATATYPE LENGH:
SYNTAX:ALTER TABLE <TABLENAME> ADD COLUMNNAME DATATYPE<NEWLENGTH>
EG: ALTER TABLE PARTY ADD PARTYNAME VARCHAR(50)
ADDING CONSTRAINT:
SYNTAX: ALTER TABLE <TABLENAME> ADD CONSTRAINT <CONSTRAINTAME> PRIMARY/UNIQUE/CHECK
/REFERENCES(COLUMNS OR EXPRESSION)
EG:ALTER TABLE PARTY ADD CONSTRAINT CHK_SAL CHECK (PARTYSAL>100000)
Note: to add primary key or unique the column should have not null defined on it.
EG: ALTER TABLE PARTY ADD CONSTRAINT uk UNIQUE(PARTYNAME)
MODIFYING CONSTRAINT:
SYNTAX: ALTER TABLE <TABLENAME> MODIFY CONSTRAINT <CONSTRAINTAME> PRIMARY/UNIQUE
/CHECK/REFERENCES
EG:ALTER TABLE PARTY MODIFY CONSTRAINT CHK_SAL
CHECK (PARTYSAL>100000 AND PARTYSAL<200000)
DROPING CONSTRAINT:
SYNTAX:ALTER TABLE <TABLENAME> DROP CONSTRAINT <CONSTRAINTNAME>
EG: ALTER TABLE PARTY DROP CONSTRAINT CHK_SAL
NO FALLBACK TO FALLBACK:
SYNTAX: ALTER TABLE <TABLENAME>,FALLBACK
EG: ALTER TABLE PARTY,FALLBACK
CHANGING DATA BLOCKSIZE:
SYNTAX:ALTER TABLE <TABLENAME>, DATABLOCKSIZE=<MEMORY>BYTES IMMEDIATE
EG: ALTER TABLE <TABLENAME>, DATABLOCKSIZE=1200 BYTES IMMEDIATE
RENAMING THE COLUMN:
SYNTAX: ALTER TABLE <TABLENAME> RENAME <OLDNAME>TO <NEWNAME>
EG: ALTER TABLE PARTY RENAME PARTYCD TO PARTYCODE
RENAMING A TABLE:
SYN: RENAME TABLE <OLDTABLE> TO <NEW TABLE>
EG: RENAME TABLE PARTY TO PARTY_NEW
ADDING COMPRESS:
ALTER TABLE PARTY ADD PARTYCODE COMPRESS NULL;
ALTER TABLE PARTY ADD ACCOUNTTYPE COMPRESS 'sAVINGS';
ALTER TABLE PARTY ADD ACCOUNTTYPE COMPRESS 'sAVINGS','Current';
VIP Escorts having titillating and dumbfounding escort ladies. Our Escorts young ladies' region unit out there in each critical country of Pakistan. We affirmation and confirmation as for your insurance and security. Islamabad escorts Our escort young ladies always make positive to outline your moment outrageously enchant and beguiling.
ReplyDeleteselenium trainings
ReplyDeletepython training
SAP ABAP training
SSAP PP online training
data science training
teradata training