Created
July 6, 2015 20:46
-
-
Save wmantly/6c8332c7cb0ab9fe9399 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| sqlite> .schema | |
| CREATE TABLE `users` ( | |
| `id` INTEGER, | |
| `name` VARCHAR, | |
| `email` VARCHAR, | |
| `city` VARCHAR, | |
| `state` VARCHAR, | |
| `last_visit` DATE, | |
| `page_views` INTEGER, | |
| PRIMARY KEY (`id`) | |
| ); | |
| CREATE TABLE `search_terms` ( | |
| `id` INTEGER, | |
| `word` VARCHAR, | |
| PRIMARY KEY (`id`) | |
| ); | |
| CREATE TABLE `user_searches` ( | |
| `id` INTEGER, | |
| `user_id` INTEGER, | |
| `term_id` INTEGER, | |
| FOREIGN KEY (`user_id`) REFERENCES users(id), | |
| FOREIGN KEY (`term_id`) REFERENCES search_terms(id), | |
| PRIMARY KEY (`id`) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment