Yep, that was my first thought - can you change Property Organizations As list Of Organization; to parent/children Relationship? In this case you will get automatic cascade delete. You'll have

Relationship Responce As GetOrgUpdatesResponse  [ Cardinality = parent, Inverse = Organizations ];
Relationship Organizations As Organization [ Cardinality = children, Inverse = Responce ];

And it suggests that each responce has its own organizations objects that don't repeat.

Otherwise, you will have to delete them manually 1 by 1 in callback method %OnDelete for example

/// This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
/// provide notification that the object specified by <VAR>oid</VAR> is being deleted.
/// 
/// If this method returns an error then the object will not be deleted.
ClassMethod %OnDelete(oid As %ObjectIdentity) As %Status [ Private, ServerOnly = 1 ]
{
	Quit $$$OK
}

In IRIS there are no built-in constructors. Classes that don't inherit from a system class are usually used as storage for class methods.  Therefore, if you want to create an object you need to inherit your own class from one of the system classes, like %RegisteredObject (won't save your objects to the database), %SerialObject (won't save your objects to the database on its own), %Persistent (will save your objects to the database) etc. For example:

Class Sample.Header extends %Persistent
{
Property Key As %String;
Property Show As %Boolean;
}

For me it's a horrible news 😭 I really prefer to use Studio when explaining how to create properties (particularly relationships) and queries (particularly Class Queries based on COS) to students who see IRIS for the first and the last time during my classes. And when something goes wrong (and it does a lot of the time) it's usually easier to ask them to delete the code that produces error and rewrite it while I'm looking than to figure out what's wrong with it. And if it something more complicated than simple properties it can take a lot of time.

Besides, not all students know (and want/need to learn) how to use VS Code and look for proper plug-ins, extensions etc. It will really make my life that much harder.

I see that it's a known situation, they even added a NB in the post:

NB Dear contestants, please take into consideration that support for the contest cloud sql environment is only available during business hours M-F 9-5 US Eastern Time. We seem to be experiencing a failure of the cloud environment such that deployments are stuck in Pending status for some users.

Before:

Query GetAllOlderThan(Age As %Integer = 65) As %Query(ROWSPEC = "Name:%Name,Age:%Integer") [ SqlProc ]
{
}

ClassMethod GetAllOlderThanExecute(ByRef qHandle As %Binary, Age As %Integer = 65) As %Status
{
    set qHandle = $lb($random(200), 0)
    Quit $$$OK
}

ClassMethod GetAllOlderThanClose(ByRef qHandle As %Binary) As %Status [ PlaceAfter = GetAllOlderThanExecute ]
{
    set qHandle = ""
    Quit $$$OK
}

ClassMethod GetAllOlderThanFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = GetAllOlderThanExecute ]
{
    if $ListGet(qHandle, 2) = $ListGet(qHandle, 1)
    {
       Set Row = ""
       set AtEnd = 1
    } else
    {
       Set Row = $Lb(##class(%PopulateUtils).Name(), ##class(%PopulateUtils).Integer(18, 90))
       set $list(qHandle, 2) = $list(qHandle, 2) + 1
    }
    Quit $$$OK
}

After:

Query GetAllOlderThan(Age As %Integer = 65) As %Query(ROWSPEC = "Name:%Name,Age:%Integer") [ SqlProc ]
{
}

ClassMethod GetAllOlderThanExecute(ByRef qHandle As %Binary, Age As %Integer = 65) As %Status
{
    set qHandle = $lb($random(200), 0, Age)
    Quit $$$OK
}

ClassMethod GetAllOlderThanClose(ByRef qHandle As %Binary) As %Status [ PlaceAfter = GetAllOlderThanExecute ]
{
    set qHandle = ""
    Quit $$$OK
}

ClassMethod GetAllOlderThanFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = GetAllOlderThanExecute ]
{
	if $ListGet(qHandle, 2) = $ListGet(qHandle, 1)
	{
		Set Row = ""
		set AtEnd = 1
	} else
	{
    	Set Row = $Lb(##class(%PopulateUtils).Name(), ##class(%PopulateUtils).Integer($ListGet(qHandle, 3), 90))
    	set $list(qHandle, 2) = $list(qHandle, 2) + 1
	}
    Quit $$$OK
}

}

> Hi @Iryna Mykhailova and welcome to the Tutorials Contest.

Why, thank you wink

Both %SQLQuery and %Query are class queries. As for the Studio - I do believe it's the easiest way for people who start working with IRIS to get acquainted with the technology!

You are right, I forgot to keep in mind that I have a parameter for the second example. I will correct it to reflect that I'm looking for people older than the exact age. Thanks for the heads-up!