I'm looking to get some fairly simple statistics from groups of duplicate records in a csv file. (The stats are simple, but pulling them is more challenging.)

I'm hoping to get some help putting together some sqlite code that will help me do this. The best way for me to be able to explain what I'm trying to do is through examples.

Example 1

```
Line | Duplicate Id | Created by | Company Name | Account Owner | Created by Team | Owner Team
 1     rbt1546        John Smith   SMR Inc.       John Smith      Inside Sales      Inside Sales
 2     rbt1546        John Smith   SMR Corp       John Smith      Inside Sales      Inside Sales
 3     mnd1452        Jen Davis    RMX Inc.       Rob Diaz        Lead Gen          Inside Sales
 4     mnd1452        John Smith   RMX Inc.       Rob Diaz        Inside Sales      Inside Sales
 5     mnd1452        Jen Davis    RMX            John Smith      Lead Gen          Inside Sales

```

In the example above we have two examples where duplicate accounts were created by the same person. (We will call these cases "own goals".) John Smith scored 1 own goal (line 2) and so did Jen Davis (line 5). In this data set, 1 own goal was created by Inside sales and 1 was created by the lead gen team. (These are the stats I'm looking to pull from 62,000 rows of data in my csv.)

I'm not sure where to begin when it comes to writing sqlite queries on a problem of this nature.

What is the best way to go at this?