-delete from item where `owner-id` not in (select id from contact);
-delete from item where `contact-id` not in (select id from contact);
-delete from notify where `uri-id` not in (select id from `item-uri`);
-delete from photo where `contact-id` not in (select id from contact);
-delete from thread where iid not in (select id from item);
-delete from item where `author-id` not in (select id from contact);
-delete from diaspora-interaction where uri-id not in (select id from item-uri);
+DELETE FROM `item` WHERE `owner-id` NOT IN (SELECT `id` FROM `contact`);
+DELETE FROM `item` WHERE `contact-id` NOT IN (SELECT `id` FROM `contact`);
+DELETE FROM `notify` WHERE `uri-id` NOT IN (SELECT `id` FROM `item-uri`);
+DELETE FROM `photo` WHERE `contact-id` NOT IN (SELECT `id` FROM `contact`);
+DELETE FROM `thread` WHERE `iid` NOT IN (SELECT `id` FROM `item`);
+DELETE FROM `item` WHERE `author-id` NOT IN (SELECT `id` FROM `contact`);
+DELETE FROM `diaspora-interaction` WHERE `uri-id` NOT IN (SELECT `id` FROM `item-uri`);