Declarative Objectivity (DO) Language : Data Statements : DELETE Statement
DELETE Statement
A DELETE statement deletes specified referenceable objects from the federated database and, optionally, returns information about the deleted objects.
deleteStatement : deleteClause whereClause? updateReturn?;
deleteClause : DELETE source;
updateReturn : groupByClause? orderByClause? returnClause;
Quick Look 
Delete all customers that are not associated with any rental contracts:
DELETE Customer WHERE IS_EMPTY(rentals);
Delete all customers that are not associated with any rental contracts, returning the name of each deleted customer:
DELETE Customer WHERE IS_EMPTY(rentals) RETURN lastName;
In a sales database, delete all customers who show no purchases or other activity for over a year, returning the name and postal code of each deleted customer:
DELETE Customers WHERE IS_EMPTY(purchases)
AND ($$NOW - latestActivity) > INTERVAL{days:365}
RETURN name, as zip;
A DELETE statement deletes the objects designated by the specified query source expression. The query source must return objects of a referenceable schema class. An error is returned if the query source designates objects of an embeddable schema class.
You normally qualify the objects to be deleted by including a WHERE clause in the DELETE statement.
Warning:If no WHERE clause is included, the entire query source is deleted. For example, the following statement removes all Customer objects from the federated database:

DELETE Customers;
By default, a DELETE statement returns the values of all direct attributes of the deleted objects. You can include a RETURN Clause to return select particular return values. To organize the returned information, the RETURN clause can be supplemented with a GROUP BY Clause, an ORDER BY Clause, or both.
If two objects are linked through a bidirectional reference, then deleting one object automatically deletes the other object’s reference to it. If, however, an object is referenced through one or more unidirectional references, deleting that object leaves the “dangling” (invalid) references behind.
Note:It is recommended that you delete an object from the federated database only after you first update any other objects with attributes or collection elements that hold unidirectional references to the object. You can clear each unidirectional reference attribute using a CLEAR Clause; you can remove each unidirectional reference from a collection using a REMOVE Clause.