Using SQL, what is the best way to retrieve the count of multiple recurring items in `table1`, and put the sums in `table2`?

Table2 is the result I desire

[![table2 is the result i desire](https://i.stack.imgur.com/VczhJ.png)](https://i.stack.imgur.com/VczhJ.png)

as text :

```
table1
+----------+
|  name    | 
+----------+
| john doe |
+----------+
|mary smith| 
+----------+
| john doe |
+----------+
|mary smith|     
+----------+
| john doe |
+----------+

table2
+----------+-------+
|  name    | count |
+----------+-------+
| john doe |     3 |
+----------+-------+
|mary smith|     2 |
+----------+-------+

```