Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SELECT *
- DELETE
- FROM
- esq_ceac_planclase.tbl_syllabus_bibliografias
- WHERE
- NOT EXISTS(SELECT 1 FROM esq_ceac_planclase.tbl_syllabus WHERE esq_ceac_planclase.tbl_syllabus_bibliografias.id_syllabus= esq_ceac_planclase.tbl_syllabus.idregistro);
- ALTER TABLE esq_ceac_planclase.tbl_syllabus_bibliografias
- ADD CONSTRAINT fk_syllabus002 FOREIGN KEY (id_syllabus)
- REFERENCES esq_ceac_planclase.tbl_syllabus (idregistro) ON DELETE CASCADE;
- DELETE
- FROM
- esq_ceac_planclase.tbl_syllabus_comentarios
- WHERE
- NOT EXISTS(SELECT 1 FROM esq_ceac_planclase.tbl_syllabus WHERE esq_ceac_planclase.tbl_syllabus_comentarios.id_syllabus= esq_ceac_planclase.tbl_syllabus.idregistro);
- ALTER TABLE esq_ceac_planclase.tbl_syllabus_comentarios
- ADD CONSTRAINT fk_syllabus002 FOREIGN KEY (id_syllabus)
- REFERENCES esq_ceac_planclase.tbl_syllabus (idregistro) ON DELETE CASCADE;
- DELETE
- FROM
- esq_ceac_planclase.tbl_syllabus_cursos_paralelos
- WHERE
- NOT EXISTS(SELECT 1 FROM esq_ceac_planclase.tbl_syllabus WHERE esq_ceac_planclase.tbl_syllabus_cursos_paralelos.id_syllabus= esq_ceac_planclase.tbl_syllabus.idregistro);
- ALTER TABLE esq_ceac_planclase.tbl_syllabus_cursos_paralelos
- ADD CONSTRAINT fk_syllabus002 FOREIGN KEY (id_syllabus)
- REFERENCES esq_ceac_planclase.tbl_syllabus (idregistro) ON DELETE CASCADE;
- DELETE
- FROM
- esq_ceac_planclase.tbl_syllabus_mallas
- WHERE
- NOT EXISTS(SELECT 1 FROM esq_ceac_planclase.tbl_syllabus WHERE esq_ceac_planclase.tbl_syllabus_mallas.id_syllabus= esq_ceac_planclase.tbl_syllabus.idregistro);
- ALTER TABLE esq_ceac_planclase.tbl_syllabus_mallas
- ADD CONSTRAINT fk_syllabus002 FOREIGN KEY (id_syllabus)
- REFERENCES esq_ceac_planclase.tbl_syllabus (idregistro) ON DELETE CASCADE;
- DELETE
- FROM
- esq_ceac_planclase.tbl_syllabus_mu_departamentos
- WHERE
- NOT EXISTS(SELECT 1 FROM esq_ceac_planclase.tbl_syllabus WHERE esq_ceac_planclase.tbl_syllabus_mu_departamentos.id_syllabus= esq_ceac_planclase.tbl_syllabus.idregistro);
- ALTER TABLE esq_ceac_planclase.tbl_syllabus_mu_departamentos
- ADD CONSTRAINT fk_syllabus002 FOREIGN KEY (id_syllabus)
- REFERENCES esq_ceac_planclase.tbl_syllabus (idregistro) ON DELETE CASCADE;
- DELETE
- FROM
- esq_ceac_planclase.tbl_syllabus_objetivos
- WHERE
- NOT EXISTS(SELECT 1 FROM esq_ceac_planclase.tbl_syllabus WHERE esq_ceac_planclase.tbl_syllabus_objetivos.id_syllabus= esq_ceac_planclase.tbl_syllabus.idregistro);
- ALTER TABLE esq_ceac_planclase.tbl_syllabus_objetivos
- ADD CONSTRAINT fk_syllabus002 FOREIGN KEY (id_syllabus)
- REFERENCES esq_ceac_planclase.tbl_syllabus (idregistro) ON DELETE CASCADE;
- DELETE
- FROM
- esq_ceac_planclase.tbl_syllabus_temas
- WHERE
- NOT EXISTS(SELECT 1 FROM esq_ceac_planclase.tbl_syllabus WHERE esq_ceac_planclase.tbl_syllabus_temas.id_syllabus= esq_ceac_planclase.tbl_syllabus.idregistro);
- ALTER TABLE esq_ceac_planclase.tbl_syllabus_temas
- ADD CONSTRAINT fk_syllabus002 FOREIGN KEY (id_syllabus)
- REFERENCES esq_ceac_planclase.tbl_syllabus (idregistro) ON DELETE CASCADE;
- DELETE
- FROM
- esq_ceac_planclase.tbl_syllabus_temas_actividades
- WHERE
- NOT EXISTS(SELECT 1 FROM esq_ceac_planclase.tbl_syllabus WHERE esq_ceac_planclase.tbl_syllabus_temas_actividades.id_syllabus= esq_ceac_planclase.tbl_syllabus.idregistro);
- ALTER TABLE esq_ceac_planclase.tbl_syllabus_temas_actividades
- ADD CONSTRAINT fk_syllabus002 FOREIGN KEY (id_syllabus)
- REFERENCES esq_ceac_planclase.tbl_syllabus (idregistro) ON DELETE CASCADE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement