Q:

Query based on the difference in number of occurrences in other tables

I have 3 tables. 
table_main:

    +-----+----------+-------------+
    | _id | ENTRY_ID |   DATA      |
    +-----+----------+-------------+
    |   1 | a1       | some data 1 |
    |   2 | a2       | some data 2 |
    |   3 | a3       | some data 3 |
    +-----+----------+-------------+

table_additions:
+----------+-----------+
| ENTRY_ID | TIMESTAMP |
+----------+-----------+
| a1       |    123456 |
| a2       |    123458 |
| a1       |    123654 |
| a1       |    123658 |
| a2       |    123843 |
| a3       |    123911 |
+----------+-----------+

table_deletions:
+----------+-----------+
| ENTRY_ID | TIMESTAMP |
+----------+-----------+
| a3       |    123556 |
| a2       |    123558 |
| a3       |    123754 |
| a1       |    123858 |
| a3       |    123863 |
| a3       |    123976 |
+----------+-----------+

I am working in android. I want to get the data from table_main of all the entries which have :

number of occurances in table_additions > number of occurances in
  table_deletions

So, in the above example, the output should be:
+-----+----------+-------------+
| _id | ENTRY_ID |   DATA      |
+-----+----------+-------------+
|   1 | a1       | some data 1 |
|   2 | a2       | some data 2 |
+-----+----------+-------------+

A:

This can be done with correlated subqueries:
SELECT *
FROM table_main
WHERE (SELECT COUNT(*)
       FROM table_additions
       WHERE entry_id = table_main.entry_id
      ) >
      (SELECT COUNT(*)
       FROM table_deletions
       WHERE entry_id = table_main.entry_id
      )

