Apostila de SQL

Page 16

Exclusão de Restrição •

Sintaxe: ALTER TABLE tabela DROP PRIMARY KEY | UNIQUE (coluna) | CONSTRAINT restrição [CASCADE];

Exemplo: – Remover a chave estrangeira definida sobre a coluna mgr (gerente) na tabela EMP. ALTER TABLE emp DROP CONSTRAINT emp_mgr_fk; – Remover a chave primária da tabela DEPT e eliminar a chave estrangeira definida sobre a coluna deptno da tabela EMP. ALTER TABLE dept DROP PRIMARY KEY CASCADE;

É possível identificar o nome da restrição a partir da visão do dicionário USER_CONSTRAINTS e USER_CONS_COLUMNS. 16


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.