Lily,
The basics are this:
***
delete from ontologies cascade
where [some condition is met]
***
A few points of note:
- This will delete all ontologies meeting the where condition and any child records in other tables containing those ontologyid’s as foreign keys.
- On the where condition, you will likely filter on ontologyid or name.
- Before running the sql, delete any models or branches that reference the ontology you want to delete. If you don’t do that, this statement may delete them, but I can’t predict the consequences.
- Probably obvious, but be sure to have a backout plan (like a db backup) in case of unintended consequences.
Good luck!