This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Setup some tables. | |
CREATE TABLE `users` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(45) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=1; | |
CREATE TABLE `internal_messages` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`owner_user_id` int(11) DEFAULT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+----------------+-------+---------------------+---------------------+ | |
| sender_user_id | name | num_users_contacted | num_users_responded | | |
+----------------+-------+---------------------+---------------------+ | |
| 3 | Greg | 1 | 1 | | |
| 1 | John | 4 | 0 | | |
| 7 | Linda | 1 | 1 | | |
| 6 | Sue | 2 | 2 | | |
+----------------+-------+---------------------+---------------------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+----+-------+-------------------------------+ | |
| id | name | total_cold_inquiries_received | | |
+----+-------+-------------------------------+ | |
| 2 | Mike | 1 | | |
| 4 | Bill | 2 | | |
| 5 | Kate | 1 | | |
| 6 | Sue | 1 | | |
| 7 | Linda | 2 | | |
| 8 | Mary | 1 | | |
+----+-------+-------------------------------+ |