diff --git a/.gitattributes b/.gitattributes index bed0738c7eeb449bca98b5d2f33c89a1ee56349a..c79375edfb428a51abdc56b38e5b96cab726c65a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -58,3 +58,68 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text # Video files - compressed *.mp4 filter=lfs diff=lfs merge=lfs -text *.webm filter=lfs diff=lfs merge=lfs -text +databases/car_retails.sqlite filter=lfs diff=lfs merge=lfs -text +databases/beer_factory.sqlite filter=lfs diff=lfs merge=lfs -text +databases/book_publishing_company.sqlite filter=lfs diff=lfs merge=lfs -text +databases/app_store.sqlite filter=lfs diff=lfs merge=lfs -text +databases/books.sqlite filter=lfs diff=lfs merge=lfs -text +databases/address.sqlite filter=lfs diff=lfs merge=lfs -text +databases/chicago_crime.sqlite filter=lfs diff=lfs merge=lfs -text +databases/cars.sqlite filter=lfs diff=lfs merge=lfs -text +databases/citeseer.sqlite filter=lfs diff=lfs merge=lfs -text +databases/cookbook.sqlite filter=lfs diff=lfs merge=lfs -text +databases/craftbeer.sqlite filter=lfs diff=lfs merge=lfs -text +databases/airline.sqlite filter=lfs diff=lfs merge=lfs -text +databases/college_completion.sqlite filter=lfs diff=lfs merge=lfs -text +databases/disney.sqlite filter=lfs diff=lfs merge=lfs -text +databases/european_football_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/donor.sqlite filter=lfs diff=lfs merge=lfs -text +databases/hockey.sqlite filter=lfs diff=lfs merge=lfs -text +databases/genes.sqlite filter=lfs diff=lfs merge=lfs -text +databases/ice_hockey_draft.sqlite filter=lfs diff=lfs merge=lfs -text +databases/law_episode.sqlite filter=lfs diff=lfs merge=lfs -text +databases/food_inspection.sqlite filter=lfs diff=lfs merge=lfs -text +databases/food_inspection_2.sqlite filter=lfs diff=lfs merge=lfs -text +databases/mondial_geo.sqlite filter=lfs diff=lfs merge=lfs -text +databases/movie.sqlite filter=lfs diff=lfs merge=lfs -text +databases/legislator.sqlite filter=lfs diff=lfs merge=lfs -text +databases/authors.sqlite filter=lfs diff=lfs merge=lfs -text +databases/mental_health_survey.sqlite filter=lfs diff=lfs merge=lfs -text +databases/menu.sqlite filter=lfs diff=lfs merge=lfs -text +databases/image_and_language.sqlite filter=lfs diff=lfs merge=lfs -text +databases/movie_3.sqlite filter=lfs diff=lfs merge=lfs -text +databases/movies_4.sqlite filter=lfs diff=lfs merge=lfs -text +databases/professional_basketball.sqlite filter=lfs diff=lfs merge=lfs -text +databases/olympics.sqlite filter=lfs diff=lfs merge=lfs -text +databases/music_tracker.sqlite filter=lfs diff=lfs merge=lfs -text +databases/regional_sales.sqlite filter=lfs diff=lfs merge=lfs -text +databases/movielens.sqlite filter=lfs diff=lfs merge=lfs -text +databases/restaurant.sqlite filter=lfs diff=lfs merge=lfs -text +databases/retail_complains.sqlite filter=lfs diff=lfs merge=lfs -text +databases/public_review_platform.sqlite filter=lfs diff=lfs merge=lfs -text +databases/shipping.sqlite filter=lfs diff=lfs merge=lfs -text +databases/shakespeare.sqlite filter=lfs diff=lfs merge=lfs -text +databases/shooting.sqlite filter=lfs diff=lfs merge=lfs -text +databases/simpson_episodes.sqlite filter=lfs diff=lfs merge=lfs -text +databases/soccer_2016.sqlite filter=lfs diff=lfs merge=lfs -text +databases/sales.sqlite filter=lfs diff=lfs merge=lfs -text +databases/student_loan.sqlite filter=lfs diff=lfs merge=lfs -text +databases/social_media.sqlite filter=lfs diff=lfs merge=lfs -text +databases/superstore.sqlite filter=lfs diff=lfs merge=lfs -text +databases/synthea.sqlite filter=lfs diff=lfs merge=lfs -text +databases/trains.sqlite filter=lfs diff=lfs merge=lfs -text +databases/university.sqlite filter=lfs diff=lfs merge=lfs -text +databases/sales_in_weather.sqlite filter=lfs diff=lfs merge=lfs -text +databases/world.sqlite filter=lfs diff=lfs merge=lfs -text +databases/video_games.sqlite filter=lfs diff=lfs merge=lfs -text +databases/software_company.sqlite filter=lfs diff=lfs merge=lfs -text +databases/works_cycles.sqlite filter=lfs diff=lfs merge=lfs -text +databases/music_platform_2.sqlite filter=lfs diff=lfs merge=lfs -text +databases/movie_platform.sqlite filter=lfs diff=lfs merge=lfs -text +databases/codebase_comments.sqlite filter=lfs diff=lfs merge=lfs -text +databases/bike_share_1.sqlite filter=lfs diff=lfs merge=lfs -text +databases/coinmarketcap.sqlite filter=lfs diff=lfs merge=lfs -text +databases/retails.sqlite filter=lfs diff=lfs merge=lfs -text +databases/world_development_indicators.sqlite filter=lfs diff=lfs merge=lfs -text +databases/language_corpus.sqlite filter=lfs diff=lfs merge=lfs -text +databases/talkingdata.sqlite filter=lfs diff=lfs merge=lfs -text diff --git a/databases/address.sqlite b/databases/address.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..43a65a3e402785dd7f1c55300bd6d9208b45c284 --- /dev/null +++ b/databases/address.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1830476f6414f2a07f51f4687b7bcfc2efd6add8337eaaaf19120d7ae245f7ea +size 16961536 diff --git a/databases/airline.sqlite b/databases/airline.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..f925a948c8208a451326febd756d25d8cde37abf --- /dev/null +++ b/databases/airline.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50308a01c2467df9370ce6ee45595c97af2a06b73e195f52444406d4cdad08a8 +size 122699776 diff --git a/databases/app_store.sqlite b/databases/app_store.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4e5b4edfa6db5330e3b75bdb1a2cbc8e168b0134 --- /dev/null +++ b/databases/app_store.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b463445ce91e146a781355c06dd3e7b8a5551870e00fe49f65469df96ccc4df +size 8974336 diff --git a/databases/authors.sqlite b/databases/authors.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e3f223b8d7febd840ce43340ffdcac0ee6a10478 --- /dev/null +++ b/databases/authors.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53a556bfe3c219fe9a36d4fd65bc7d9b373045ef6786fd46a1a97c566ca1e94f +size 355807232 diff --git a/databases/beer_factory.sqlite b/databases/beer_factory.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..878b3b1106eb60ad340e3230d1c412c365101316 --- /dev/null +++ b/databases/beer_factory.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cf815ded995e8bec52d59b4763f8229054556f171a4eeb7b53f86535b94bc19 +size 991232 diff --git a/databases/bike_share_1.sqlite b/databases/bike_share_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..cc70437a365d16927372ba2726544f9e663feb0a --- /dev/null +++ b/databases/bike_share_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d6918cb16405c1a5f483182d5effbe00c6e07d14f950b1843ec28ad8991246b +size 5209406464 diff --git a/databases/book_publishing_company.sqlite b/databases/book_publishing_company.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..457970602c7ce0239fca16a19815d28ab81c6ea3 --- /dev/null +++ b/databases/book_publishing_company.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b493a54214d7b224a6f2b9b22b0f651c98f0c345a91cdec10b94825d4d897f4d +size 184320 diff --git a/databases/books.sqlite b/databases/books.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..736f88465ae0cac6f770811968ad39f4139f55d6 --- /dev/null +++ b/databases/books.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b34bb9752cb1550a622945e1b814b5978cd9435a00ab037c2758b552a7f856e +size 4337664 diff --git a/databases/car_retails.sqlite b/databases/car_retails.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..6c271194c56312631a0e87833b3f306b01af71b6 --- /dev/null +++ b/databases/car_retails.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5c434b67cd62c8e35721dfb462405b8750fee684e9d005f79bcc23bacdb1bf5 +size 487424 diff --git a/databases/cars.sqlite b/databases/cars.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..2674341efb4a50db8e519b401064d79bdc04a5bd --- /dev/null +++ b/databases/cars.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0338e4d6f3c7bb90748b6a1971c0d18f301166b77f2ca9984c197a0f20d7f67e +size 135168 diff --git a/databases/chicago_crime.sqlite b/databases/chicago_crime.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c5c225047ef7174585e33221408f45cc87b13e81 --- /dev/null +++ b/databases/chicago_crime.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebd17b74fc1895ee90362413bfdff9284e1cccc05a4dd381d9e2503319ff20a4 +size 32317440 diff --git a/databases/citeseer.sqlite b/databases/citeseer.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..3dcb7bd2476374143b97af177033757fc4570b60 --- /dev/null +++ b/databases/citeseer.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2590117d0545f92aec1651f1bc063bd5897755eaadfd56aaf0c105a81e616e32 +size 7430144 diff --git a/databases/codebase_comments.sqlite b/databases/codebase_comments.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4a11b8fa58973f809f06002d78b33b0cda5de180 --- /dev/null +++ b/databases/codebase_comments.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:725250ca3aed66cddfcb0ba923cf4b3d9c20a77b7ad77c12020d56c0fbec3f9b +size 4497768448 diff --git a/databases/coinmarketcap.sqlite b/databases/coinmarketcap.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..d51e2739be92ebcf1a0daead5d3de01053f203e9 --- /dev/null +++ b/databases/coinmarketcap.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff179a460968f85bc7b0836a50d6c3dd3e5002be7990fb9e2bfa88213803a0f2 +size 1508139008 diff --git a/databases/college_completion.sqlite b/databases/college_completion.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..7047b7439d5d55df8aad1bd27bdeb872be5e4d6c --- /dev/null +++ b/databases/college_completion.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e87f156d347e498750050ed7b53d87bf6d0f716e3aa6b86748d3908c9397125c +size 71163904 diff --git a/databases/cookbook.sqlite b/databases/cookbook.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8fcc4c069a3d11f17ed99a36a53b97a6fb86d320 --- /dev/null +++ b/databases/cookbook.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bff5b9b84f633be89f7954eb4067e246f4ba7441ad4ffb33374ca8a8efe206da +size 1220608 diff --git a/databases/craftbeer.sqlite b/databases/craftbeer.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..9036ee397e5aa46635fca9396e1572ba0d8b0ac1 --- /dev/null +++ b/databases/craftbeer.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:127bad8fbd45772d66f81aa3935e5b957eaeccce104ec3e933ff156efea168ea +size 442368 diff --git a/databases/disney.sqlite b/databases/disney.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8b18989d2f69c66978e41f2a6b667524e6879051 --- /dev/null +++ b/databases/disney.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d621a32b1d0565a94b15b2f7757a3566065eb304e819b8c84acb199567cce3f2 +size 180224 diff --git a/databases/donor.sqlite b/databases/donor.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a54e94057aa925c5657a7cbd48fbdde5c64f307b --- /dev/null +++ b/databases/donor.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7012d018662e149011e4e010563ecfe7d2a7472ab2d29524fea886f81a97e35 +size 4497768448 diff --git a/databases/european_football_1.sqlite b/databases/european_football_1.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..56de4d0685a8eae3dccd390db6c66479124339dd --- /dev/null +++ b/databases/european_football_1.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4e5fba395bef804001c7298750077f22b2326e969eb5e1fcfec6ba24fe095cc +size 5959680 diff --git a/databases/food_inspection.sqlite b/databases/food_inspection.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..ec6acc972a39254238be9aa797e806bd2e08302e --- /dev/null +++ b/databases/food_inspection.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c76a6576ba7fe150e12b64a9eefa0ad418b10449f771f91830a87319e34f64c1 +size 5021696 diff --git a/databases/food_inspection_2.sqlite b/databases/food_inspection_2.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..69f4f3bc4b1e308da05cee41799e055cbb58a5b9 --- /dev/null +++ b/databases/food_inspection_2.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d73be863a1ae24ef6ec67f72e4b876c5991f6734257b1b969a5a070e06836322 +size 113545216 diff --git a/databases/genes.sqlite b/databases/genes.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..76112b1e95374acf1e9187325fe68e371841cf29 --- /dev/null +++ b/databases/genes.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:726f142a9281a90cb36a6969b08be51d03a7ba2a58d30dfa02bdb766993fe6b5 +size 1527808 diff --git a/databases/hockey.sqlite b/databases/hockey.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4a3ee90eb2b620388862ca4600bd039ff262a4a7 --- /dev/null +++ b/databases/hockey.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0e405f0ae1d09d1d5323b0db21999e2be05199634baec835eb08284c4eb6d9e +size 7045120 diff --git a/databases/ice_hockey_draft.sqlite b/databases/ice_hockey_draft.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e984ce1a3f5fba983c3af28bce9ef938993ca273 --- /dev/null +++ b/databases/ice_hockey_draft.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b297d4b7f8c0ff3b751a4017c4d2355aa8eeb11159cf258600995a56f53bf18 +size 1028096 diff --git a/databases/image_and_language.sqlite b/databases/image_and_language.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..66b42e4772659a49d929a676e4c3117280df81f3 --- /dev/null +++ b/databases/image_and_language.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2fde5486e977b4fde2097bbfbb789be5950753872a3707956b946c92080d0f1 +size 138891264 diff --git a/databases/language_corpus.sqlite b/databases/language_corpus.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b2a3b572138418b77c70705ccbe17f4a3b345a2b --- /dev/null +++ b/databases/language_corpus.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:826e913eb22387a8b4a59da8ba6e7e539ea0d288565b2da5b0ec708baffb7d15 +size 2383298560 diff --git a/databases/law_episode.sqlite b/databases/law_episode.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..25c0ad14db652370555f70917263fde2acdd5eed --- /dev/null +++ b/databases/law_episode.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13debe7f5d9d9a08d0f36a15dcc5c3f449509650f32ee15e3f2d44123f6ca42d +size 335872 diff --git a/databases/legislator.sqlite b/databases/legislator.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..302cc12b4b7fd1f0ba87f92160a0992c6b5e8049 --- /dev/null +++ b/databases/legislator.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0e02f2cbd6226df1f0da90b5494dbef49b3d140c6046a9e203ad47f4df475fe +size 3497984 diff --git a/databases/mental_health_survey.sqlite b/databases/mental_health_survey.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..914b828663e445af743620762cded1ae78729b3d --- /dev/null +++ b/databases/mental_health_survey.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:677194717340a10ed4ec490297d695b6bb7614e928bedc81d4753bb13d47433c +size 18276352 diff --git a/databases/menu.sqlite b/databases/menu.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..be09b16c224cb4535d631936ba83b111e9626f7e --- /dev/null +++ b/databases/menu.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8906dad2ff3ff9533875ef7323f91f17901fc88ca19c59966ee32b07e149d93 +size 152330240 diff --git a/databases/mondial_geo.sqlite b/databases/mondial_geo.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c27cd362e6b3aecb2f466db1e0fffbe7c2585031 --- /dev/null +++ b/databases/mondial_geo.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:546a93216567e36ace1720f8e815f74be98f478b0e80ae1b7fc25565aa86d9e5 +size 1486848 diff --git a/databases/movie.sqlite b/databases/movie.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b749816e1ec0d1243afad1a7461598f4af961195 --- /dev/null +++ b/databases/movie.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d87ad371470f07af926e4bbca2784aed9a643935dd6e6a00d8009aad1816547 +size 1568768 diff --git a/databases/movie_3.sqlite b/databases/movie_3.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c56691bb8765d51cd926a627866d454f2f65c7a8 --- /dev/null +++ b/databases/movie_3.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af79f59f94e64e43fb0bb6a8fdc6e6d3a2017aec9dfcb5519bc840d16e01871f +size 6356992 diff --git a/databases/movie_platform.sqlite b/databases/movie_platform.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c85afa5010033e00c2b5e2240a3374923c9cad3d --- /dev/null +++ b/databases/movie_platform.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dd4d0506d039bb7ca0e5bd00cd5f5562f7f5e58534859a34bdca4bc56ad46e0 +size 2486202368 diff --git a/databases/movielens.sqlite b/databases/movielens.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a3c90e59ad6b65c4094580df6c610e99b4566277 --- /dev/null +++ b/databases/movielens.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c0f4f556f28e787eef6ed52ad2745f05124302c9405a977643ceb5f190ee431 +size 85786624 diff --git a/databases/movies_4.sqlite b/databases/movies_4.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..a1c40c8b54ac6e931b8e8629fb13b7bbb43f0e59 --- /dev/null +++ b/databases/movies_4.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a2aafc3b6384a97158aaaf0ade3d0136747de29d22c35e4ef7bf3ef3261f23a +size 11407360 diff --git a/databases/music_platform_2.sqlite b/databases/music_platform_2.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..bbeb91b689e36ed8a922f8d00f9eaa6b91aea0e3 --- /dev/null +++ b/databases/music_platform_2.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24077d0fffd9389439cb991540bec6eadf3a9a6cc3a2cfc769d6692545a0c344 +size 806174720 diff --git a/databases/music_tracker.sqlite b/databases/music_tracker.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..15827044635857371124a13f137e3eb3e058359a --- /dev/null +++ b/databases/music_tracker.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c2444428e987218e2ce0655e489448dac95cec1225ba965183f09961034038f +size 15204352 diff --git a/databases/olympics.sqlite b/databases/olympics.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0b6bbc5e6f733275804e1ac07db2cb6b8cde2ec6 --- /dev/null +++ b/databases/olympics.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c34a94838914a78f62c2989b729907aa9f58cd45b93567ab211a8a840957e074 +size 18145280 diff --git a/databases/professional_basketball.sqlite b/databases/professional_basketball.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..9c6f5cb014153a5f7202f06bdbad65cf03f7cd55 --- /dev/null +++ b/databases/professional_basketball.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8cbdd00f9ed25d2d7fa07b66dc06d854172d1c8cfc41cda03aefd08205017dc +size 4141056 diff --git a/databases/public_review_platform.sqlite b/databases/public_review_platform.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..70986104b8f8c92dcb6dbcbe8de0d29bd28d53aa --- /dev/null +++ b/databases/public_review_platform.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d87fa4bbcb2d5daec149330d5c47378b2c669222e616bfe2c04cc3624e7ad4ba +size 65339392 diff --git a/databases/regional_sales.sqlite b/databases/regional_sales.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..35224cfb4d18013531b0881dfac875eb8aa60d2e --- /dev/null +++ b/databases/regional_sales.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9820888505c30dfd913738265ddb9150bf1c33a93e1b236313964ada98423a0c +size 2277376 diff --git a/databases/restaurant.sqlite b/databases/restaurant.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e4e096933db2b2820c591d6145873a0144a37589 --- /dev/null +++ b/databases/restaurant.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39dbaf39bf244e1062e50d3be9dfd952320bd12e8471a58ae93db6ff83d57504 +size 806912 diff --git a/databases/retail_complains.sqlite b/databases/retail_complains.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..795ffb8f8757a61c9dc8aeeecb900a5db91696f8 --- /dev/null +++ b/databases/retail_complains.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a8358eb5d09950a7190b365fc29efd220f92e0ca8c9090f600199dad0ba91e1 +size 13279232 diff --git a/databases/retails.sqlite b/databases/retails.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8e2eb8536acdb8d8250fbd3223d288b265460048 --- /dev/null +++ b/databases/retails.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2021fa97598a34216fbdbe604817c7d5bfdb15819da55aabdbd68ab04e4e3d78 +size 1027735552 diff --git a/databases/sales.sqlite b/databases/sales.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..74ecba645af01f2bade120f072b481a58c71fe59 --- /dev/null +++ b/databases/sales.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5f2047d8287dec6f5fb5e9aa19875b7cf82f2f43ea55398311a93c87c7a4568 +size 130338816 diff --git a/databases/sales_in_weather.sqlite b/databases/sales_in_weather.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..38a46414b282542760c589ae1d350ed673bf0b06 --- /dev/null +++ b/databases/sales_in_weather.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9d4d5ace462c357c38e201d4aa70c1938cfcfc89c965d429c59c5402a6609a6 +size 233271296 diff --git a/databases/shakespeare.sqlite b/databases/shakespeare.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..5b87fc693bce5db60533bd5a202cd393cd64bc69 --- /dev/null +++ b/databases/shakespeare.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9557c1bafa039c420d8b87d5407f90d0a8c99f24f9129f9ea6b39024f0c788d +size 12029952 diff --git a/databases/shipping.sqlite b/databases/shipping.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..440c1cd4de13c9adce39b46d1691ac7b13f186b8 --- /dev/null +++ b/databases/shipping.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6b4af6401c43aeb7f678ba18e3ebc5ba8708d4a98674be6095e3d9863f4f259 +size 131072 diff --git a/databases/shooting.sqlite b/databases/shooting.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4ff1d49791a12617a1c197adbf96a6f0bcc47c68 --- /dev/null +++ b/databases/shooting.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d96c60a9ef532f6c02b942ac5691eda753937324ddedd2dae7a131185cae82b +size 180224 diff --git a/databases/simpson_episodes.sqlite b/databases/simpson_episodes.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..df35554b3a0d91ca58678908e37940d0dc100a9e --- /dev/null +++ b/databases/simpson_episodes.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb6949d491581ed83a81ba1f4c432265d42f7fdd7fc4002cd772636eaec86b4e +size 438272 diff --git a/databases/soccer_2016.sqlite b/databases/soccer_2016.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..7474c4f0a508ce0a9d24a671f1cf176982c26ea1 --- /dev/null +++ b/databases/soccer_2016.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84651eed21dbfae9f36a15697a5df81f3cb6ad78740f7301096e99dd7c4c06d5 +size 17170432 diff --git a/databases/social_media.sqlite b/databases/social_media.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4d65f0cf2a0fe345e0e1bf11dd7ee616881231c5 --- /dev/null +++ b/databases/social_media.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1893630346b1cae77e396f93346928bd16b2badcb93edc3090dfcc389e7fa90 +size 37212160 diff --git a/databases/software_company.sqlite b/databases/software_company.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..8e76a239dfa5a46fe371344788db54d362518d78 --- /dev/null +++ b/databases/software_company.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21b00d9d2b3bf20af55597c5e844223340ae35efb034797b34100681827e2ca2 +size 342118400 diff --git a/databases/student_loan.sqlite b/databases/student_loan.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..aedaa228c150854fd67a5887412408a3757151bd --- /dev/null +++ b/databases/student_loan.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dac8a8757e66599716907071ebdfb20bfd1d06b90d9cecc945dd5a040a0f3b6 +size 307200 diff --git a/databases/superstore.sqlite b/databases/superstore.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..4a1614b3290934ddb498cbefdf11ef0288b23493 --- /dev/null +++ b/databases/superstore.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6090a5d5214c49b4eb41ab793e87c370bf54973febe6a017d569c6d0c245ab77 +size 6631424 diff --git a/databases/synthea.sqlite b/databases/synthea.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..1edaa8376ae8ba956f3ce6df9f54bff6e503479f --- /dev/null +++ b/databases/synthea.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1f134c16bb99d69472a4e1895d4b07b137a849cd97f5073e18d9d68e3ba2f71 +size 28332032 diff --git a/databases/talkingdata.sqlite b/databases/talkingdata.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..270a7d09982353f7891dbb15195750de38396849 --- /dev/null +++ b/databases/talkingdata.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abd5094ae018de5d7ac0912b409b81d58194dfbdb0d0a4abebdef28d71cca4fa +size 1903886336 diff --git a/databases/trains.sqlite b/databases/trains.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..45a70fafdddf67c1db31f8c0e820d7bcfce9303e --- /dev/null +++ b/databases/trains.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ff21e3769ac341aec4b58d8c3e2fc5215688958cc2c0a82132223eeb124d724 +size 5070848 diff --git a/databases/university.sqlite b/databases/university.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..3bb8fe1f29d508b1141fa9f3e41480994384da02 --- /dev/null +++ b/databases/university.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:295afab81225bea2df72f5b779e4da0b6c5fb691ff8f7e9f448ed20e54555e18 +size 630784 diff --git a/databases/video_games.sqlite b/databases/video_games.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..0d701ae9804e372f9b7dc2cf55b6e4df90bc52bb --- /dev/null +++ b/databases/video_games.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5629de49ad841c4516f61f4a3c87c062f8b6771fbf091ac218414725e91b8668 +size 1974272 diff --git a/databases/works_cycles.sqlite b/databases/works_cycles.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..05b0642423d46003fd6efc27a5ee73d2bedc08f9 --- /dev/null +++ b/databases/works_cycles.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:734c70c304ace404d625d7c2ca74fda1b09ec928a9aea014df8e3ca69fa4cd77 +size 107958272 diff --git a/databases/world.sqlite b/databases/world.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..c7519cb07babca3cf97fcc009ce95f1cfe4ee3d7 --- /dev/null +++ b/databases/world.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:813faade795b875f6d46cf81d9651e2400524b414a407aa9d473aa9a8c142861 +size 253952 diff --git a/databases/world_development_indicators.sqlite b/databases/world_development_indicators.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e85a3a1a676898d1694a4911115b88981a2bdd19 --- /dev/null +++ b/databases/world_development_indicators.sqlite @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df13d85a78383a853d0117d64321d11841b369d9127fe521472b53733010463c +size 829935616 diff --git a/schemas/genes.sql b/schemas/genes.sql new file mode 100644 index 0000000000000000000000000000000000000000..65f5a570e20abad84607524a695b0e72f11db824 --- /dev/null +++ b/schemas/genes.sql @@ -0,0 +1,44 @@ +-- Classification.GeneID: gene id. unique identifier number of genes. +-- Classification.Localization: location. +CREATE TABLE Classification +( + GeneID TEXT not null + primary key, + Localization TEXT not null +); +-- Genes.GeneID: gene id. identifier number of genes. +-- Genes.Essential: essential. +-- Genes.Class: class. +-- Genes.Complex: Complex. +-- Genes.Phenotype: Phenotype. ?: means: doesn't exit the phenotype. +-- Genes.Motif: Motif. +-- Genes.Chromosome: Chromosome. +-- Genes.Function: Function. +-- Genes.Localization: No description. +CREATE TABLE Genes +( + GeneID TEXT not null, + Essential TEXT not null, + Class TEXT not null, + Complex TEXT null, + Phenotype TEXT not null, + Motif TEXT not null, + Chromosome INTEGER not null, + Function TEXT not null, + Localization TEXT not null, + FOREIGN KEY ("GeneID") REFERENCES "Classification" ("GeneID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- Interactions.GeneID1: gene id 1. identifier number of genes. +-- Interactions.GeneID2: gene id 2. identifier number of genes. +-- Interactions.Type: Type. +-- Interactions.Expression_Corr: Expression correlation score. range: (0,1). if the value is the positive then it's "positively correlated". if the value is the negative then it's "negatively correlated". if the value is very high positively, it means two genes are highly correlated. +CREATE TABLE Interactions +( + GeneID1 TEXT not null, + GeneID2 TEXT not null, + Type TEXT not null, + Expression_Corr REAL not null, + primary key (GeneID1, GeneID2), + FOREIGN KEY ("GeneID2") REFERENCES "Classification" ("GeneID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("GeneID1") REFERENCES "Classification" ("GeneID") ON UPDATE CASCADE ON DELETE CASCADE +); diff --git a/schemas/hockey.sql b/schemas/hockey.sql new file mode 100644 index 0000000000000000000000000000000000000000..69d84e741b3d2c636f4f55642d20d3c7bab50508 --- /dev/null +++ b/schemas/hockey.sql @@ -0,0 +1,707 @@ +-- AwardsCoaches.coachID: coach ID. string ID of the coach. +-- AwardsCoaches.award: awards that the coach achieve. +-- AwardsCoaches.year: year of award. +-- AwardsCoaches.lgID: league ID. league abbreviated name. +-- AwardsCoaches.note: No description. +-- Relationship: AwardsCoaches(coachID) to Coaches(coachID). The declared relationship requires a matching parent, but its key is not unique at the parent table grain. Validate existence without imposing uniqueness. +CREATE TABLE AwardsCoaches +( + coachID TEXT, + award TEXT, + year INTEGER, + lgID TEXT, + note TEXT +); +-- AwardsMisc.name: unique name of awards. +-- AwardsMisc.ID: id number of players or coaches, etc. +-- AwardsMisc.award: awarder. not useful. +-- AwardsMisc.year: year of the award. +-- AwardsMisc.lgID: league ID. league abbreviated name. +-- AwardsMisc.note: note if needed. noted information. +CREATE TABLE AwardsMisc +( + name TEXT not null + primary key, + ID TEXT, + award TEXT, + year INTEGER, + lgID TEXT, + note TEXT +); +-- AwardsPlayers.playerID: player id. string ID of players. unique string ID of the player. +-- AwardsPlayers.award: award name. +-- AwardsPlayers.year: year of award. +-- AwardsPlayers.lgID: league ID. league abbreviated name. +-- AwardsPlayers.note: note if needed. +-- AwardsPlayers.pos: position. position of players. LW: left winger. RW: right winger. C: center. G: goalie. D: defenseman. W: winger. F: forward. the player with W (winger) means he can play the role as both LW (left winger) and RW (right winger). +CREATE TABLE AwardsPlayers +( + playerID TEXT not null, + award TEXT not null, + year INTEGER not null, + lgID TEXT, + note TEXT, + pos TEXT, + primary key (playerID, award, year), + FOREIGN KEY ("playerID") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- Coaches.coachID: coach ID. number identifying coaches. +-- Coaches.year: In which year did the coach teach this team. +-- Coaches.tmID: team ID. team abbreviated name. +-- Coaches.lgID: league ID. league abbreviated name. +-- Coaches.stint: stint. +-- Coaches.notes: note if needed. noted information. +-- Coaches.g: games. number of games. +-- Coaches.w: wins. number of wins. +-- Coaches.l: loses. number of loses. +-- Coaches.t: ties. number of ties. +-- Coaches.postg: post-season games. number of post-season games. +-- Coaches.postw: post-season wins. number of post-season wins. +-- Coaches.postl: post-season loses. number of post-season loses. +-- Coaches.postt: post-season ties. number of post-season ties. +CREATE TABLE Coaches +( + coachID TEXT not null, + year INTEGER not null, + tmID TEXT not null, + lgID TEXT, + stint INTEGER not null, + notes TEXT, + g INTEGER, + w INTEGER, + l INTEGER, + t INTEGER, + postg TEXT, + postw TEXT, + postl TEXT, + postt TEXT, + primary key (coachID, year, tmID, stint), + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- CombinedShutouts.year: year. +-- CombinedShutouts.month: month. +-- CombinedShutouts.date: day. the entire date in this table is "year" / "month" / "date". +-- CombinedShutouts.tmID: team ID. team abbreviated name. +-- CombinedShutouts.oppID: opposite team ID. Team ID of opponent. +-- CombinedShutouts.R/P: regular / postseason. R" for regular season, or "P" for postseason. +-- CombinedShutouts.IDgoalie1: ID of goalie 1. ID of first goalie. +-- CombinedShutouts.IDgoalie2: ID of goalie 2. ID of second goalie. +CREATE TABLE CombinedShutouts +( + year INTEGER, + month INTEGER, + date INTEGER, + tmID TEXT, + oppID TEXT, + "R/P" TEXT, + IDgoalie1 TEXT, + IDgoalie2 TEXT, + FOREIGN KEY ("IDgoalie2") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("IDgoalie1") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- Goalies.playerID: id number identifying the player. number identifying players. +-- Goalies.year: year. 2005-06 listed as "2005". +-- Goalies.stint: order of appearance in a season. the entire date in this table is "year" / "month" / "date". +-- Goalies.tmID: team ID. team abbreviated name. +-- Goalies.lgID: league ID. league abbreviated name. +-- Goalies.GP: Games played. +-- Goalies.Min: Minutes. Minutes of appearance. +-- Goalies.W: wins. +-- Goalies.L: loses. +-- Goalies.T/OL: Ties / overtime losses. +-- Goalies.ENG: Empty net goals. An empty net goal happens when a team scores against their opponent who has pulled their goalie. Since there is no goalie in the net, the net is considered �empty". +-- Goalies.SHO: Shutouts. In ice hockey, a shutout (SHO) is credited to a goaltender who successfully stops the other team from scoring during the entire game. +-- Goalies.GA: Goals against. �Goals Against� are the number of goals recorded while the goalie is on the ice. Include all goals against during regulation and overtime play. +-- Goalies.SA: Shots against. �Shot Against� are the number of shots recorded while the goalie is on the ice. +-- Goalies.PostGP: Postseason games played. +-- Goalies.PostMin: Postseason minutes. +-- Goalies.PostW: Postseason wins. +-- Goalies.PostL: Postseason loses. +-- Goalies.PostT: Postseason ties. +-- Goalies.PostENG: Postseason empty net goals. An empty net goal happens when a team scores against their opponent who has pulled their goalie. Since there is no goalie in the net, the net is considered �empty". +-- Goalies.PostSHO: Postseason Shutouts. In ice hockey, a shutout (SHO) is credited to a goaltender who successfully stops the other team from scoring during the entire game. +-- Goalies.PostGA: Postseason Goals against. �Goals Against� are the number of goals recorded while the goalie is on the ice. Include all goals against during regulation and overtime play. +-- Goalies.PostSA: Postseason Shots against. �Shot Against� are the number of shots recorded while the goalie is on the ice. +CREATE TABLE Goalies +( + playerID TEXT not null, + year INTEGER not null, + stint INTEGER not null, + tmID TEXT, + lgID TEXT, + GP TEXT, + Min TEXT, + W TEXT, + L TEXT, + "T/OL" TEXT, + ENG TEXT, + SHO TEXT, + GA TEXT, + SA TEXT, + PostGP TEXT, + PostMin TEXT, + PostW TEXT, + PostL TEXT, + PostT TEXT, + PostENG TEXT, + PostSHO TEXT, + PostGA TEXT, + PostSA TEXT, + primary key (playerID, year, stint), + FOREIGN KEY ("playerID") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- GoaliesSC.playerID: id number identifying the player. number identifying players. +-- GoaliesSC.year: year. 2005-06 listed as "2005". +-- GoaliesSC.tmID: team ID. team abbreviated name. +-- GoaliesSC.lgID: league ID. league abbreviated name. +-- GoaliesSC.GP: Games played. +-- GoaliesSC.Min: Minutes. Minutes of appearance. +-- GoaliesSC.W: Wins. +-- GoaliesSC.L: Loses. +-- GoaliesSC.T: Ties. +-- GoaliesSC.SHO: Shutouts. In ice hockey, a shutout (SHO) is credited to a goaltender who successfully stops the other team from scoring during the entire game. +-- GoaliesSC.GA: Goals against. �Goals Against� are the number of goals recorded while the goalie is on the ice. Include all goals against during regulation and overtime play. +CREATE TABLE GoaliesSC +( + playerID TEXT not null, + year INTEGER not null, + tmID TEXT, + lgID TEXT, + GP INTEGER, + Min INTEGER, + W INTEGER, + L INTEGER, + T INTEGER, + SHO INTEGER, + GA INTEGER, + primary key (playerID, year), + FOREIGN KEY ("playerID") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- GoaliesShootout.playerID: No description. +-- GoaliesShootout.year: year. 2005-06 listed as "2005". +-- GoaliesShootout.stint: stint. +-- GoaliesShootout.tmID: team ID. team abbreviated name. +-- GoaliesShootout.W: Wins. +-- GoaliesShootout.L: Loses. +-- GoaliesShootout.SA: Shots against. �Shot Against� are the number of shots recorded while the goalie is on the ice. +-- GoaliesShootout.GA: Goals against. �Goals Against� are the number of goals recorded while the goalie is on the ice. Include all goals against during regulation and overtime play. +CREATE TABLE GoaliesShootout +( + playerID TEXT, + year INTEGER, + stint INTEGER, + tmID TEXT, + W INTEGER, + L INTEGER, + SA INTEGER, + GA INTEGER, + FOREIGN KEY ("playerID") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- HOF.year: year of hall of fame. +-- HOF.hofID: hall of fame id. +-- HOF.name: name. +-- HOF.category: category. +CREATE TABLE HOF +( + year INTEGER, + hofID TEXT not null + primary key, + name TEXT, + category TEXT +); +-- Master.playerID: id number identifying the player. +-- Master.coachID: coach ID. coach id number. if a person has both playerID and coachID, it means this person becomes coach after retirement. +-- Master.hofID: hall of fame id. +-- Master.firstName: first name. +-- Master.lastName: last name. +-- Master.nameNote: name note. note about name. +-- Master.nameGiven: name given. Given name. +-- Master.nameNick: Nickname. (multiple entries separated by "/"). +-- Master.height: height. +-- Master.weight: weight. +-- Master.shootCatch: shoot catch. Shooting hand (or catching hand for goalies). Shooting hand (or catching hand for goalies). L: left hand. R: right hand. if null or 'empty', it means this player is good at both left and right hand. +-- Master.legendsID: legends ID. ID at Legends Of Hockey. +-- Master.ihdbID: Internet Hockey Database ID. ID at the Internet Hockey Database. +-- Master.hrefID: Hockey-Reference.com ID. ID at Hockey-Reference.com. +-- Master.firstNHL: First NHL season. +-- Master.lastNHL: Last NHL season. +-- Master.firstWHA: First WHA season. +-- Master.lastWHA: Last WHA season. +-- Master.pos: position. LW: left winger. RW: right winger. C: center. G: goalie. D: defenseman. W: winger. F: forward. the player with W (winger) means he can play the role as both LW (left winger) and RW (right winger). some players have two positions, which will be shown as "L/D". It means that LW + D --> left winger and defenseman. +-- Master.birthYear: birth Year. +-- Master.birthMon: birth Month. +-- Master.birthDay: birth Day. the entire / detail birth date in this table is "year" / "month" / "date". +-- Master.birthCountry: birth Country. +-- Master.birthState: birth State. +-- Master.birthCity: birth city. +-- Master.deathYear: death year. +-- Master.deathMon: death month. +-- Master.deathDay: death day. +-- Master.deathCountry: death country. +-- Master.deathState: death state. +-- Master.deathCity: death city. +-- Relationship: Master(coachID) to Coaches(coachID). The declared relationship requires a matching parent, but its key is not unique at the parent table grain. Validate existence without imposing uniqueness. +CREATE TABLE Master +( + playerID TEXT, + coachID TEXT, + hofID TEXT, + firstName TEXT, + lastName TEXT not null, + nameNote TEXT, + nameGiven TEXT, + nameNick TEXT, + height TEXT, + weight TEXT, + shootCatch TEXT, + legendsID TEXT, + ihdbID TEXT, + hrefID TEXT, + firstNHL TEXT, + lastNHL TEXT, + firstWHA TEXT, + lastWHA TEXT, + pos TEXT, + birthYear TEXT, + birthMon TEXT, + birthDay TEXT, + birthCountry TEXT, + birthState TEXT, + birthCity TEXT, + deathYear TEXT, + deathMon TEXT, + deathDay TEXT, + deathCountry TEXT, + deathState TEXT, + deathCity TEXT +); +-- Scoring.playerID: player ID. +-- Scoring.year: play year. +-- Scoring.stint: Stint (order of appearance in a season). +-- Scoring.tmID: team id. +-- Scoring.lgID: league id. +-- Scoring.pos: position. LW: left winger. RW: right winger. C: center. G: goalie. D: defenseman. W: winger. F: forward. the player with W (winger) means he can play the role as both LW (left winger) and RW (right winger). some players have two positions, which will be shown as "L/D". It means that LW + D --> left winger and defenseman. +-- Scoring.GP: game played. +-- Scoring.G: goals. +-- Scoring.A: assists. +-- Scoring.Pts: points. +-- Scoring.PIM: Penalty minutes. +-- Scoring.+/-: Plus / minus. The plus minus stat is used to determine how often a player is on the ice when a goal is scored for the team versus against the team. A positive plus minus means that the player has been on for more goals scored than against, while a negative number means they have been on for more against. In another words, higher "+ / -" means more importance to the team, lower means less importance. +-- Scoring.PPG: Power play goals. When a team with more players on the ice scores a goal it is known as a power play goal. Many goals are scored in power play situations as the team is able to keep possession of the puck and have more scoring chances. +-- Scoring.PPA: Power play assists. +-- Scoring.SHG: Shorthanded goals. Sometimes the team with fewer players on the ice known as the short-handed team will score a goal. +-- Scoring.SHA: Shorthanded assists. +-- Scoring.GWG: Game-winning goals. A game-winning goal (GWG) is the goal scored to put the winning team in excess of the losing team's final score. if a player gets more GWG, it means this player is more trustworthy in the critical moment. +-- Scoring.GTG: Game-tying goals. A game-tying goal (GWG) is the goal scored to put the winning team in the ties of the losing team's final score. +-- Scoring.SOG: Shots on goal. a shot that enters the goal or would have entered the goal if it had not been blocked by the goalkeeper or another defensive player. +-- Scoring.PostGP: Postseason games played. +-- Scoring.PostG: Postseason goals. +-- Scoring.PostA: Postseason assists. +-- Scoring.PostPts: Postseason points. +-- Scoring.PostPIM: Postseason penalty minutes. +-- Scoring.Post+/-: Postseason Plus / minus. +-- Scoring.PostPPG: Postseason power play goals. +-- Scoring.PostPPA: Postseason power play assists. +-- Scoring.PostSHG: Postseason Shorthanded goals. +-- Scoring.PostSHA: Postseason Shorthanded assists. +-- Scoring.PostGWG: Postseason game-winning goals. +-- Scoring.PostSOG: Postseason shots on goal. +CREATE TABLE Scoring +( + playerID TEXT, + year INTEGER, + stint INTEGER, + tmID TEXT, + lgID TEXT, + pos TEXT, + GP INTEGER, + G INTEGER, + A INTEGER, + Pts INTEGER, + PIM INTEGER, + "+/-" TEXT, + PPG TEXT, + PPA TEXT, + SHG TEXT, + SHA TEXT, + GWG TEXT, + GTG TEXT, + SOG TEXT, + PostGP TEXT, + PostG TEXT, + PostA TEXT, + PostPts TEXT, + PostPIM TEXT, + "Post+/-" TEXT, + PostPPG TEXT, + PostPPA TEXT, + PostSHG TEXT, + PostSHA TEXT, + PostGWG TEXT, + PostSOG TEXT, + FOREIGN KEY ("playerID") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- ScoringSC.playerID: id number identifying the player. number identifying the player. +-- ScoringSC.year: year. 2005-06 listed as "2005". +-- ScoringSC.tmID: team ID. team abbreviated name. +-- ScoringSC.lgID: league ID. league abbreviated name. +-- ScoringSC.pos: position. +-- ScoringSC.GP: Games played. +-- ScoringSC.G: Goals. goals. +-- ScoringSC.A: assists. +-- ScoringSC.Pts: points. +-- ScoringSC.PIM: Penalty minutes. +CREATE TABLE ScoringSC +( + playerID TEXT, + year INTEGER, + tmID TEXT, + lgID TEXT, + pos TEXT, + GP INTEGER, + G INTEGER, + A INTEGER, + Pts INTEGER, + PIM INTEGER, + FOREIGN KEY ("playerID") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- ScoringShootout.playerID: player id. id number identifying the player. number identifying the player. +-- ScoringShootout.year: year. 2005-06 listed as "2005". +-- ScoringShootout.stint: stint. +-- ScoringShootout.tmID: team ID. team abbreviated name. +-- ScoringShootout.S: shots. +-- ScoringShootout.G: goals. +-- ScoringShootout.GDG: game deciding goals. +CREATE TABLE ScoringShootout +( + playerID TEXT, + year INTEGER, + stint INTEGER, + tmID TEXT, + S INTEGER, + G INTEGER, + GDG INTEGER, + FOREIGN KEY ("playerID") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- ScoringSup.playerID: player id. string ID of players. unique string ID of the player. +-- ScoringSup.year: No description. +-- ScoringSup.PPA: Power play assists. +-- ScoringSup.SHA: Shorthanded assists. +CREATE TABLE ScoringSup +( + playerID TEXT, + year INTEGER, + PPA TEXT, + SHA TEXT, + FOREIGN KEY ("playerID") REFERENCES "Master" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- SeriesPost.year: year. +-- SeriesPost.round: round. see abbrev.csv for details. +-- SeriesPost.series: series. used for the NHL designations. +-- SeriesPost.tmIDWinner: Team ID of winner. +-- SeriesPost.lgIDWinner: League ID of winner. +-- SeriesPost.tmIDLoser: Team ID of loser. Team ID of winner. +-- SeriesPost.lgIDLoser: league id of loser. +-- SeriesPost.W: number of wins of the winner. +-- SeriesPost.L: number of loses of the winner. +-- SeriesPost.T: number of ties. +-- SeriesPost.GoalsWinner: goals for winner. +-- SeriesPost.GoalsLoser: goals for loser. +-- SeriesPost.note: note. Note: EX = exhibition, ND = no decision, TG = total-goals series. +CREATE TABLE SeriesPost +( + year INTEGER, + round TEXT, + series TEXT, + tmIDWinner TEXT, + lgIDWinner TEXT, + tmIDLoser TEXT, + lgIDLoser TEXT, + W INTEGER, + L INTEGER, + T INTEGER, + GoalsWinner INTEGER, + GoalsLoser INTEGER, + note TEXT, + FOREIGN KEY ("year","tmIDLoser") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("year","tmIDWinner") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- TeamSplits.year: year. +-- TeamSplits.lgID: league ID. league ID number. +-- TeamSplits.tmID: team ID. +-- TeamSplits.hW: home wins. +-- TeamSplits.hL: home loses. +-- TeamSplits.hT: home ties. +-- TeamSplits.hOTL: Home overtime losses. +-- TeamSplits.rW: Road wins. +-- TeamSplits.rL: Road loses. +-- TeamSplits.rT: Road ties. +-- TeamSplits.rOTL: road overtime loses. +-- TeamSplits.SepW: September wins. +-- TeamSplits.SepL: September loses. +-- TeamSplits.SepT: September ties. +-- TeamSplits.SepOL: September overtime loses. +-- TeamSplits.OctW: October wins. +-- TeamSplits.OctL: October loses. +-- TeamSplits.OctT: October ties. +-- TeamSplits.OctOL: October overtime loses. +-- TeamSplits.NovW: November wins. +-- TeamSplits.NovL: November loses. +-- TeamSplits.NovT: November ties. +-- TeamSplits.NovOL: November overtime loses. +-- TeamSplits.DecW: December wins. +-- TeamSplits.DecL: December loses. +-- TeamSplits.DecT: December ties. +-- TeamSplits.DecOL: December overtime loses. +-- TeamSplits.JanW: January wins. +-- TeamSplits.JanL: January loses. +-- TeamSplits.JanT: January ties. +-- TeamSplits.JanOL: January overtime loses. +-- TeamSplits.FebW: February wins. +-- TeamSplits.FebL: February loses. +-- TeamSplits.FebT: February ties. +-- TeamSplits.FebOL: February overtime loses. +-- TeamSplits.MarW: March wins. +-- TeamSplits.MarL: March loses. +-- TeamSplits.MarT: March ties. +-- TeamSplits.MarOL: March overtime loses. +-- TeamSplits.AprW: April wins. +-- TeamSplits.AprL: April loses. +-- TeamSplits.AprT: April ties. +-- TeamSplits.AprOL: April overtime loses. +CREATE TABLE TeamSplits +( + year INTEGER not null, + lgID TEXT, + tmID TEXT not null, + hW INTEGER, + hL INTEGER, + hT INTEGER, + hOTL TEXT, + rW INTEGER, + rL INTEGER, + rT INTEGER, + rOTL TEXT, + SepW TEXT, + SepL TEXT, + SepT TEXT, + SepOL TEXT, + OctW TEXT, + OctL TEXT, + OctT TEXT, + OctOL TEXT, + NovW TEXT, + NovL TEXT, + NovT TEXT, + NovOL TEXT, + DecW TEXT, + DecL TEXT, + DecT TEXT, + DecOL TEXT, + JanW INTEGER, + JanL INTEGER, + JanT INTEGER, + JanOL TEXT, + FebW INTEGER, + FebL INTEGER, + FebT INTEGER, + FebOL TEXT, + MarW TEXT, + MarL TEXT, + MarT TEXT, + MarOL TEXT, + AprW TEXT, + AprL TEXT, + AprT TEXT, + AprOL TEXT, + primary key (year, tmID), + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- TeamVsTeam.year: year. +-- TeamVsTeam.lgID: league ID. league ID number. +-- TeamVsTeam.tmID: team ID. +-- TeamVsTeam.oppID: opponent ID. +-- TeamVsTeam.W: wins. +-- TeamVsTeam.L: loses. +-- TeamVsTeam.T: ties. +-- TeamVsTeam.OTL: overtime loses. +CREATE TABLE TeamVsTeam +( + year INTEGER not null, + lgID TEXT, + tmID TEXT not null, + oppID TEXT not null, + W INTEGER, + L INTEGER, + T INTEGER, + OTL TEXT, + primary key (year, tmID, oppID), + FOREIGN KEY ("oppID","year") REFERENCES "Teams" ("tmID","year") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- Teams.year: year. +-- Teams.lgID: league ID. league ID number. +-- Teams.tmID: team ID. +-- Teams.franchID: Franchise ID. +-- Teams.confID: Conference ID. see abbrev.csv for details. +-- Teams.divID: Division ID. see abbrev.csv for details. +-- Teams.rank: Final standing. +-- Teams.playoff: playoff results. +-- Teams.G: games. +-- Teams.W: wins. +-- Teams.L: loses. +-- Teams.T: ties. +-- Teams.OTL: Overtime losses. +-- Teams.Pts: points. +-- Teams.SoW: Shootout wins. +-- Teams.SoL: Shootout loses. +-- Teams.GF: Goals for. +-- Teams.GA: Goals against. goals against. +-- Teams.name: Full team name. +-- Teams.PIM: Penalty minutes. +-- Teams.BenchMinor: Bench minors (minutes). A bench minor penalty is a minor penalty committed by a player or coach that is not on the ice. It is like a minor penalty in that it calls for the offending player to serve two minutes in the penalty box. +-- Teams.PPG: Power play goals. +-- Teams.PPC: Power play chances. power play percentage (PP%) = PPG / PPC. +-- Teams.SHA: Shorthanded goals against. +-- Teams.PKG: Power play goals against. +-- Teams.PKC: Penalty kill chances. +-- Teams.SHF: Shorthanded goals for. +CREATE TABLE Teams +( + year INTEGER not null, + lgID TEXT, + tmID TEXT not null, + franchID TEXT, + confID TEXT, + divID TEXT, + rank INTEGER, + playoff TEXT, + G INTEGER, + W INTEGER, + L INTEGER, + T INTEGER, + OTL TEXT, + Pts INTEGER, + SoW TEXT, + SoL TEXT, + GF INTEGER, + GA INTEGER, + name TEXT, + PIM TEXT, + BenchMinor TEXT, + PPG TEXT, + PPC TEXT, + SHA TEXT, + PKG TEXT, + PKC TEXT, + SHF TEXT, + primary key (year, tmID) +); +-- TeamsHalf.year: year. +-- TeamsHalf.lgID: league ID. league ID number. +-- TeamsHalf.tmID: team ID. +-- TeamsHalf.half: First or second half of season. +-- TeamsHalf.rank: Final standing for the half. +-- TeamsHalf.G: Games. +-- TeamsHalf.W: wins. +-- TeamsHalf.L: loses. +-- TeamsHalf.T: ties. +-- TeamsHalf.GF: goals for. +-- TeamsHalf.GA: goals against. goal against. +CREATE TABLE TeamsHalf +( + year INTEGER not null, + lgID TEXT, + tmID TEXT not null, + half INTEGER not null, + rank INTEGER, + G INTEGER, + W INTEGER, + L INTEGER, + T INTEGER, + GF INTEGER, + GA INTEGER, + primary key (year, tmID, half), + FOREIGN KEY ("tmID","year") REFERENCES "Teams" ("tmID","year") ON UPDATE CASCADE ON DELETE CASCADE +); +-- TeamsPost.year: year. +-- TeamsPost.lgID: league ID. league ID number. +-- TeamsPost.tmID: team ID. +-- TeamsPost.G: Games. +-- TeamsPost.W: wins. +-- TeamsPost.L: loses. +-- TeamsPost.T: ties. +-- TeamsPost.GF: goals for. +-- TeamsPost.GA: goals against. +-- TeamsPost.PIM: penalty minutes. +-- TeamsPost.BenchMinor: Bench minors (minutes). +-- TeamsPost.PPG: Power play goals. +-- TeamsPost.PPC: Power play chances. +-- TeamsPost.SHA: Shorthanded goals against. +-- TeamsPost.PKG: Power play goals against. +-- TeamsPost.PKC: Penalty kill chances. +-- TeamsPost.SHF: Shorthanded goals for. +CREATE TABLE TeamsPost +( + year INTEGER not null, + lgID TEXT, + tmID TEXT not null, + G INTEGER, + W INTEGER, + L INTEGER, + T INTEGER, + GF INTEGER, + GA INTEGER, + PIM TEXT, + BenchMinor TEXT, + PPG TEXT, + PPC TEXT, + SHA TEXT, + PKG TEXT, + PKC TEXT, + SHF TEXT, + primary key (year, tmID), + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- TeamsSC.year: year. +-- TeamsSC.lgID: league ID. league ID number. +-- TeamsSC.tmID: team ID. +-- TeamsSC.G: Games. +-- TeamsSC.W: wins. +-- TeamsSC.L: loses. +-- TeamsSC.T: ties. +-- TeamsSC.GF: goals for. +-- TeamsSC.GA: goals against. +-- TeamsSC.PIM: penalty minutes. +CREATE TABLE TeamsSC +( + year INTEGER not null, + lgID TEXT, + tmID TEXT not null, + G INTEGER, + W INTEGER, + L INTEGER, + T INTEGER, + GF INTEGER, + GA INTEGER, + PIM TEXT, + primary key (year, tmID), + FOREIGN KEY ("year","tmID") REFERENCES "Teams" ("year","tmID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- abbrev.Type: type of hockey games. +-- abbrev.Code: abbreviated codes. +-- abbrev.Fullname: full names of code. +CREATE TABLE abbrev +( + Type TEXT not null, + Code TEXT not null, + Fullname TEXT, + primary key (Type, Code) +); +CREATE UNIQUE INDEX "fk_review_unique_Master_playerID" ON "Master" ("playerID"); diff --git a/schemas/human_resources.sql b/schemas/human_resources.sql new file mode 100644 index 0000000000000000000000000000000000000000..5a1a06d528a3b465dc2e7b55b92da2423498b949 --- /dev/null +++ b/schemas/human_resources.sql @@ -0,0 +1,56 @@ +-- employee.ssn: social security number. employee's ssn. +-- employee.lastname: last name. employee's last name. +-- employee.firstname: first name. employee's first name. employee's full name is firstname lastname . +-- employee.hiredate: hire date. employee's hire date. yyyy-mm-dd. +-- employee.salary: employee's salary. the unit is dollar per year. +-- employee.gender: employee's gender. +-- employee.performance: employee's performance. Good / Average/ Poor. +-- employee.positionID: position id. the unique id for position. +-- employee.locationID: location id. the unique id for location. +CREATE TABLE employee +( + ssn TEXT + primary key, + lastname TEXT, + firstname TEXT, + hiredate TEXT, + salary TEXT, + gender TEXT, + performance TEXT, + positionID INTEGER, + locationID INTEGER, + FOREIGN KEY ("positionID") REFERENCES "position" ("positionID"), + FOREIGN KEY ("locationID") REFERENCES "location" ("locationID") +); +-- location.locationID: location id. the unique id for location. +-- location.locationcity: location city. the location city. +-- location.address: the detailed address of the location. +-- location.state: the state abbreviation. +-- location.zipcode: zip code. zip code of the location. +-- location.officephone: office phone. the office phone number of the location. +CREATE TABLE location +( + locationID INTEGER + constraint location_pk + primary key, + locationcity TEXT, + address TEXT, + state TEXT, + zipcode INTEGER, + officephone TEXT +); +-- position.positionID: position id. the unique id for position. +-- position.positiontitle: position title. the position title. +-- position.educationrequired: education required. the required education year. Generally, more complex work requires more education year. +-- position.minsalary: minimum salary. minimum salary of this position. +-- position.maxsalary: maximum salary. maximum salary of this position. +CREATE TABLE position +( + positionID INTEGER + constraint position_pk + primary key, + positiontitle TEXT, + educationrequired TEXT, + minsalary TEXT, + maxsalary TEXT +); diff --git a/schemas/image_and_language.sql b/schemas/image_and_language.sql new file mode 100644 index 0000000000000000000000000000000000000000..0988d408f83e3d31e1e3ff70d39a7eafe86d1c3e --- /dev/null +++ b/schemas/image_and_language.sql @@ -0,0 +1,70 @@ +-- ATT_CLASSES.ATT_CLASS_ID: ATTRIBUTE CLASS ID. the unique attribute class ids. +-- ATT_CLASSES.ATT_CLASS: ATTRIBUTE CLASS. the corresponding classes for attributes. +CREATE TABLE ATT_CLASSES +( + ATT_CLASS_ID INTEGER default 0 not null + primary key, + ATT_CLASS TEXT not null +); +-- IMG_OBJ.IMG_ID: IMAGE ID. the id representing images. +-- IMG_OBJ.OBJ_SAMPLE_ID: OBJECT SAMPLE ID. the id of the object sample. +-- IMG_OBJ.OBJ_CLASS_ID: OBJECT CLASS ID. the id indicating class of the objects. +-- IMG_OBJ.X: x coordinate. +-- IMG_OBJ.Y: y coordinate. +-- IMG_OBJ.W: width of the bounding box of the object. +-- IMG_OBJ.H: height of the bounding box of the object. bounding box of the object: (x, y, W, H). +CREATE TABLE IMG_OBJ +( + IMG_ID INTEGER default 0 not null, + OBJ_SAMPLE_ID INTEGER default 0 not null, + OBJ_CLASS_ID INTEGER null, + X INTEGER null, + Y INTEGER null, + W INTEGER null, + H INTEGER null, + primary key (IMG_ID, OBJ_SAMPLE_ID), + FOREIGN KEY ("OBJ_CLASS_ID") REFERENCES "OBJ_CLASSES" ("OBJ_CLASS_ID") +); +-- IMG_OBJ_ATT.IMG_ID: IMAGE ID. id number of each image. +-- IMG_OBJ_ATT.ATT_CLASS_ID: ATTRIBUTE CLASS ID. attribute class number for image. if one IMG_ID has many ATT_CLASS_ID, it refers to that this image has multiple attributes. +-- IMG_OBJ_ATT.OBJ_SAMPLE_ID: OBJECT SAMPLE ID. object sample id. • if one IMG_ID has many OBJ_SAMPLE_ID, it refers to that this image has multiple objects. • if one ATT_CLASS_ID has many OBJ_SAMPLE_ID, it refers to that this attribute is composed of multiple objects. +CREATE TABLE IMG_OBJ_ATT +( + IMG_ID INTEGER default 0 not null, + ATT_CLASS_ID INTEGER default 0 not null, + OBJ_SAMPLE_ID INTEGER default 0 not null, + primary key (IMG_ID, ATT_CLASS_ID, OBJ_SAMPLE_ID), + FOREIGN KEY ("IMG_ID","OBJ_SAMPLE_ID") REFERENCES "IMG_OBJ" ("IMG_ID","OBJ_SAMPLE_ID"), + FOREIGN KEY ("ATT_CLASS_ID") REFERENCES "ATT_CLASSES" ("ATT_CLASS_ID") +); +-- IMG_REL.IMG_ID: IMAGE ID. the image id. +-- IMG_REL.PRED_CLASS_ID: PREDICTION CLASS ID. the prediction relationship class between objects. if OBJ1_SAMPLE_ID = OBJ2_SAMPLE_ID, this relationship is the self-relation. +-- IMG_REL.OBJ1_SAMPLE_ID: OBJECT1 SAMPLE ID. the sample id of the first object. +-- IMG_REL.OBJ2_SAMPLE_ID: OBJECT2 SAMPLE ID. the sample id of the second object. if (OBJ1_SAMPLE_ID, OBJ2_SAMPLE_ID) has multiple PRED_CLASS_ID, it means these two objects have multiple relations. +CREATE TABLE IMG_REL +( + IMG_ID INTEGER default 0 not null, + PRED_CLASS_ID INTEGER default 0 not null, + OBJ1_SAMPLE_ID INTEGER default 0 not null, + OBJ2_SAMPLE_ID INTEGER default 0 not null, + primary key (IMG_ID, PRED_CLASS_ID, OBJ1_SAMPLE_ID, OBJ2_SAMPLE_ID), + FOREIGN KEY ("IMG_ID","OBJ2_SAMPLE_ID") REFERENCES "IMG_OBJ" ("IMG_ID","OBJ_SAMPLE_ID"), + FOREIGN KEY ("IMG_ID","OBJ1_SAMPLE_ID") REFERENCES "IMG_OBJ" ("IMG_ID","OBJ_SAMPLE_ID"), + FOREIGN KEY ("PRED_CLASS_ID") REFERENCES "PRED_CLASSES" ("PRED_CLASS_ID") +); +-- OBJ_CLASSES.OBJ_CLASS_ID: OBJECT CLASS ID. unique id number identifying object classes. +-- OBJ_CLASSES.OBJ_CLASS: OBJECT CLASS. the explanation about object classes. +CREATE TABLE OBJ_CLASSES +( + OBJ_CLASS_ID INTEGER default 0 not null + primary key, + OBJ_CLASS TEXT not null +); +-- PRED_CLASSES.PRED_CLASS_ID: PREDICTION CLASS ID. the unique prediction id for the class. +-- PRED_CLASSES.PRED_CLASS: PREDICTION CLASS. the caption for the prediction class id. +CREATE TABLE PRED_CLASSES +( + PRED_CLASS_ID INTEGER default 0 not null + primary key, + PRED_CLASS TEXT not null +); diff --git a/schemas/law_episode.sql b/schemas/law_episode.sql new file mode 100644 index 0000000000000000000000000000000000000000..504916f07a8961901b50a68191a3759d72d9fab0 --- /dev/null +++ b/schemas/law_episode.sql @@ -0,0 +1,111 @@ +-- Award.award_id: award id. the unique identifier for the award nomination. +-- Award.organization: the name of the organization that grants the award. +-- Award.year: the year of the nomination for the award. +-- Award.award_category: award category. the class of the award. +-- Award.award: the specific award. +-- Award.series: the name of the Law & Order series that has been nominated. +-- Award.episode_id: episode id. the id of the episode that has been nominated. +-- Award.person_id: the id of the person that has been nominated. +-- Award.role: the role that has been nominated. +-- Award.result: the nomination result. Nominee / Winner. 'Winner' means that the award was actually received. +-- Relationship: Award(person_id) to Person(person_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE Award +( + award_id INTEGER + primary key, + organization TEXT, + year INTEGER, + award_category TEXT, + award TEXT, + series TEXT, + episode_id TEXT, + person_id TEXT, + role TEXT, + result TEXT, + FOREIGN KEY ("episode_id") REFERENCES "Episode" ("episode_id") +); +-- Credit.episode_id: episode id. the id of the episode to which the credit information pertains. +-- Credit.person_id: person id. the id of the person to which the credit information pertains. +-- Credit.category: the kind of credit being recognized. +-- Credit.role: the role for which the person is being recognized. If the credit is for an actor, this is the name of the character he or she portrayed (Dan Florek plays Donald Craven). Otherwise, this is the production role (producer, sound editor). +-- Credit.credited: whether the credit was displayed in the credits at the end of the episode. A person may fill a role in an episode, but not show up in the on-screen credits. In this case, the work is said to be "uncredited.". +CREATE TABLE Credit +( + episode_id TEXT, + person_id TEXT, + category TEXT, + role TEXT, + credited TEXT, + primary key (episode_id, person_id), + FOREIGN KEY ("person_id") REFERENCES "Person" ("person_id"), + FOREIGN KEY ("episode_id") REFERENCES "Episode" ("episode_id") +); +-- Episode.episode_id: episode id. the unique identifier of the episode. +-- Episode.series: the name of the series. +-- Episode.season: a number indicating the season of the episode. +-- Episode.episode: the sequential number of the episode within a specific season. +-- Episode.number_in_series: number in series. the overall sequence number of episode in the entire series. +-- Episode.title: the title of the episode. +-- Episode.summary: a brief description of what happens in the episode. +-- Episode.air_date: air date. the date the episode was initially broadcast in the United States. +-- Episode.episode_image: episode image. a link to an image from the episode. +-- Episode.rating: the weighted average of the votes received for the episode. The higher rating means the episode has more positive viewer comments. +-- Episode.votes: the total number of rating votes for the episode. +CREATE TABLE Episode +( + episode_id TEXT + primary key, + series TEXT, + season INTEGER, + episode INTEGER, + number_in_series INTEGER, + title TEXT, + summary TEXT, + air_date DATE, + episode_image TEXT, + rating REAL, + votes INTEGER +); +-- Keyword.episode_id: episode id. the id of the episode. +-- Keyword.keyword: the keyword that is relevant for the episode. +CREATE TABLE Keyword +( + episode_id TEXT, + keyword TEXT, + primary key (episode_id, keyword), + FOREIGN KEY ("episode_id") REFERENCES "Episode" ("episode_id") +); +-- Person.person_id: person id. the unique identifier for the person. +-- Person.name: the name of the person. +-- Person.birthdate: birth date. the date the person was born. if null, it means this birthdate of the person is not available. +-- Person.birth_name: birth name. the name parents gave to the person shortly after birth. +-- Person.birth_place: birth place. the place where a person was born. the birth place info is integrate if birth_name, birth_place, birth_region don't contain null value. the full birth place = birth_country +birth_region +birth_place. +-- Person.birth_region: birth region. the geographical area describing where a person was born that is larger than the birth place. +-- Person.birth_country: birth country. the name of the country where the person was born. can ask questions about its corresponding continent: e.g.:. USA --> North America. +-- Person.height_meters: height meters. how tall the person is in meters. +-- Person.nickname: the nickname the person goes by. +CREATE TABLE Person +( + person_id TEXT + primary key, + name TEXT, + birthdate DATE, + birth_name TEXT, + birth_place TEXT, + birth_region TEXT, + birth_country TEXT, + height_meters REAL, + nickname TEXT +); +-- Vote.episode_id: episode id. the id of the episode. +-- Vote.stars: a number between 1 and 10 indicating how much the viewer enjoyed the episode. The higher the number, the more the episode was enjoyed. +-- Vote.votes: The total number of viewers that gave the specific episode the number of stars indicated in the "stars" column. +-- Vote.percent: The percent of viewers that gave the specific episode the number of stars indicated in the "stars" column. +CREATE TABLE Vote +( + episode_id TEXT, + stars INTEGER, + votes INTEGER, + percent REAL, + FOREIGN KEY ("episode_id") REFERENCES "Episode" ("episode_id") +); diff --git a/schemas/legislator.sql b/schemas/legislator.sql new file mode 100644 index 0000000000000000000000000000000000000000..87b9179f8852be5abc55d52820bef9608dd15f5d --- /dev/null +++ b/schemas/legislator.sql @@ -0,0 +1,238 @@ +-- current.ballotpedia_id: ballotpedia id. The ballotpedia.org page name for the person (spaces are given as spaces, not underscores). if this value is null or empty, it means this legislator doesn't have account on ballotpedia.org. +-- current.bioguide_id: bioguide id. The alphanumeric ID for this legislator. +-- current.birthday_bio: birthday bio. The legislator's birthday,. in YYYY-MM-DD format. +-- current.cspan_id: cspan id. The numeric ID for this legislator on C-SPAN's video website,. if this value is null or empty, it means this legislator doesn't have account on C-SPAN's video website. +-- current.fec_id: fec id. A list of IDs for this legislator in Federal Election Commission data. if this value is null or empty, it means this legislator hasn't not been registered in Federal Election Commission data. +-- current.first_name: first name. first name of the legislator. +-- current.gender_bio: gender bio. gender of the legislator. +-- current.google_entity_id_id: google entity id. if this value is null or empty, it means this legislator are not google entities. +-- current.govtrack_id: govtrack id. The numeric ID for this legislator on GovTrack.us. if this value is null or empty, it means this legislator doesn't have account on GovTrack.us. +-- current.house_history_id: house history id. The numeric ID for this legislator on http://history.house.gov/People/Search/. The ID is present only for members who have served in the U.S. House. +-- current.icpsr_id: interuniversity consortium for political and social research id. The numeric ID for this legislator in Keith Poole's VoteView.com website, originally based on an ID system by the Interuniversity Consortium for Political and Social Research (stored as an integer). if this value is null or empty, it means this legislator doesn't have account on VoteView.com. +-- current.last_name: last name. last name of the legislator. +-- current.lis_id: legislator id. The alphanumeric ID for this legislator found in Senate roll call votes. The ID is present only for members who attended in Senate roll call votes. +-- current.maplight_id: maplight id. The numeric ID for this legislator on maplight.org. if this value is null or empty, it means this legislator doesn't have account on maplight.org. +-- current.middle_name: middle name. the middle name of the legislator. +-- current.nickname_name: nickname. nickname of the legislator. +-- current.official_full_name: official full name. +-- current.opensecrets_id: opensecrets id. The alphanumeric ID for this legislator on OpenSecrets.org. if this value is null or empty, it means this legislator doesn't have account on OpenSecrets.org. +-- current.religion_bio: religion bio. The legislator's religion. +-- current.suffix_name: suffix name. +-- current.thomas_id: thomas id. The numeric ID for this legislator on http://thomas.gov and http://beta.congress.gov. if this value is null or empty, it means this legislator doesn't have account on both http://thomas.gov and http://beta.congress.gov. +-- current.votesmart_id: votesmart id. The numeric ID for this legislator on VoteSmart.org. if this value is null or empty, it means this legislator doesn't have account on VoteSmart.org. +-- current.wikidata_id: wikidata id. the id for wikidata. +-- current.wikipedia_id: wikipedia id. The Wikipedia page name for the person. if a legislator has wikipedia id, it means he or she is famous or impact. +CREATE TABLE current +( + ballotpedia_id TEXT, + bioguide_id TEXT, + birthday_bio DATE, + cspan_id REAL, + fec_id TEXT, + first_name TEXT, + gender_bio TEXT, + google_entity_id_id TEXT, + govtrack_id INTEGER, + house_history_id REAL, + icpsr_id REAL, + last_name TEXT, + lis_id TEXT, + maplight_id REAL, + middle_name TEXT, + nickname_name TEXT, + official_full_name TEXT, + opensecrets_id TEXT, + religion_bio TEXT, + suffix_name TEXT, + thomas_id INTEGER, + votesmart_id REAL, + wikidata_id TEXT, + wikipedia_id TEXT, + primary key (bioguide_id, cspan_id) +); +-- current-terms.address: the address of this legislator. +-- current-terms.bioguide: bioguide id. The alphanumeric ID for this legislator. +-- current-terms.caucus: caucus. For independents, the party that the legislator caucuses with, using the same values as the party field. Omitted if the legislator caucuses with the party indicated in the party field. When in doubt about the difference between the party and caucus fields, the party field is what displays after the legislator's name (i.e. "(D)") but the caucus field is what normally determines committee seniority. This field was added starting with terms for the 113th Congress. +-- current-terms.chamber: chamber. • senate. • house. +-- current-terms.class: class. For senators, their election class (1, 2, or 3). only senator has class, if the value is null or empty, it means this legislator is not senator. +-- current-terms.contact_form: The website URL of the contact page on the legislator's official website. +-- current-terms.district: district. For representatives, the district number they are serving from. if null or empty, they are not representatives. +-- current-terms.end: the end of the term. end: The date the term ended (because the Congress ended or the legislator died or resigned, etc.). End dates follow the Constitutional end of a term. Since 1935, terms begin and end on January 3 at noon in odd-numbered years, and thus a term end date may also be a term start date. Prior to 1935, terms began on March 4 and ended either on March 3 or March 4. The end date is the last date on which the legislator served this term. Unlike the start date, whether Congress was in session or not does not affect the value of this field. +-- current-terms.fax: The fax number of the legislator's Washington, D.C. office. only valid if the term is current. +-- current-terms.last: the last known number. +-- current-terms.name: not useful. +-- current-terms.office: office. only valid if the term is current, otherwise the last known office. +-- current-terms.party: The political party of the legislator. If the legislator changed parties, this is the most recent party held during the term and party_affiliations will be set. Values are typically "Democrat", "Independent", or "Republican". The value typically matches the political party of the legislator on the ballot in his or her last election, although for state affiliate parties such as "Democratic Farmer Labor" we will use the national party name ("Democrat") instead to keep the values of this field normalized. +-- current-terms.party_affiliations: party affiliations. This field is present if the legislator changed party or caucus affiliation during the term. The value is a list of time periods, with start and end dates, each of which has a party field and a caucus field if applicable, with the same meanings as the main party and caucus fields. The time periods cover the entire term, so the first start will match the term start, the last end will match the term end, and the last party (and caucus if present) will match the term party (and caucus). +-- current-terms.phone: The phone number of the legislator's Washington, D.C. office. only valid if the term is current, otherwise the last known number. +-- current-terms.relation: not useful. +-- current-terms.rss_url: Really Simple Syndication URL. The URL to the official website's RSS feed. +-- current-terms.start: The date legislative service began: the date the legislator was sworn in, if known, or else the beginning of the legislator's term. Since 1935 regularly elected terms begin on January 3 at noon on odd-numbered years, but when Congress does not first meet on January 3, term start dates might reflect that swearing-in occurred on a later date. (Prior to 1935, terms began on March 4 of odd-numbered years, see here.). +-- current-terms.state: state code. AK: Alaska. AL: Alabama. AR: Arkansas. AZ: Arizona. CA: California. CO: Colorado. CT: Connecticut. DE: Delaware. FL: Florida. GA: Georgia. HI: Hawaii. IA: Iowa. ID: Idaho. IL: Illinois. IN: Indiana. KS: Kansas. KY: Kentucky. LA: Louisiana. MA: Massachusetts. MD: Maryland. ME: Maine. MI: Michigan. MN: Minnesota. MO: Missouri. MS: Mississippi. MT: Montana. NC: North Carolina. ND: North Dakota. NE: Nebraska. NH: New Hampshire. NJ: New Jersey. 9 divisions of states in us: (please mention). https://www2.census.gov/geo/pdfs/maps-data/maps/reference/us_regdiv.pdf. +-- current-terms.state_rank: whether they are the "junior" or "senior" senator. only valid if the term is current, otherwise the senator's rank at the time the term ended. only senator has this value. +-- current-terms.title: title of the legislator. +-- current-terms.type: The type of the term. Either "sen" for senators or "rep" for representatives and delegates to the House. +-- current-terms.url: The official website URL of the legislator. only valid if the term is current. +CREATE TABLE "current-terms" +( + address TEXT, + bioguide TEXT, + caucus TEXT, + chamber TEXT, + class REAL, + contact_form TEXT, + district REAL, + end TEXT, + fax TEXT, + last TEXT, + name TEXT, + office TEXT, + party TEXT, + party_affiliations TEXT, + phone TEXT, + relation TEXT, + rss_url TEXT, + start TEXT, + state TEXT, + state_rank TEXT, + title TEXT, + type TEXT, + url TEXT, + primary key (bioguide, end), + FOREIGN KEY ("bioguide") REFERENCES "current" ("bioguide_id") +); +-- historical.ballotpedia_id: ballotpedia id. The ballotpedia.org page name for the person (spaces are given as spaces, not underscores). if this value is null or empty, it means this legislator doesn't have account on ballotpedia.org. +-- historical.bioguide_previous_id: bioguide previous id. The previous alphanumeric ID for this legislator. +-- historical.bioguide_id: bioguide id. The alphanumeric ID for this legislator. +-- historical.birthday_bio: birthday bio. The legislator's birthday,. in YYYY-MM-DD format. +-- historical.cspan_id: cspan id. The numeric ID for this legislator on C-SPAN's video website,. if this value is null or empty, it means this legislator doesn't have account on C-SPAN's video website. +-- historical.fec_id: fec id. A list of IDs for this legislator in Federal Election Commission data. if this value is null or empty, it means this legislator hasn't not been registered in Federal Election Commission data. +-- historical.first_name: first name. first name of the legislator. +-- historical.gender_bio: gender bio. gender of the legislator. +-- historical.google_entity_id_id: google entity id. if this value is null or empty, it means this legislator are not google entities. +-- historical.govtrack_id: govtrack id. The numeric ID for this legislator on GovTrack.us. if this value is null or empty, it means this legislator doesn't have account on GovTrack.us. +-- historical.house_history_alternate_id: house history alternate id. The alternative numeric ID for this legislator. +-- historical.house_history_id: house history id. The numeric ID for this legislator on http://history.house.gov/People/Search/. The ID is present only for members who have served in the U.S. House. +-- historical.icpsr_id: interuniversity consortium for political and social research id. The numeric ID for this legislator in Keith Poole's VoteView.com website, originally based on an ID system by the Interuniversity Consortium for Political and Social Research (stored as an integer). if this value is null or empty, it means this legislator doesn't have account on VoteView.com. +-- historical.last_name: last name. last name of the legislator. +-- historical.lis_id: legislator id. The alphanumeric ID for this legislator found in Senate roll call votes. The ID is present only for members who attended in Senate roll call votes. +-- historical.maplight_id: maplight id. The numeric ID for this legislator on maplight.org. if this value is null or empty, it means this legislator doesn't have account on maplight.org. +-- historical.middle_name: middle name. the middle name of the legislator. +-- historical.nickname_name: nickname. nickname of the legislator. +-- historical.official_full_name: official full name. +-- historical.opensecrets_id: opensecrets id. The alphanumeric ID for this legislator on OpenSecrets.org. if this value is null or empty, it means this legislator doesn't have account on OpenSecrets.org. +-- historical.religion_bio: religion bio. The legislator's religion. +-- historical.suffix_name: suffix name. +-- historical.thomas_id: thomas id. The numeric ID for this legislator on http://thomas.gov and http://beta.congress.gov. if this value is null or empty, it means this legislator doesn't have account on both http://thomas.gov and http://beta.congress.gov. +-- historical.votesmart_id: votesmart id. The numeric ID for this legislator on VoteSmart.org. if this value is null or empty, it means this legislator doesn't have account on VoteSmart.org. +-- historical.wikidata_id: wikidata id. the id for wikidata. +-- historical.wikipedia_id: wikipedia id. The Wikipedia page name for the person. if a legislator has wikipedia id, it means he or she is famous or impact. +CREATE TABLE historical +( + ballotpedia_id TEXT, + bioguide_id TEXT + primary key, + bioguide_previous_id TEXT, + birthday_bio TEXT, + cspan_id TEXT, + fec_id TEXT, + first_name TEXT, + gender_bio TEXT, + google_entity_id_id TEXT, + govtrack_id INTEGER, + house_history_alternate_id TEXT, + house_history_id REAL, + icpsr_id REAL, + last_name TEXT, + lis_id TEXT, + maplight_id TEXT, + middle_name TEXT, + nickname_name TEXT, + official_full_name TEXT, + opensecrets_id TEXT, + religion_bio TEXT, + suffix_name TEXT, + thomas_id TEXT, + votesmart_id TEXT, + wikidata_id TEXT, + wikipedia_id TEXT +); +-- historical-terms.bioguide: bioguide id. The alphanumeric ID for this legislator. +-- historical-terms.address: the address of this legislator. +-- historical-terms.chamber: chamber. • senate. • house. +-- historical-terms.class: class. For senators, their election class (1, 2, or 3). only senator has class, if the value is null or empty, it means this legislator is not senator. +-- historical-terms.contact_form: The website URL of the contact page on the legislator's official website. +-- historical-terms.district: district. For representatives, the district number they are serving from. if null or empty, they are not representatives. +-- historical-terms.end: the end of the term. end: The date the term ended (because the Congress ended or the legislator died or resigned, etc.). End dates follow the Constitutional end of a term. Since 1935, terms begin and end on January 3 at noon in odd-numbered years, and thus a term end date may also be a term start date. Prior to 1935, terms began on March 4 and ended either on March 3 or March 4. The end date is the last date on which the legislator served this term. Unlike the start date, whether Congress was in session or not does not affect the value of this field. +-- historical-terms.fax: The fax number of the legislator's Washington, D.C. office. only valid if the term is current. +-- historical-terms.last: the last known number. +-- historical-terms.middle: No description. +-- historical-terms.name: not useful. +-- historical-terms.office: office. only valid if the term is current, otherwise the last known office. +-- historical-terms.party: The political party of the legislator. If the legislator changed parties, this is the most recent party held during the term and party_affiliations will be set. Values are typically "Democrat", "Independent", or "Republican". The value typically matches the political party of the legislator on the ballot in his or her last election, although for state affiliate parties such as "Democratic Farmer Labor" we will use the national party name ("Democrat") instead to keep the values of this field normalized. +-- historical-terms.party_affiliations: party affiliations. This field is present if the legislator changed party or caucus affiliation during the term. The value is a list of time periods, with start and end dates, each of which has a party field and a caucus field if applicable, with the same meanings as the main party and caucus fields. The time periods cover the entire term, so the first start will match the term start, the last end will match the term end, and the last party (and caucus if present) will match the term party (and caucus). +-- historical-terms.phone: The phone number of the legislator's Washington, D.C. office. only valid if the term is current, otherwise the last known number. +-- historical-terms.relation: not useful. +-- historical-terms.rss_url: Really Simple Syndication URL. The URL to the official website's RSS feed. +-- historical-terms.start: The date legislative service began: the date the legislator was sworn in, if known, or else the beginning of the legislator's term. Since 1935 regularly elected terms begin on January 3 at noon on odd-numbered years, but when Congress does not first meet on January 3, term start dates might reflect that swearing-in occurred on a later date. (Prior to 1935, terms began on March 4 of odd-numbered years, see here.). +-- historical-terms.state: state code. AK: Alaska. AL: Alabama. AR: Arkansas. AZ: Arizona. CA: California. CO: Colorado. CT: Connecticut. DE: Delaware. FL: Florida. GA: Georgia. HI: Hawaii. IA: Iowa. ID: Idaho. IL: Illinois. IN: Indiana. KS: Kansas. KY: Kentucky. LA: Louisiana. MA: Massachusetts. MD: Maryland. ME: Maine. MI: Michigan. MN: Minnesota. MO: Missouri. MS: Mississippi. MT: Montana. NC: North Carolina. ND: North Dakota. NE: Nebraska. NH: New Hampshire. NJ: New Jersey. 9 divisions of states in us: (please mention). https://www2.census.gov/geo/pdfs/maps-data/maps/reference/us_regdiv.pdf. +-- historical-terms.state_rank: whether they are the "junior" or "senior" senator. only valid if the term is current, otherwise the senator's rank at the time the term ended. only senator has this value. +-- historical-terms.title: title of the legislator. +-- historical-terms.type: The type of the term. Either "sen" for senators or "rep" for representatives and delegates to the House. +-- historical-terms.url: The official website URL of the legislator. only valid if the term is current. +CREATE TABLE "historical-terms" +( + address TEXT, + bioguide TEXT + primary key, + chamber TEXT, + class REAL, + contact_form TEXT, + district REAL, + end TEXT, + fax TEXT, + last TEXT, + middle TEXT, + name TEXT, + office TEXT, + party TEXT, + party_affiliations TEXT, + phone TEXT, + relation TEXT, + rss_url TEXT, + start TEXT, + state TEXT, + state_rank TEXT, + title TEXT, + type TEXT, + url TEXT, + FOREIGN KEY ("bioguide") REFERENCES "historical" ("bioguide_id") +); +-- social-media.bioguide: The unique alphanumeric ID for this legislator. +-- social-media.facebook: The username of the current official Facebook presence of the legislator. +-- social-media.facebook_id: The numeric ID of the current official Facebook presence of the legislator. +-- social-media.govtrack: The numeric ID for this legislator on GovTrack.us. +-- social-media.instagram: The current official Instagram handle of the legislator. +-- social-media.instagram_id: The numeric ID of the current official Instagram handle of the legislator. +-- social-media.thomas: The numeric ID for this legislator on http://thomas.gov and http://beta.congress.gov. +-- social-media.twitter: The current official Twitter handle of the legislator. +-- social-media.twitter_id: The numeric ID of the current official twitter handle of the legislator. +-- social-media.youtube: The current official YouTube username of the legislator. +-- social-media.youtube_id: The current official YouTube channel ID of the legislator. +CREATE TABLE "social-media" +( + bioguide TEXT + primary key, + facebook TEXT, + facebook_id REAL, + govtrack REAL, + instagram TEXT, + instagram_id REAL, + thomas INTEGER, + twitter TEXT, + twitter_id REAL, + youtube TEXT, + youtube_id TEXT, + FOREIGN KEY ("bioguide") REFERENCES "current" ("bioguide_id") +); +CREATE UNIQUE INDEX "fk_review_unique_current_bioguide_id" ON "current" ("bioguide_id"); diff --git a/schemas/mental_health_survey.sql b/schemas/mental_health_survey.sql new file mode 100644 index 0000000000000000000000000000000000000000..b2e2802bc6e996f24bad26899a0ad89fdb080c12 --- /dev/null +++ b/schemas/mental_health_survey.sql @@ -0,0 +1,33 @@ +-- Answer.AnswerText: Answer Text. The specific and detailed answer text of each question. The content is highly depend on the question. +-- Answer.SurveyID: Survey ID. The id of each survey. The SurveyID is simply survey year i.e., 2014, 2016, 2017, 2018, 2019. +-- Answer.UserID: User ID. The id of different user. Some questions can contain multiple answers, thus the same user can appear more than once for that QuestionID. +-- Answer.QuestionID: Question ID. The id of different questions. Some questions can contain multiple answers, thus the same user can appear more than once for that QuestionID. +CREATE TABLE "Answer" +( + AnswerText TEXT, + SurveyID INTEGER, + UserID INTEGER, + QuestionID INTEGER, + constraint Answer_pk + primary key (UserID, QuestionID), + FOREIGN KEY ("QuestionID") REFERENCES "Question" ("questionid"), + FOREIGN KEY ("SurveyID") REFERENCES "Survey" ("SurveyID") +); +-- Question.questiontext: question text. The detailed text of the question. +-- Question.questionid: question id. The unique id of the question. Each questiontext can only have one unique questionid. +CREATE TABLE Question +( + questiontext TEXT, + questionid INTEGER + constraint Question_pk + primary key +); +-- Survey.SurveyID: Survey ID. The unique id of each survey. Each SurveyID is unique. And SurveyID is simply survey year ie 2014, 2016, 2017, 2018, 2019. +-- Survey.Description: The Description of the specific survey. +CREATE TABLE Survey +( + SurveyID INTEGER + constraint Survey_pk + primary key, + Description TEXT +); diff --git a/schemas/menu.sql b/schemas/menu.sql new file mode 100644 index 0000000000000000000000000000000000000000..923b27f67dbe14418084016edb5e9b64e2b70e81 --- /dev/null +++ b/schemas/menu.sql @@ -0,0 +1,109 @@ +-- Dish.id: unique id number indicating the dishes. +-- Dish.name: the name of the dish. +-- Dish.description: description of the dish. (no value). +-- Dish.menus_appeared: menus appeared. how many menus have this dish. +-- Dish.times_appeared: times appeared. how many times this dish appears in the menu. if times_appeared > menus_appeard: this dish appeared in a menu more than once. +-- Dish.first_appeared: first appeared. the year that this dish appears first. 1. the year outside of [1851, 2012], it means this data is not correct. 2. if this dish lasts longer (last_appeared - first_appeard), it means its history is long or historical / classical. +-- Dish.last_appeared: last appeared. the year that this dish appears the last time. 1. the year outside of [1851, 2012], it means this data is not correct. 2. if this dish lasts longer (last_appeared - first_appeard), it means its history is long or historical / classical. +-- Dish.lowest_price: lowest price. the lowest price of the dish. 0: for free. +-- Dish.highest_price: highest price. the highest price of the dish. +CREATE TABLE Dish +( + id INTEGER + primary key, + name TEXT, + description TEXT, + menus_appeared INTEGER, + times_appeared INTEGER, + first_appeared INTEGER, + last_appeared INTEGER, + lowest_price REAL, + highest_price REAL +); +-- Menu.id: the unique number identifying the menu. +-- Menu.name: the name of the menu. if the value is not null or empty, it means this menu has special dishes. otherwise, this menu is general and nothing special. +-- Menu.sponsor: the sponsor of this menu. if the value is null or empyt, it means this meanu is DIY by the restaurant. +-- Menu.event: the event that the menu was created for. +-- Menu.venue: the venue that the menu was created for. +-- Menu.place: the location that the menu was used. +-- Menu.physical_description: physical description. physical description of the menu. +-- Menu.occasion: occasion of the menu. +-- Menu.notes: notes. +-- Menu.call_number: call number. if null: not support for taking out or booking in advance. +-- Menu.keywords: keywords. not useful. +-- Menu.language: language. not useful. +-- Menu.date: the date that this menu was created. +-- Menu.location: the location that the menu was used. +-- Menu.location_type: not useful. +-- Menu.currency: the currency that the menu was used. +-- Menu.currency_symbol: the currency symbol. +-- Menu.status: status of the menu. +-- Menu.page_count: page count. the number of pages of this menu. +-- Menu.dish_count: dish count. the number of dishes of this menu. +CREATE TABLE Menu +( + id INTEGER + primary key, + name TEXT, + sponsor TEXT, + event TEXT, + venue TEXT, + place TEXT, + physical_description TEXT, + occasion TEXT, + notes TEXT, + call_number TEXT, + keywords TEXT, + language TEXT, + date DATE, + location TEXT, + location_type TEXT, + currency TEXT, + currency_symbol TEXT, + status TEXT, + page_count INTEGER, + dish_count INTEGER +); +-- MenuItem.id: the unique id representing the menu item. +-- MenuItem.menu_page_id: the id of menu page. +-- MenuItem.price: the price of this dish (menu item). +-- MenuItem.high_price: high price. high price of this dish. +-- MenuItem.dish_id: the id of the dish. +-- MenuItem.created_at: created at. the dates when the item was created. +-- MenuItem.updated_at: updated at. the dates when the item was updated. +-- MenuItem.xpos: x position. x-axis position of the dish in this menu page. +-- MenuItem.ypos: y position. y-axis position of the dish in this menu page. +-- Relationship: MenuItem(dish_id) to Dish(id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE MenuItem +( + id INTEGER + primary key, + menu_page_id INTEGER, + price REAL, + high_price REAL, + dish_id INTEGER, + created_at TEXT, + updated_at TEXT, + xpos REAL, + ypos REAL, + FOREIGN KEY ("menu_page_id") REFERENCES "MenuPage" ("id") +); +-- MenuPage.id: the unique id number indentifying the menupage. +-- MenuPage.menu_id: menu id. the id of the menu. +-- MenuPage.page_number: page number. the page number. +-- MenuPage.image_id: image id. the id of the image. +-- MenuPage.full_height: full height. full height of the menu page. (mm). +-- MenuPage.full_width: full width. full width of the menu page. (mm). +-- MenuPage.uuid: No description. +-- Relationship: MenuPage(menu_id) to Menu(id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE MenuPage +( + id INTEGER + primary key, + menu_id INTEGER, + page_number INTEGER, + image_id REAL, + full_height INTEGER, + full_width INTEGER, + uuid TEXT +); diff --git a/schemas/mondial_geo.sql b/schemas/mondial_geo.sql new file mode 100644 index 0000000000000000000000000000000000000000..e84c80f7b490d18f347e4fdd232b725f0f6d7700 --- /dev/null +++ b/schemas/mondial_geo.sql @@ -0,0 +1,479 @@ +-- borders.Country1: a country code. +-- borders.Country2: a country code. +-- borders.Length: length of the border between country1 and country2. +CREATE TABLE "borders" +( + Country1 TEXT default '' not null, + Country2 TEXT default '' not null, + Length REAL, + primary key (Country1, Country2), + FOREIGN KEY ("Country2") REFERENCES "country" ("Code"), + FOREIGN KEY ("Country1") REFERENCES "country" ("Code") +); +-- city.Name: name of city. +-- city.Country: the code of the country where it belongs to. +-- city.Province: the name of the province where it belongs to. +-- city.Population: population of the city. +-- city.Longitude: geographic longitude. +-- city.Latitude: geographic latitude. +CREATE TABLE "city" +( + Name TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + Population INTEGER, + Longitude REAL, + Latitude REAL, + primary key (Name, Province), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- continent.Name: name of the continent. +-- continent.Area: total area of the continent. +CREATE TABLE "continent" +( + Name TEXT default '' not null + primary key, + Area REAL +); +-- country.Name: the country name. +-- country.Code: country code. +-- country.Capital: the name of the capital,. +-- country.Province: the province where the capital belongs to,. +-- country.Area: the total area,. +-- country.Population: the population number. +CREATE TABLE "country" +( + Name TEXT not null + constraint ix_county_Name + unique, + Code TEXT default '' not null + primary key, + Capital TEXT, + Province TEXT, + Area REAL, + Population INTEGER +); +-- desert.Name: the name of the desert. +-- desert.Area: the total area of the desert. +-- desert.Longitude: Longitude. +-- desert.Latitude: Latitude. coordinate: (Longitude, Latitude). +CREATE TABLE "desert" +( + Name TEXT default '' not null + primary key, + Area REAL, + Longitude REAL, + Latitude REAL +); +-- economy.Country: the country code. +-- economy.GDP: gross domestic product. +-- economy.Agriculture: percentage of agriculture of the GDP. +-- economy.Service: percentage of services of the GDP,. +-- economy.Industry: percentage of industry of the GDP. +-- economy.Inflation: inflation rate (per annum),. +CREATE TABLE "economy" +( + Country TEXT default '' not null + primary key, + GDP REAL, + Agriculture REAL, + Service REAL, + Industry REAL, + Inflation REAL, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- encompasses.Country: a country code. +-- encompasses.Continent: the continent name. +-- encompasses.Percentage: how much of the area of a country belongs to the continent. %. +CREATE TABLE "encompasses" +( + Country TEXT not null, + Continent TEXT not null, + Percentage REAL, + primary key (Country, Continent), + FOREIGN KEY ("Continent") REFERENCES "continent" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- ethnicGroup.Country: the country code. +-- ethnicGroup.Name: name of the language. +-- ethnicGroup.Percentage: percentage of the language in this country. %. +CREATE TABLE "ethnicGroup" +( + Country TEXT default '' not null, + Name TEXT default '' not null, + Percentage REAL, + primary key (Name, Country), + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geo_desert.Desert: the name of the desert. +-- geo_desert.Country: the country code where it is located. +-- geo_desert.Province: the province of this country. +CREATE TABLE "geo_desert" +( + Desert TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + primary key (Province, Country, Desert), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Desert") REFERENCES "desert" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geo_estuary.River: the name of the river. +-- geo_estuary.Country: the country code where it is located. +-- geo_estuary.Province: the province of this country. +CREATE TABLE "geo_estuary" +( + River TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + primary key (Province, Country, River), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("River") REFERENCES "river" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geo_island.Island: the name of the island. +-- geo_island.Country: the country code where it is located. +-- geo_island.Province: the province of this country. +CREATE TABLE "geo_island" +( + Island TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + primary key (Province, Country, Island), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Island") REFERENCES "island" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geo_lake.Lake: the name of the lake. +-- geo_lake.Country: the country code where it is located. +-- geo_lake.Province: the province of this country. +CREATE TABLE "geo_lake" +( + Lake TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + primary key (Province, Country, Lake), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Lake") REFERENCES "lake" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geo_mountain.Mountain: the name of the mountain. +-- geo_mountain.Country: the country code where it is located. +-- geo_mountain.Province: the province of this country. +-- Relationship: geo_mountain(Mountain) to mountain(Name). After source-backed restoration, Oraefajokull still lacks an exact parent. The upstream mountain table uses Hvannadalshnukur, a peak/volcano identity question; preserve and flag it rather than silently equating them. +CREATE TABLE "geo_mountain" +( + Mountain TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + primary key (Province, Country, Mountain), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geo_river.River: the name of the river. +-- geo_river.Country: the country code where it is located. +-- geo_river.Province: the province of this country. +CREATE TABLE "geo_river" +( + River TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + primary key (Province, Country, River), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("River") REFERENCES "river" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geo_sea.Sea: the name of the sea. +-- geo_sea.Country: the country code where it is located. +-- geo_sea.Province: the province of this country. +CREATE TABLE "geo_sea" +( + Sea TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + primary key (Province, Country, Sea), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Sea") REFERENCES "sea" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geo_source.River: the name of the river. +-- geo_source.Country: the country code where it is located. +-- geo_source.Province: the province of this country. +CREATE TABLE "geo_source" +( + River TEXT default '' not null, + Country TEXT default '' not null, + Province TEXT default '' not null, + primary key (Province, Country, River), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("River") REFERENCES "river" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- isMember.Country: No description. +-- isMember.Organization: No description. +-- isMember.Type: No description. +CREATE TABLE "isMember" +( + Country TEXT default '' not null, + Organization TEXT default '' not null, + Type TEXT default 'member', + primary key (Country, Organization), + FOREIGN KEY ("Organization") REFERENCES "organization" ("Abbreviation") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- island.Name: the name of the island. +-- island.Islands: the group of islands where it belongs to. +-- island.Area: the area of the island. +-- island.Height: the maximal elevation of the island. +-- island.Type: the type of the island. +-- island.Longitude: Longitude. +-- island.Latitude: Latitude. +CREATE TABLE "island" +( + Name TEXT default '' not null + primary key, + Islands TEXT, + Area REAL, + Height REAL, + Type TEXT, + Longitude REAL, + Latitude REAL +); +-- islandIn.Island: No description. +-- islandIn.Sea: No description. +-- islandIn.Lake: No description. +-- islandIn.River: No description. +CREATE TABLE "islandIn" +( + Island TEXT, + Sea TEXT, + Lake TEXT, + River TEXT, + FOREIGN KEY ("River") REFERENCES "river" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Lake") REFERENCES "lake" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Sea") REFERENCES "sea" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Island") REFERENCES "island" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- lake.Name: the name of the lake. +-- lake.Area: the total area of the lake. +-- lake.Depth: the depth of the lake. +-- lake.Altitude: the altitude (above sea level) of the lake. +-- lake.River: the river that flows out of the lake. +-- lake.Type: the type of the lake. +-- lake.Longitude: longitude of lake. +-- lake.Latitude: latitude of lake. +CREATE TABLE "lake" +( + Name TEXT default '' not null + primary key, + Area REAL, + Depth REAL, + Altitude REAL, + Type TEXT, + River TEXT, + Longitude REAL, + Latitude REAL +); +-- language.Country: the country code. +-- language.Name: name of the language. +-- language.Percentage: percentage of the language in this country. %. +CREATE TABLE "language" +( + Country TEXT default '' not null, + Name TEXT default '' not null, + Percentage REAL, + primary key (Name, Country), + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- located.City: the name of the city. +-- located.Country: the country code where the city belongs to. +-- located.Province: the province where the city belongs to. +-- located.River: the river where it is located at. +-- located.Lake: the lake where it is located at. +-- located.Sea: the sea where it is located at. Note that for a given city, there can be several lakes/seas/rivers where it is located at. +CREATE TABLE "located" +( + City TEXT, + Province TEXT, + Country TEXT, + River TEXT, + Lake TEXT, + Sea TEXT, + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("City","Province") REFERENCES "city" ("Name","Province") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Sea") REFERENCES "sea" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Lake") REFERENCES "lake" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("River") REFERENCES "river" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- locatedOn.City: the name of the city. +-- locatedOn.Province: the province where the city belongs to. +-- locatedOn.Country: the country code where the city belongs to. +-- locatedOn.Island: the island it is (maybe only partially) located on. +CREATE TABLE "locatedOn" +( + City TEXT default '' not null, + Province TEXT default '' not null, + Country TEXT default '' not null, + Island TEXT default '' not null, + primary key (City, Province, Country, Island), + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("City","Province") REFERENCES "city" ("Name","Province") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Island") REFERENCES "island" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- mergesWith.Sea1: the name of the mountain. +-- mergesWith.Sea2: the country code where it is located. +CREATE TABLE "mergesWith" +( + Sea1 TEXT default '' not null, + Sea2 TEXT default '' not null, + primary key (Sea1, Sea2), + FOREIGN KEY ("Sea2") REFERENCES "sea" ("Name") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Sea1") REFERENCES "sea" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- mountain.Name: the name of the mountain. +-- mountain.Mountains: the mountains where it belongs to. +-- mountain.Height: the maximal elevation of the summit of the mountain. +-- mountain.Type: the sea where it finally flows to. (note that at most one out of {river,lake,sea} can be non-null. +-- mountain.Longitude: the length of the river. +-- mountain.Latitude: the longitude of its source. +CREATE TABLE "mountain" +( + Name TEXT default '' not null + primary key, + Mountains TEXT, + Height REAL, + Type TEXT, + Longitude REAL, + Latitude REAL +); +-- mountainOnIsland.Mountain: the name of the mountain. +-- mountainOnIsland.Island: the name of the island. +-- Relationship: mountainOnIsland(Mountain) to mountain(Name). After source-backed restoration, Oraefajokull still lacks an exact parent. The upstream mountain table uses Hvannadalshnukur, a peak/volcano identity question; preserve and flag it rather than silently equating them. +CREATE TABLE "mountainOnIsland" +( + Mountain TEXT default '' not null, + Island TEXT default '' not null, + primary key (Mountain, Island), + FOREIGN KEY ("Island") REFERENCES "island" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- organization.Abbreviation: its abbreviation. +-- organization.Name: the full name of the organization. +-- organization.City: the city where the headquarters are located. +-- organization.Country: the code of the country where the headquarters are located. +-- organization.Province: the name of the province where the headquarters are located,. +-- organization.Established: date of establishment. +CREATE TABLE "organization" +( + Abbreviation TEXT not null + primary key, + Name TEXT not null + constraint ix_organization_OrgNameUnique + unique, + City TEXT, + Country TEXT, + Province TEXT, + Established DATE, + FOREIGN KEY ("Province","Country") REFERENCES "province" ("Name","Country") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("City","Province") REFERENCES "city" ("Name","Province") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- politics.Country: the country code. +-- politics.Independence: date of independence. Commonsense evidence:. if the value is null or empty, it means this country is not independent. +-- politics.Dependent: the country code where the area belongs to. +-- politics.Government: type of government. +CREATE TABLE "politics" +( + Country TEXT default '' not null + primary key, + Independence DATE, + Dependent TEXT, + Government TEXT, + FOREIGN KEY ("Dependent") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- population.Country: the country code. +-- population.Population_Growth: population growth. population growth rate. per annum. +-- population.Infant_Mortality: infant mortality. per thousand. +CREATE TABLE "population" +( + Country TEXT default '' not null + primary key, + Population_Growth REAL, + Infant_Mortality REAL, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- province.Name: the name of the administrative division. +-- province.Country: the country code where it belongs to. +-- province.Area: the total area of the province,. +-- province.Population: the population of the province. +-- province.Capital: the name of the capital. if null, doesn't have capital. +-- province.CapProv: capital province. the name of the province where the capital belongs to. note that capprov is not necessarily equal to name. +CREATE TABLE "province" +( + Name TEXT not null, + Country TEXT not null, + Population INTEGER, + Area REAL, + Capital TEXT, + CapProv TEXT, + primary key (Name, Country), + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- religion.Country: the country code. +-- religion.Name: name of the religion. +-- religion.Percentage: percentage of the language in this country. %. +CREATE TABLE "religion" +( + Country TEXT default '' not null, + Name TEXT default '' not null, + Percentage REAL, + primary key (Name, Country), + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); +-- river.Name: the name of the river. +-- river.River: the river where it finally flows to. +-- river.Lake: the lake where it finally flows to. +-- river.Sea: the sea where it finally flows to. (note that at most one out of {river,lake,sea} can be non-null. +-- river.Length: the length of the river. +-- river.SourceLongitude: the longitude of its source. +-- river.SourceLatitude: the latitude of its source. +-- river.Mountains: the mountains where its source is located. +-- river.SourceAltitude: the elevation (above sea level) of its source. +-- river.EstuaryLongitude: the coordinates of its estuary. +-- river.EstuaryLatitude: the latitude of its estuary. +CREATE TABLE "river" +( + Name TEXT default '' not null + primary key, + River TEXT, + Lake TEXT, + Sea TEXT, + Length REAL, + SourceLongitude REAL, + SourceLatitude REAL, + Mountains TEXT, + SourceAltitude REAL, + EstuaryLongitude REAL, + EstuaryLatitude REAL, + FOREIGN KEY ("Lake") REFERENCES "lake" ("Name") ON UPDATE CASCADE ON DELETE CASCADE +); +-- sea.Name: the name of the sea. +-- sea.Depth: the maximal depth of the sea. +CREATE TABLE "sea" +( + Name TEXT default '' not null + primary key, + Depth REAL +); +-- target.Country: No description. +-- target.Target: No description. +CREATE TABLE "target" +( + Country TEXT not null + primary key, + Target TEXT, + FOREIGN KEY ("Country") REFERENCES "country" ("Code") ON UPDATE CASCADE ON DELETE CASCADE +); diff --git a/schemas/movie.sql b/schemas/movie.sql new file mode 100644 index 0000000000000000000000000000000000000000..d8cc008d736aa138fc69ab0fe0e14927667cd8b0 --- /dev/null +++ b/schemas/movie.sql @@ -0,0 +1,70 @@ +-- actor.ActorID: actor id. the unique id for the actor. +-- actor.Name: actor's name. +-- actor.Date of Birth: date of birth. actor's birth date. +-- actor.Birth City: birth city. actor's birth city. +-- actor.Birth Country: birth country. actor's birth country. +-- actor.Height (Inches): height inches. actor's height. the unit is inch. +-- actor.Biography: actor's biography. +-- actor.Gender: actor's gender. +-- actor.Ethnicity: actor's ethnicity. +-- actor.NetWorth: actor's networth. The actor with more networth is richer. +CREATE TABLE actor +( + ActorID INTEGER + constraint actor_pk + primary key, + Name TEXT, + "Date of Birth" DATE, + "Birth City" TEXT, + "Birth Country" TEXT, + "Height (Inches)" INTEGER, + Biography TEXT, + Gender TEXT, + Ethnicity TEXT, + NetWorth TEXT +); +-- characters.MovieID: movie id. the unique id for the movie. +-- characters.ActorID: actor id. the unique id for the actor. +-- characters.Character Name: character name. the name of the character. +-- characters.creditOrder: credit order. order of the character in the credit list. +-- characters.pay: the salary of the character. +-- characters.screentime: the screentime of the character. Screentime is directly proportional to the importance of the characters. +CREATE TABLE characters +( + MovieID INTEGER, + ActorID INTEGER, + "Character Name" TEXT, + creditOrder INTEGER, + pay TEXT, + screentime TEXT, + primary key (MovieID, ActorID), + FOREIGN KEY ("MovieID") REFERENCES "movie" ("MovieID"), + FOREIGN KEY ("ActorID") REFERENCES "actor" ("ActorID") +); +-- movie.MovieID: movie id. the unique id for the movie. +-- movie.Title: the title of the movie. +-- movie.MPAA Rating: motion picture association of america rating. MPAA rating of the movie. MPAA rating is the movie rating for parents to use as a guide to determine the appropriateness of a film's content for children and teenagers. • rated G: General audiences – All ages admitted. • rated PG: Parental guidance suggested – Some material may not be suitable for pre-teenagers. • rated R: Restricted – Under 17 requires accompanying parent or adult guardian. • rated X: No one under 17 admitted. +-- movie.Budget: the budget of the movie. the unit is dollar. +-- movie.Gross: the gross of the movie. +-- movie.Release Date: release date. yyyy-mm-dd. +-- movie.Genre: the genre of the movie. +-- movie.Runtime: the runtime of the movie. +-- movie.Rating: the rating of the movie. 0.0 - 10.0. Higher ratings mean higher quality and better response. +-- movie.Rating Count: rating count. the number of the ratings. +-- movie.Summary: the summary of the movie. +CREATE TABLE movie +( + MovieID INTEGER + constraint movie_pk + primary key, + Title TEXT, + "MPAA Rating" TEXT, + Budget INTEGER, + Gross INTEGER, + "Release Date" TEXT, + Genre TEXT, + Runtime INTEGER, + Rating REAL, + "Rating Count" INTEGER, + Summary TEXT +); diff --git a/schemas/movie_3.sql b/schemas/movie_3.sql new file mode 100644 index 0000000000000000000000000000000000000000..272b872e2c9ea6e7a43836269c101f2894d65a2f --- /dev/null +++ b/schemas/movie_3.sql @@ -0,0 +1,266 @@ +-- actor.actor_id: actor id. unique id number identifying the actor. +-- actor.first_name: first name. First name of the actor. +-- actor.last_name: last name. Last name of the actor. +-- actor.last_update: last update. The time of the latest update. +CREATE TABLE "actor" +( + actor_id INTEGER + primary key autoincrement, + first_name TEXT not null, + last_name TEXT not null, + last_update DATETIME default CURRENT_TIMESTAMP not null +); +-- address.address_id: address id. unique id number identifying the address. +-- address.address: The first address line. +-- address.address2: address 2. the second address line. address2 is the additional address if any. +-- address.district: No description. +-- address.city_id: No description. +-- address.postal_code: postal code. a postal code is a series of letters or digits or both, sometimes including spaces or punctuation, included in a postal address for the purpose of sorting mail. +-- address.phone: phone number. +-- address.last_update: last update. The time of the latest update. +CREATE TABLE "address" +( + address_id INTEGER + primary key autoincrement, + address TEXT not null, + address2 TEXT, + district TEXT not null, + city_id INTEGER not null, + postal_code TEXT, + phone TEXT not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + FOREIGN KEY ("city_id") REFERENCES "city" ("city_id") ON UPDATE CASCADE +); +-- category.category_id: category id. unique id number identifying the category. +-- category.name: name of the category. +-- category.last_update: last update. The time of the latest update. +CREATE TABLE "category" +( + category_id INTEGER + primary key autoincrement, + name TEXT not null, + last_update DATETIME default CURRENT_TIMESTAMP not null +); +-- city.city_id: city id. unique id number identifying the city. +-- city.city: name of the city. +-- city.country_id: country id. number identifying the country which the city belongs to. +-- city.last_update: last update. The time of the latest update. +CREATE TABLE "city" +( + city_id INTEGER + primary key autoincrement, + city TEXT not null, + country_id INTEGER not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + FOREIGN KEY ("country_id") REFERENCES "country" ("country_id") ON UPDATE CASCADE +); +-- country.country_id: country id. unique id number identifying the country. +-- country.country: the name of the country. number identifying the country. • Africa: (Algeria, Angola, Cameroon, Chad, Congo, The Democratic Republic of the, Egypt, Ethiopia, Gambia...). • Asia: (Afghanistan, Armenia, Azerbaijan,. Bahrain, Bangladesh, Brunei, Cambodia, China, Hong Kong, India, Indonesia, Iran, Iraq, Israel...). • Oceania (American Samoa, Australia, French Polynesia...). • North America (Anguilla, Canada, Dominican Republic, Ecuador, Greenland...). • South America (Argentina, Bolivia, Brazil, Chile,. Colombia, Ecuador, French Guiana....). • Europe (Austria, Belarus, Bulgaria, Czech Republic, Estonia, Faroe Islands, Finland, France, Germany, Greece, Holy See (Vatican City State), Hungary, Italy...). details: https://worldpopulationreview.com/country-rankings/list-of-countries-by-continent. question can mention i.e., Europe instead of Austria, etc. +-- country.last_update: last update. The time of the latest update. +CREATE TABLE "country" +( + country_id INTEGER + primary key autoincrement, + country TEXT not null, + last_update DATETIME default CURRENT_TIMESTAMP not null +); +-- customer.customer_id: country id. unique id number identifying the country. +-- customer.store_id: store id. unique id number identifying the store. +-- customer.first_name: first name. First name of the customer. +-- customer.last_name: last name. Last name of the customer. +-- customer.email: Email address of the customer. +-- customer.address_id: address id. Address id number of the customer. +-- customer.active: Wether the customer is active or not. 1: active. 0: not active. +-- customer.create_date: create date. The date when the record is created. +-- customer.last_update: last update. The time of the latest update. +CREATE TABLE "customer" +( + customer_id INTEGER + primary key autoincrement, + store_id INTEGER not null, + first_name TEXT not null, + last_name TEXT not null, + email TEXT, + address_id INTEGER not null, + active INTEGER default 1 not null, + create_date DATETIME not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + FOREIGN KEY ("address_id") REFERENCES "address" ("address_id") ON UPDATE CASCADE, + FOREIGN KEY ("store_id") REFERENCES "store" ("store_id") ON UPDATE CASCADE +); +-- film.film_id: film id. unique id number identifying the film. +-- film.title: title of the film. +-- film.description: main content of the film. +-- film.release_year: release year. the year when the film is released. +-- film.language_id: language id. the language id of the film. +-- film.original_language_id: original language id. the original language id of the film. +-- film.rental_duration: rental duration. how long this film can be rent at once. days. price / day = rental_rate / retal_duration. +-- film.rental_rate: rental rate. the rate of renting this film. higher -> expensive. +-- film.length: Duration time of the film screening. minutes. +-- film.replacement_cost: replacement cost. cost of replacing this film. +-- film.rating: The Motion Picture Association film rating. G ?General Audiences. PG ? Parental Guidance Suggested. PG-13 ? Parents Strongly Cautioned. R ? Restricted. NC-17 ? Adults Only. +-- film.special_features: special features. features of this film. +-- film.last_update: last update. The time of the latest update. +CREATE TABLE "film" +( + film_id INTEGER + primary key autoincrement, + title TEXT not null, + description TEXT, + release_year TEXT, + language_id INTEGER not null, + original_language_id INTEGER, + rental_duration INTEGER default 3 not null, + rental_rate REAL default 4.99 not null, + length INTEGER, + replacement_cost REAL default 19.99 not null, + rating TEXT default 'G', + special_features TEXT, + last_update DATETIME default CURRENT_TIMESTAMP not null, + FOREIGN KEY ("original_language_id") REFERENCES "language" ("language_id") ON UPDATE CASCADE, + FOREIGN KEY ("language_id") REFERENCES "language" ("language_id") ON UPDATE CASCADE +); +-- film_actor.actor_id: actor id. unique id number identifying the actor. +-- film_actor.film_id: film id. id number identifying the film. +-- film_actor.last_update: last update. The time of the latest update. +CREATE TABLE "film_actor" +( + actor_id INTEGER not null, + film_id INTEGER not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + primary key (actor_id, film_id), + FOREIGN KEY ("film_id") REFERENCES "film" ("film_id") ON UPDATE CASCADE, + FOREIGN KEY ("actor_id") REFERENCES "actor" ("actor_id") ON UPDATE CASCADE +); +-- film_category.film_id: film id. unique id number identifying the film. +-- film_category.category_id: category id. id number identifying the category. +-- film_category.last_update: last update. The time of the latest update. +CREATE TABLE "film_category" +( + film_id INTEGER not null, + category_id INTEGER not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + primary key (film_id, category_id), + FOREIGN KEY ("category_id") REFERENCES "category" ("category_id") ON UPDATE CASCADE, + FOREIGN KEY ("film_id") REFERENCES "film" ("film_id") ON UPDATE CASCADE +); +-- film_text.film_id: film id. unique id number identifying the film. +-- film_text.title: title of the film. +-- film_text.description: main content of the film. +CREATE TABLE film_text +( + film_id INTEGER not null + primary key, + title TEXT not null, + description TEXT null +); +-- inventory.inventory_id: inventory id. unique id number identifying the inventory. +-- inventory.film_id: film id. unique id number identifying the film. +-- inventory.store_id: store id. id of the store. +-- inventory.last_update: last update. the last update time of the film. +CREATE TABLE "inventory" +( + inventory_id INTEGER + primary key autoincrement, + film_id INTEGER not null, + store_id INTEGER not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + FOREIGN KEY ("store_id") REFERENCES "store" ("store_id") ON UPDATE CASCADE, + FOREIGN KEY ("film_id") REFERENCES "film" ("film_id") ON UPDATE CASCADE +); +-- language.language_id: language id. unique id number identifying the language. +-- language.name: name of the language. +-- language.last_update: last update. The time of the latest update. +CREATE TABLE "language" +( + language_id INTEGER + primary key autoincrement, + name TEXT not null, + last_update DATETIME default CURRENT_TIMESTAMP not null +); +-- payment.payment_id: payment id. unique id number identifying the payment. +-- payment.customer_id: customer id. unique id number identifying the customer. +-- payment.staff_id: staff id. unique id number identifying the staff. +-- payment.rental_id: rental id. unique id number identifying the rental. +-- payment.amount: unique id number identifying the amount. +-- payment.payment_date: payment date. the date when the payment ocurs. +-- payment.last_update: last update. The time of the latest update. +CREATE TABLE "payment" +( + payment_id INTEGER + primary key autoincrement, + customer_id INTEGER not null, + staff_id INTEGER not null, + rental_id INTEGER, + amount REAL not null, + payment_date DATETIME not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + FOREIGN KEY ("rental_id") REFERENCES "rental" ("rental_id") ON UPDATE CASCADE ON DELETE SET NULL, + FOREIGN KEY ("staff_id") REFERENCES "staff" ("staff_id") ON UPDATE CASCADE, + FOREIGN KEY ("customer_id") REFERENCES "customer" ("customer_id") ON UPDATE CASCADE +); +-- rental.rental_id: rental id. unique id number identifying the rental. +-- rental.rental_date: rental date. date when the rental occurs. +-- rental.inventory_id: inventory id. id number identifying the inventory. +-- rental.customer_id: customer id. id number identifying the customer. +-- rental.return_date: return date. date when the rental returns. +-- rental.staff_id: staff id. id number identifying the staff. +-- rental.last_update: last update. The time of the latest update. +CREATE TABLE "rental" +( + rental_id INTEGER + primary key autoincrement, + rental_date DATETIME not null, + inventory_id INTEGER not null, + customer_id INTEGER not null, + return_date DATETIME, + staff_id INTEGER not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + unique (rental_date, inventory_id, customer_id), + FOREIGN KEY ("staff_id") REFERENCES "staff" ("staff_id") ON UPDATE CASCADE, + FOREIGN KEY ("customer_id") REFERENCES "customer" ("customer_id") ON UPDATE CASCADE, + FOREIGN KEY ("inventory_id") REFERENCES "inventory" ("inventory_id") ON UPDATE CASCADE +); +-- staff.staff_id: staff id. unique id number identifying the staff. +-- staff.first_name: first name. First name of the actor. +-- staff.last_name: last name. Last name of the actor. full name = (first name, last name). +-- staff.address_id: address id. id number identifying the address. +-- staff.picture: picture of the staff. +-- staff.email: email of the staff. +-- staff.store_id: store id. id number identifying the store. +-- staff.active: Whether the staff is active or not. 1: active. 0: not active. +-- staff.username: username to login the staff. +-- staff.password: password to login the staff. +-- staff.last_update: last update. The time of the latest update. +CREATE TABLE "staff" +( + staff_id INTEGER + primary key autoincrement, + first_name TEXT not null, + last_name TEXT not null, + address_id INTEGER not null, + picture BLOB, + email TEXT, + store_id INTEGER not null, + active INTEGER default 1 not null, + username TEXT not null, + password TEXT, + last_update DATETIME default CURRENT_TIMESTAMP not null, + FOREIGN KEY ("store_id") REFERENCES "store" ("store_id") ON UPDATE CASCADE, + FOREIGN KEY ("address_id") REFERENCES "address" ("address_id") ON UPDATE CASCADE +); +-- store.store_id: store id. unique id number identifying the store. +-- store.manager_staff_id: manager staff id. id number identifying the manager staff. +-- store.address_id: address id. id number identifying the address. +-- store.last_update: last update. The time of the latest update. +CREATE TABLE "store" +( + store_id INTEGER + primary key autoincrement, + manager_staff_id INTEGER not null + unique, + address_id INTEGER not null, + last_update DATETIME default CURRENT_TIMESTAMP not null, + FOREIGN KEY ("address_id") REFERENCES "address" ("address_id") ON UPDATE CASCADE, + FOREIGN KEY ("manager_staff_id") REFERENCES "staff" ("staff_id") ON UPDATE CASCADE +); diff --git a/schemas/movie_platform.sql b/schemas/movie_platform.sql new file mode 100644 index 0000000000000000000000000000000000000000..daaf6976c3f02fe8602eebdc092e9f82e7109edf --- /dev/null +++ b/schemas/movie_platform.sql @@ -0,0 +1,136 @@ +-- lists.user_id: ID related to the user who created the list. +-- lists.list_id: ID of the list on Mubi. +-- lists.list_title: Name of the list. +-- lists.list_movie_number: Number of movies added to the list. +-- lists.list_update_timestamp_utc: Last update timestamp for the list. +-- lists.list_creation_timestamp_utc: Creation timestamp for the list. +-- lists.list_followers: Number of followers on the list. +-- lists.list_url: URL to the list page on Mubi. +-- lists.list_comments: Number of comments on the list. +-- lists.list_description: List description made by the user. +-- lists.list_cover_image_url: No description. +-- lists.list_first_image_url: No description. +-- lists.list_second_image_url: No description. +-- lists.list_third_image_url: No description. +-- Relationship: lists(user_id) to lists_users(user_id). The declared relationship requires a matching parent, but its key is not unique at the parent table grain. Validate existence without imposing uniqueness. +CREATE TABLE "lists" +( + user_id INTEGER, + list_id INTEGER not null + primary key, + list_title TEXT, + list_movie_number INTEGER, + list_update_timestamp_utc TEXT, + list_creation_timestamp_utc TEXT, + list_followers INTEGER, + list_url TEXT, + list_comments INTEGER, + list_description TEXT, + list_cover_image_url TEXT, + list_first_image_url TEXT, + list_second_image_url TEXT, + list_third_image_url TEXT +); +-- lists_users.user_id: ID related to the user who created the list. +-- lists_users.list_id: ID of the list on Mubi. +-- lists_users.list_update_date_utc: Last update date for the list. YYYY-MM-DD. +-- lists_users.list_creation_date_utc: Creation date for the list. YYYY-MM-DD. +-- lists_users.user_trialist: whether the user was a tralist when he created the list. 1 = the user was a trialist when he created the list. 0 = the user was not a trialist when he created the list. +-- lists_users.user_subscriber: whether the user was a subscriber when he created the list. 1 = the user was a subscriber when he created the list. 0 = the user was not a subscriber when he created the list. +-- lists_users.user_avatar_image_url: User profile image URL on Mubi. +-- lists_users.user_cover_image_url: User profile cover image URL on Mubi. +-- lists_users.user_eligible_for_trial: whether the user was eligible for trial when he created the list. 1 = the user was eligible for trial when he created the list. 0 = the user was not eligible for trial when he created the list. +-- lists_users.user_has_payment_method: whether the user was a paying subscriber when he created the list. 1 = the user was a paying subscriber when he created the list. 0 = the user was not a paying subscriber when he created the list. +-- Relationship: lists_users(user_id) to lists(user_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +-- Relationship: lists_users(list_id) to lists(list_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE lists_users +( + user_id INTEGER not null, + list_id INTEGER not null, + list_update_date_utc TEXT, + list_creation_date_utc TEXT, + user_trialist INTEGER, + user_subscriber INTEGER, + user_avatar_image_url TEXT, + user_cover_image_url TEXT, + user_eligible_for_trial TEXT, + user_has_payment_method TEXT, + primary key (user_id, list_id) +); +-- movies.movie_id: ID related to the movie on Mubi. +-- movies.movie_title: Name of the movie. +-- movies.movie_release_year: Release year of the movie. +-- movies.movie_url: URL to the movie page on Mubi. +-- movies.movie_title_language: By default, the title is in English. Only contains one value which is 'en'. +-- movies.movie_popularity: Number of Mubi users who love this movie. +-- movies.movie_image_url: Image URL to the movie on Mubi. +-- movies.director_id: ID related to the movie director on Mubi. +-- movies.director_name: Full Name of the movie director. +-- movies.director_url: URL to the movie director page on Mubi. +CREATE TABLE "movies" +( + movie_id INTEGER not null + primary key, + movie_title TEXT, + movie_release_year INTEGER, + movie_url TEXT, + movie_title_language TEXT, + movie_popularity INTEGER, + movie_image_url TEXT, + director_id TEXT, + director_name TEXT, + director_url TEXT +); +-- ratings.movie_id: Movie ID related to the rating. +-- ratings.rating_id: Rating ID on Mubi. +-- ratings.rating_url: URL to the rating on Mubi. +-- ratings.rating_score: Rating score ranging from 1 (lowest) to 5 (highest). The score is proportional to the user's liking. The higher the score is, the more the user likes the movie. +-- ratings.rating_timestamp_utc: Timestamp for the movie rating made by the user on Mubi. +-- ratings.critic: Critic made by the user rating the movie. If value = "None", the user did not write a critic when rating the movie. +-- ratings.critic_likes: Number of likes related to the critic made by the user rating the movie. +-- ratings.critic_comments: Number of comments related to the critic made by the user rating the movie. +-- ratings.user_id: ID related to the user rating the movie. +-- ratings.user_trialist: whether user was a tralist when he rated the movie. 1 = the user was a trialist when he rated the movie. 0 = the user was not a trialist when he rated the movie. +-- ratings.user_subscriber: No description. +-- ratings.user_eligible_for_trial: No description. +-- ratings.user_has_payment_method: No description. +-- Relationship: ratings(user_id) to ratings_users(user_id). The declared relationship requires a matching parent, but its key is not unique at the parent table grain. Validate existence without imposing uniqueness. +-- Relationship: ratings(rating_id) to ratings(rating_id). A same-row self-reference asserts no relationship beyond the value already present; it cannot justify imposing rating-ID uniqueness. +-- Relationship: ratings(user_id) to lists_users(user_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +-- Relationship: ratings(movie_id) to movies(movie_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE ratings +( + movie_id INTEGER, + rating_id INTEGER, + rating_url TEXT, + rating_score INTEGER, + rating_timestamp_utc TEXT, + critic TEXT, + critic_likes INTEGER, + critic_comments INTEGER, + user_id INTEGER, + user_trialist INTEGER, + user_subscriber INTEGER, + user_eligible_for_trial INTEGER, + user_has_payment_method INTEGER +); +-- ratings_users.user_id: ID related to the user rating the movie. +-- ratings_users.rating_date_utc: Rating date for the movie rating. YYYY-MM-DD. +-- ratings_users.user_trialist: whether the user was a trialist when he rated the movie. 1 = the user was a trialist when he rated the movie. 0 = the user was not a trialist when he rated the movie. +-- ratings_users.user_subscriber: whether the user was a subscriber when he rated the movie. 1 = the user was a subscriber when he rated the movie. 0 = the user was not a subscriber when he rated the movie. +-- ratings_users.user_avatar_image_url: URL to the user profile image on Mubi. +-- ratings_users.user_cover_image_url: URL to the user profile cover image on Mubi. +-- ratings_users.user_eligible_for_trial: whether the user was eligible for trial when he rated the movie. 1 = the user was eligible for trial when he rated the movie. 0 = the user was not eligible for trial when he rated the movie. +-- ratings_users.user_has_payment_method: whether the user was a paying subscriber when he rated the movie. 1 = the user was a paying subscriber when he rated the movie. 0 = the user was not a paying subscriber when he rated. +-- Relationship: ratings_users(user_id) to lists_users(user_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE "ratings_users" +( + user_id INTEGER, + rating_date_utc TEXT, + user_trialist INTEGER, + user_subscriber INTEGER, + user_avatar_image_url TEXT, + user_cover_image_url TEXT, + user_eligible_for_trial INTEGER, + user_has_payment_method INTEGER +); diff --git a/schemas/movielens.sql b/schemas/movielens.sql new file mode 100644 index 0000000000000000000000000000000000000000..68281a01629fdb5d58715c7e7e691ade9404dda6 --- /dev/null +++ b/schemas/movielens.sql @@ -0,0 +1,86 @@ +-- actors.actorid: actor id. unique identificator number of actors. +-- actors.a_gender: actor gender. M: male; F: female. +-- actors.a_quality: actor quality. higher is better, lower is the worse. +CREATE TABLE "actors" +( + actorid INTEGER not null + primary key, + a_gender TEXT not null, + a_quality INTEGER not null +); +-- directors.directorid: director id. unique identification number of actors directors. +-- directors.d_quality: director quality. higher value is better, lower is the worse. +-- directors.avg_revenue: average revenue. higher value is the higher, lower is the lower. +CREATE TABLE "directors" +( + directorid INTEGER not null + primary key, + d_quality INTEGER not null, + avg_revenue INTEGER not null +); +-- movies.movieid: movie id. unique identifier number of movies. +-- movies.year: 4: newest; 1: oldest. higher value means newer published date. +-- movies.isEnglish: is English. +-- movies.country: country. +-- movies.runningtime: No description. +CREATE TABLE "movies" +( + movieid INTEGER default 0 not null + primary key, + year INTEGER not null, + isEnglish TEXT not null, + country TEXT not null, + runningtime INTEGER not null +); +-- movies2actors.movieid: movie id. identifier number of movies. +-- movies2actors.actorid: actor id. identifier number of actors. +-- movies2actors.cast_num: cast number. +CREATE TABLE "movies2actors" +( + movieid INTEGER not null, + actorid INTEGER not null, + cast_num INTEGER not null, + primary key (movieid, actorid), + FOREIGN KEY ("actorid") REFERENCES "actors" ("actorid") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("movieid") REFERENCES "movies" ("movieid") ON UPDATE CASCADE ON DELETE CASCADE +); +-- movies2directors.movieid: movie id. identifier number of movies. +-- movies2directors.directorid: director id. identifier number of directors. +-- movies2directors.genre: genre of movies. +CREATE TABLE "movies2directors" +( + movieid INTEGER not null, + directorid INTEGER not null, + genre TEXT not null, + primary key (movieid, directorid), + FOREIGN KEY ("directorid") REFERENCES "directors" ("directorid") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("movieid") REFERENCES "movies" ("movieid") ON UPDATE CASCADE ON DELETE CASCADE +); +-- u2base.userid: user id. identifier number of users. +-- u2base.movieid: movie id. identifier number of movie. +-- u2base.rating: ratings of movies. higher value refers to higher satisfactory, each value is the rating of movies left by users. +CREATE TABLE "u2base" +( + userid INTEGER default 0 not null, + movieid INTEGER not null, + rating TEXT not null, + primary key (userid, movieid), + FOREIGN KEY ("movieid") REFERENCES "movies" ("movieid") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("userid") REFERENCES "users" ("userid") ON UPDATE CASCADE ON DELETE CASCADE +); +-- users.userid: user id. unique identifier number of users. +-- users.age: 1: 1-18 years old; 18: 18-25 years old; 25: 25-35 years old; 35: 35-45 years old; 45: 45-50 years old; 50: 50-56 years old; 56: over 56 years old. +-- users.u_gender: user gender. M / F: Male / Female. +-- users.occupation: occupation. +CREATE TABLE users +( + userid INTEGER default 0 not null + primary key, + age TEXT not null, + u_gender TEXT not null, + occupation TEXT not null +); +CREATE INDEX avg_revenue + on directors (avg_revenue); +CREATE INDEX d_quality + on directors (d_quality); diff --git a/schemas/movies_4.sql b/schemas/movies_4.sql new file mode 100644 index 0000000000000000000000000000000000000000..a53f2c8a635a80a7ec2a66a3020893da8d93cea5 --- /dev/null +++ b/schemas/movies_4.sql @@ -0,0 +1,184 @@ +-- country.country_id: country id. the unique identifier of the country. +-- country.country_iso_code: country iso code. the ISO code. ISO codes are typically used to identify countries and their subdivisions, and there are different types of ISO codes depending on the specific application. Here we use ISO 3166 code to identify countries. +-- country.country_name: country name. the name of the country. +CREATE TABLE country +( + country_id INTEGER not null + primary key, + country_iso_code TEXT default NULL, + country_name TEXT default NULL +); +-- department.department_id: department id. the unique identifier of the department. +-- department.department_name: department name. the name of the department. +CREATE TABLE department +( + department_id INTEGER not null + primary key, + department_name TEXT default NULL +); +-- gender.gender_id: gender id. the unique identifier of the gender. +-- gender.gender: the gender. female/ male/ unspecified. +CREATE TABLE gender +( + gender_id INTEGER not null + primary key, + gender TEXT default NULL +); +-- genre.genre_id: genre id. the unique identifier of the genre. +-- genre.genre_name: the genre. +CREATE TABLE genre +( + genre_id INTEGER not null + primary key, + genre_name TEXT default NULL +); +-- keyword.keyword_id: keyword id. the unique identifier of the keyword. +-- keyword.keyword_name: keyword name. the keyword. +CREATE TABLE keyword +( + keyword_id INTEGER not null + primary key, + keyword_name TEXT default NULL +); +-- language.language_id: language id. the unique identifier of the language. +-- language.language_code: language code. the code of the language. Here we use ISO 639 codes to identify the language. +-- language.language_name: language name. the language name. +CREATE TABLE language +( + language_id INTEGER not null + primary key, + language_code TEXT default NULL, + language_name TEXT default NULL +); +-- language_role.role_id: role id. the unique identifier of the language id. +-- language_role.language_role: language role. the language role. In the context of language roles in a movie or other audio-visual production, "original" and "spoken" refer to the languages in which the movie was originally produced, and the languages spoken by the characters in the movie, respectively. +CREATE TABLE language_role +( + role_id INTEGER not null + primary key, + language_role TEXT default NULL +); +-- movie.movie_id: movie id. the unique identifier of the movie. +-- movie.title: the title of the movie. +-- movie.budget: the budget for the movie. If a movie has higher popularity, it means that it is well-liked by a large number of people. This can be determined by looking at the movie's ratings and reviews, as well as the box office performance and overall buzz surrounding the film. Higher popularity often translates to more success for the movie, both financially and critically. +-- movie.homepage: the homepage of the movie. +-- movie.overview: the overview of the movie. +-- movie.popularity: the popularity of the movie. If a movie has higher popularity, it means that it is well-liked by a large number of people. This can be determined by looking at the movie's ratings and reviews, as well as the box office performance and overall buzz surrounding the film. Higher popularity often translates to more success for the movie, both financially and critically. +-- movie.release_date: release date. the release date of the movie. +-- movie.revenue: the revenue of the movie. A higher vote average indicates that a greater proportion of people who have seen the movie have given it positive ratings. +-- movie.runtime: the runtime of the movie. +-- movie.movie_status: the status of the movie. The only value of this column is 'Released'. +-- movie.tagline: the tagline of the movie. +-- movie.vote_average: vote average. the average vote for the movie. A higher vote average indicates that a greater proportion of people who have seen the movie have given it positive ratings. +-- movie.vote_count: vote count. the vote count for the movie. If a movie has a higher vote average and vote count, it means that it has been well-received by audiences and critics. A higher vote count means that more people have rated the movie, which can indicate a greater level of interest in the film. +CREATE TABLE movie +( + movie_id INTEGER not null + primary key, + title TEXT default NULL, + budget INTEGER default NULL, + homepage TEXT default NULL, + overview TEXT default NULL, + popularity REAL default NULL, + release_date DATE default NULL, + revenue INTEGER default NULL, + runtime INTEGER default NULL, + movie_status TEXT default NULL, + tagline TEXT default NULL, + vote_average REAL default NULL, + vote_count INTEGER default NULL +); +-- movie_cast.movie_id: movie id. the id of the movie. Maps to movie(movie_id). +-- movie_cast.person_id: person id. the id of the person. Maps to person(person_id). +-- movie_cast.character_name: character name. the character name. +-- movie_cast.gender_id: gender id. the id of the cast's gender. Maps to gender(gender_id). +-- movie_cast.cast_order: cast order. the cast order of the cast. The cast order of a movie or television show refers to the sequence in which the actors and actresses are listed in the credits. This order is typically determined by the relative importance of each actor's role in the production, with the main actors and actresses appearing first, followed by the supporting cast and extras. +-- Relationship: movie_cast(person_id) to person(person_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +-- Relationship: movie_cast(movie_id) to movie(movie_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE movie_cast +( + movie_id INTEGER default NULL, + person_id INTEGER default NULL, + character_name TEXT default NULL, + gender_id INTEGER default NULL, + cast_order INTEGER default NULL, + FOREIGN KEY ("gender_id") REFERENCES "gender" ("gender_id") +); +-- movie_company.movie_id: movie id. the id of the movie. Maps to movie(movie_id). +-- movie_company.company_id: company id. the id of the company that produced the movie. Maps to production_company(company_id). If movies with different movie_id have the same company_id, it means these movies were made by the same company. +-- Relationship: movie_company(movie_id) to movie(movie_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE "movie_company" +( + movie_id INTEGER default NULL, + company_id INTEGER default NULL, + FOREIGN KEY ("company_id") REFERENCES "production_company" ("company_id") +); +-- movie_crew.movie_id: movie id. the id of the movie that the crew worked for. Maps to movie(movie_id). +-- movie_crew.person_id: person id. the id of the crew. Maps to person(person_id). +-- movie_crew.department_id: department id. the id of the crew's department. Maps to department(department_id). +-- movie_crew.job: the job of the crew. A movie may involve several crews with the same job title. +-- Relationship: movie_crew(person_id) to person(person_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +-- Relationship: movie_crew(movie_id) to movie(movie_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE movie_crew +( + movie_id INTEGER default NULL, + person_id INTEGER default NULL, + department_id INTEGER default NULL, + job TEXT default NULL, + FOREIGN KEY ("department_id") REFERENCES "department" ("department_id") +); +-- movie_genres.movie_id: movie id. the id of the movie. Maps to movie(movie_id). +-- movie_genres.genre_id: genre id. the id of the movie genre. Maps to genre(genre_id). +-- Relationship: movie_genres(movie_id) to movie(movie_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE movie_genres +( + movie_id INTEGER default NULL, + genre_id INTEGER default NULL, + FOREIGN KEY ("genre_id") REFERENCES "genre" ("genre_id") +); +-- movie_keywords.movie_id: movie id. the id of the movie. Maps to movie(movie_id). +-- movie_keywords.keyword_id: keyword id. the id of the movie keyword. Maps to keyword(keyword_id). A movie may have many keywords. Audience could get the genre of the movie according to the movie keywords. +-- Relationship: movie_keywords(movie_id) to movie(movie_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE "movie_keywords" +( + movie_id INTEGER default NULL, + keyword_id INTEGER default NULL, + FOREIGN KEY ("keyword_id") REFERENCES "keyword" ("keyword_id") +); +-- movie_languages.movie_id: movie id. the id of the movie. Maps to movie(movie_id). +-- movie_languages.language_id: language id. the id of the movie language. Maps to language(language_id). +-- movie_languages.language_role_id: language role id. the id of the role's language. +-- Relationship: movie_languages(movie_id) to movie(movie_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE movie_languages +( + movie_id INTEGER default NULL, + language_id INTEGER default NULL, + language_role_id INTEGER default NULL, + FOREIGN KEY ("language_role_id") REFERENCES "language_role" ("role_id"), + FOREIGN KEY ("language_id") REFERENCES "language" ("language_id") +); +-- person.person_id: person id. the unique identifier of the person. +-- person.person_name: person name. the name of the person. +CREATE TABLE person +( + person_id INTEGER not null + primary key, + person_name TEXT default NULL +); +-- production_company.company_id: company id. the unique identifier of the company. +-- production_company.company_name: company name. the name of the company. +CREATE TABLE production_company +( + company_id INTEGER not null + primary key, + company_name TEXT default NULL +); +-- production_country.movie_id: mivie id. the unique identifier of the movie. +-- production_country.country_id: country id. the id of the country. +-- Relationship: production_country(movie_id) to movie(movie_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE production_country +( + movie_id INTEGER default NULL, + country_id INTEGER default NULL, + FOREIGN KEY ("country_id") REFERENCES "country" ("country_id") +); diff --git a/schemas/music_platform_2.sql b/schemas/music_platform_2.sql new file mode 100644 index 0000000000000000000000000000000000000000..18a40151d66f7582ff7ec28b67079b9628622591 --- /dev/null +++ b/schemas/music_platform_2.sql @@ -0,0 +1,48 @@ +-- categories.podcast_id: podcast id. The unique id of the podcast. +-- categories.category: category of the podcast. This usually represents the topic of the podcast. +CREATE TABLE "categories" +( + podcast_id TEXT not null, + category TEXT not null, + constraint "PRIMARY" + primary key (podcast_id, category), + FOREIGN KEY ("podcast_id") REFERENCES "podcasts" ("podcast_id") +); +-- podcasts.podcast_id: podcast id. The unique id of the podcast. +-- podcasts.itunes_id: itunes id. The unique id of the itunes. +-- podcasts.slug: The slug of the podcast. It usually has the same name with the "title" column. +-- podcasts.itunes_url: itunes url. The iTunes url of the podcast. Can visit the webpage of the podcast by clicking the itunes_url. +-- podcasts.title: The title of the podcast. It usually has a very similar name to the "slug" column. +CREATE TABLE podcasts ( + podcast_id text primary key, + itunes_id integer not null, + slug text not null, + itunes_url text not null, + title text not null +); +-- reviews.podcast_id: podcast id. The unique id of the podcast. +-- reviews.title: The title of the podcast review. This usually is the abstract of the whole review. +-- reviews.content: The content of the podcast review. This usually is the detailed explanation of the podcast review title. +-- reviews.rating: The rating of the podcast review. Allowed values: 0 to 5. This rating is highly related with "title" and "content". +-- reviews.author_id: author id. The author id of the podcast review. +-- reviews.created_at: created at. The date and time of the podcast review creation. In the format of "Date time". e.g., 2018-05-09T18:14:32-07:00. +-- Relationship: reviews(podcast_id) to podcasts(podcast_id). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE "reviews" +( + podcast_id TEXT not null, + title TEXT not null, + content TEXT not null, + rating INTEGER not null, + author_id TEXT not null, + created_at TEXT not null +); +-- runs.run_at: run at. The date and time of the podcast review creation. +-- runs.max_rowid: max row id. The id of max row of this run. +-- runs.reviews_added: reviews added. The number of reviews added in this run. +CREATE TABLE runs ( + run_at text not null, + max_rowid integer not null, + reviews_added integer not null +); +CREATE INDEX category_podcast_id_idx + on categories (podcast_id); diff --git a/schemas/music_tracker.sql b/schemas/music_tracker.sql new file mode 100644 index 0000000000000000000000000000000000000000..64cb8475ecb2d0437ac4819cc731c4c51dd495fb --- /dev/null +++ b/schemas/music_tracker.sql @@ -0,0 +1,33 @@ +-- tags.index: index. +-- tags.id: release identifier which can be matched with id field in the torrents table. +-- tags.tag: tag. +CREATE TABLE "tags" +( + "index" INTEGER + constraint tags_pk + primary key, + id INTEGER, + tag TEXT, + FOREIGN KEY ("id") REFERENCES "torrents" ("id") +); +-- torrents.groupName: release title. +-- torrents.totalSnatched: number of times the release has been downloaded. +-- torrents.artist: artist / group name. +-- torrents.groupYear: release year. +-- torrents.releaseType: release type (e.g., album, single, mixtape). +-- torrents.groupId: Unique release identifier from What.CD. Used to ensure no releases are duplicates. +-- torrents.id: unique identifier (essentially an index). +CREATE TABLE "torrents" +( + groupName TEXT, + totalSnatched INTEGER, + artist TEXT, + groupYear INTEGER, + releaseType TEXT, + groupId INTEGER, + id INTEGER + constraint torrents_pk + primary key +); +CREATE INDEX ix_tags_index + on tags ("index"); diff --git a/schemas/olympics.sql b/schemas/olympics.sql new file mode 100644 index 0000000000000000000000000000000000000000..a24e86ccdb93109abc5d92d79ea4f3dff8ca6974 --- /dev/null +++ b/schemas/olympics.sql @@ -0,0 +1,115 @@ +-- city.id: the unique identifier of the city. +-- city.city_name: city name. the name of the city. +CREATE TABLE city +( + id INTEGER not null + primary key, + city_name TEXT default NULL +); +-- competitor_event.event_id: event id. the id of the event. Maps to event(id). +-- competitor_event.competitor_id: competitor id. the id of the competitor. Maps to games_competitor(id). The number of competitors who participated in a specific event could be calculated by grouping by event_id. +-- competitor_event.medal_id: medal id. the id of the medal. Maps to medal(id). For a specific event, the competitor whose medal_id = 1 is the champion, the competitor whose medal_id = 2 is the runner-up, and the competitor whose medal_id = 3 got third place. +CREATE TABLE competitor_event +( + event_id INTEGER default NULL, + competitor_id INTEGER default NULL, + medal_id INTEGER default NULL, + FOREIGN KEY ("medal_id") REFERENCES "medal" ("id"), + FOREIGN KEY ("event_id") REFERENCES "event" ("id"), + FOREIGN KEY ("competitor_id") REFERENCES "games_competitor" ("id") +); +-- event.id: the unique identifier of the event. +-- event.sport_id: sport id. the id of the sport. Maps to sport(id). There may be different events for the same sport in Olympics. +-- event.event_name: event name. the name of the event. +CREATE TABLE event +( + id INTEGER not null + primary key, + sport_id INTEGER default NULL, + event_name TEXT default NULL, + FOREIGN KEY ("sport_id") REFERENCES "sport" ("id") +); +-- games.id: the unique identifier of the game. +-- games.games_year: games year. the year of the game. +-- games.games_name: games name. the name of the game. games_name is 'games_year season'. +-- games.season: the season of the game. The Olympics are held every four years and include both summer and winter games. The summer games include a wide range of sports, such as athletics, swimming, and gymnastics, while the winter games feature sports that are played on ice or snow, such as ice hockey, figure skating, and skiing. +CREATE TABLE games +( + id INTEGER not null + primary key, + games_year INTEGER default NULL, + games_name TEXT default NULL, + season TEXT default NULL +); +-- games_city.games_id: games id. the id of the game. Maps to games(id). +-- games_city.city_id: city id. the id of the city that held the game. Maps to city(id). +CREATE TABLE games_city +( + games_id INTEGER default NULL, + city_id INTEGER default NULL, + FOREIGN KEY ("games_id") REFERENCES "games" ("id"), + FOREIGN KEY ("city_id") REFERENCES "city" ("id") +); +-- games_competitor.id: the unique identifier of the record. +-- games_competitor.games_id: games id. the id of the game. Maps to games(id). +-- games_competitor.person_id: person id. the id of the person. Maps to person(id). The times a person participated in the Olympics games could be calculated by grouping by person_id. +-- games_competitor.age: the age of the person when he/she participated in the game. If person A's age was 22 when he participated in game A and his age was 24 when he participated in game B, it means that game A was held two years earlier than game B. +CREATE TABLE games_competitor +( + id INTEGER not null + primary key, + games_id INTEGER default NULL, + person_id INTEGER default NULL, + age INTEGER default NULL, + FOREIGN KEY ("person_id") REFERENCES "person" ("id"), + FOREIGN KEY ("games_id") REFERENCES "games" ("id") +); +-- medal.id: the unique identifier of the metal. +-- medal.medal_name: medal name. the name of the medal. +CREATE TABLE medal +( + id INTEGER not null + primary key, + medal_name TEXT default NULL +); +-- noc_region.id: the unique identifier of the noc region. +-- noc_region.noc: the NOC code of the region. A NOC code is a number used by the International Olympic Committee (IOC) to identify each of the national Olympic committees (NOCs) from around the world. +-- noc_region.region_name: region name. the name of the region. +CREATE TABLE noc_region +( + id INTEGER not null + primary key, + noc TEXT default NULL, + region_name TEXT default NULL +); +-- person.id: the unique identifier of the person. +-- person.full_name: full name. the full name of the person. A person's full name is the complete name that they are known by, which typically includes their first name, middle name (if applicable), and last name. +-- person.gender: the gender of the person. M stands for male and F stands for female. +-- person.height: the height of the person. +-- person.weight: the weight of the person. The unit of height is cm, and the unit of weight is kg. If the height or the weight of the person is 0, it means his/her height or weight is missing. +CREATE TABLE person +( + id INTEGER not null + primary key, + full_name TEXT default NULL, + gender TEXT default NULL, + height INTEGER default NULL, + weight INTEGER default NULL +); +-- person_region.person_id: the id of the person. Maps to person(id). +-- person_region.region_id: the id of the noc region. Maps to noc_region(id). +CREATE TABLE person_region +( + person_id INTEGER default NULL, + region_id INTEGER default NULL, + FOREIGN KEY ("region_id") REFERENCES "noc_region" ("id"), + FOREIGN KEY ("person_id") REFERENCES "person" ("id") +); +-- sport.id: the unique identifier of the sport. +-- sport.sport_name: sport name. the name of the sport. +CREATE TABLE sport +( + id INTEGER not null + primary key, + sport_name TEXT default NULL +); diff --git a/schemas/professional_basketball.sql b/schemas/professional_basketball.sql new file mode 100644 index 0000000000000000000000000000000000000000..4ee643f761b4312ef70e9b121f74bea0ece911a1 --- /dev/null +++ b/schemas/professional_basketball.sql @@ -0,0 +1,397 @@ +-- awards_coaches.id: id of this row of data. +-- awards_coaches.year: which year did the coach receive the honor? +-- awards_coaches.coachID: id number of the coaches. +-- awards_coaches.award: the award names. mainly categories: "NBA" & "ABA". +-- awards_coaches.lgID: league ID. the name of the league. mainly categories: "NBA" & "ABA". +-- awards_coaches.note: special notification. null" refers to that no special things. +-- Relationship: awards_coaches(coachID, year) to coaches(coachID, year). The declared relationship requires a matching parent, but its key is not unique at the parent table grain. Validate existence without imposing uniqueness. +CREATE TABLE "awards_coaches" +( + id INTEGER + primary key autoincrement, + year INTEGER, + coachID TEXT, + award TEXT, + lgID TEXT, + note TEXT +); +-- awards_players.playerID: ID number identifying the unique number of the player. +-- awards_players.award: the name of the award. +-- awards_players.year: the time of this award. +-- awards_players.lgID: league ID. the name of the league. mainly categories: "NBA" & "ABA". +-- awards_players.note: notification. null refers to that no special things. +-- awards_players.pos: position. the position of the player. C: Center. F: Forward. G: Guard. +CREATE TABLE awards_players +( + playerID TEXT not null, + award TEXT not null, + year INTEGER not null, + lgID TEXT null, + note TEXT null, + pos TEXT null, + primary key (playerID, year, award), + FOREIGN KEY ("playerID") REFERENCES "players" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- coaches.coachID: ID number identifying the unique number of the coach. +-- coaches.year: No description. +-- coaches.tmID: team ID. team name. abbreviated name. +-- coaches.lgID: league ID. league name. mainly categories: "NBA" & "ABA". +-- coaches.stint: the period of the time coaching this team. +-- coaches.won: the number of won games. 0: no wins. +-- coaches.lost: the number of lost games. 0: win all the games. +-- coaches.post_wins: post season wins. the number of games won in the post-season (playoffs) games. 0: no wins. If the team's post-season wins and losses are all zero, it implies that the team did not participate in the post-season (playoffs) that year. +-- coaches.post_losses: post season losses. the number of games lost in the post-season (playoffs) games. 0: win all the games. If the team's post-season wins and losses are all zero, it implies that the team did not participate in the post-season (playoffs) that year. +CREATE TABLE coaches +( + coachID TEXT not null, + year INTEGER not null, + tmID TEXT not null, + lgID TEXT null, + stint INTEGER not null, + won INTEGER null, + lost INTEGER null, + post_wins INTEGER null, + post_losses INTEGER null, + primary key (coachID, year, tmID, stint), + FOREIGN KEY ("tmID","year") REFERENCES "teams" ("tmID","year") ON UPDATE CASCADE ON DELETE CASCADE +); +-- draft.id: the unique number to determine one row of the data. +-- draft.draftYear: which year does this draft happens. +-- draft.draftRound: the Round number of this draft. If the value is 0, it means that there is no draft in this year. 1 refers that this player was picked in the first round. +-- draft.draftSelection: league ID. the position that the player was picked. 0:This signifies that it doesn't contain the draft information of this player. 7:this player was selected in the 7th position in this round. draftRound: 1; draftSelection: 7. represents: this player was selected in the round 1, 7th position. +-- draft.draftOverall: draft overall rank. The player's overall draft position for the year. this is the overall draft rank of the player. +-- draft.tmID: team ID. team name. abbreviated name. +-- draft.firstName: the first name of the player. +-- draft.lastName: the last name of the player. +-- draft.suffixName: the suffix name of the player. +-- draft.playerID: ID number identifying the unique number of the player. +-- draft.draftFrom: the university that the drafted players come from. the name of the university. +-- draft.lgID: league ID. the league name. mainly categories: "NBA" & "ABA". +CREATE TABLE draft +( + id INTEGER default 0 not null + primary key, + draftYear INTEGER null, + draftRound INTEGER null, + draftSelection INTEGER null, + draftOverall INTEGER null, + tmID TEXT null, + firstName TEXT null, + lastName TEXT null, + suffixName TEXT null, + playerID TEXT null, + draftFrom TEXT null, + lgID TEXT null, + FOREIGN KEY ("tmID","draftYear") REFERENCES "teams" ("tmID","year") ON UPDATE CASCADE ON DELETE CASCADE +); +-- player_allstar.playerID: ID number identifying the unique number of the player. +-- player_allstar.first_name: the first name of the player. +-- player_allstar.last_name: the last name of the player. +-- player_allstar.season_id: the id number of the season. +-- player_allstar.conference: which conference that players belong to. two categories: west; east. +-- player_allstar.league_id: league ID. the league name. two categories: NBA; ABA. +-- player_allstar.games_played: how many all star games that this player played in this season. mostly it's 1. +-- player_allstar.minutes: minutes of attendance. 18:played in 18 minutes. +-- player_allstar.points: points. 19: get 19 pointsï¼›. null --> doesn't get points. +-- player_allstar.o_rebounds: offense rebounds. empty or null refers to none offense rebounds,. 1: one offense rebound. +-- player_allstar.d_rebounds: defense rebounds. empty or null refers to none defense rebounds,. 1: one defense rebound. +-- player_allstar.rebounds: total rebounds. empty or null refers to none total rebounds,. 3: totally gets 3 rebounds including offence and defense rebounds. commensense evidence:. total rebounds = offense rebounds + defense rebounds. +-- player_allstar.assists: assistants. null or empty refers to none. 2: 2 assistants. +-- player_allstar.steals: steals. null or empty refers to none. 2: 2 steals. +-- player_allstar.blocks: blocks. null or empty refers to none. 2: 2 blocks. +-- player_allstar.turnovers: turnovers. null or empty refers to none. 2: 2 turnovers. +-- player_allstar.personal_fouls: personal fouls. null or empty refers to none. 2: 2 personal fouls. +-- player_allstar.fg_attempted: field goal attempted. null or empty refers to none. 2: 2 field goal attempts. +-- player_allstar.fg_made: field goal made. null or empty refers to none. 2: 2 field goal made. +-- player_allstar.ft_attempted: free throw attempted. null or empty refers to none. 2: 2 free throw attempts. +-- player_allstar.ft_made: free throw made. null or empty refers to none. 2: 2 free throw made. +-- player_allstar.three_attempted: three point attempted. null or empty refers to none. 2: 2 three point attempts. +-- player_allstar.three_made: three point made. null or empty refers to none. 2: 2 three point made. +CREATE TABLE player_allstar +( + playerID TEXT not null, + last_name TEXT null, + first_name TEXT null, + season_id INTEGER not null, + conference TEXT null, + league_id TEXT null, + games_played INTEGER null, + minutes INTEGER null, + points INTEGER null, + o_rebounds INTEGER null, + d_rebounds INTEGER null, + rebounds INTEGER null, + assists INTEGER null, + steals INTEGER null, + blocks INTEGER null, + turnovers INTEGER null, + personal_fouls INTEGER null, + fg_attempted INTEGER null, + fg_made INTEGER null, + ft_attempted INTEGER null, + ft_made INTEGER null, + three_attempted INTEGER null, + three_made INTEGER null, + primary key (playerID, season_id), + FOREIGN KEY ("playerID") REFERENCES "players" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- players.playerID: ID number identifying the unique number of the player. +-- players.useFirst: use first name. not useful. +-- players.firstName: the first name of the player. +-- players.middleName: the middle name of the player. +-- players.lastName: the last name of the player. +-- players.nameGiven: not useful. +-- players.fullGivenName: not useful. +-- players.nameSuffix: the suffix name of the player. +-- players.nameNick: nick name. +-- players.pos: position. the position of the player. C: Center. F: Forward. G: Guard. some player can have two positions simultaneously. +-- players.firstseason: nothing special. +-- players.lastseason: nothing special. +-- players.height: inch. +-- players.weight: lb. null or empty means it doesn't have this information. +-- players.college: college. null or empty means it doesn't have this information. which colledge does this player graduate from. +-- players.collegeOther: the college that transferred from. some players may have the record of transferring from other colleges. +-- players.birthDate: birthdate. +-- players.birthCity: birthcity. null / empty refers to not recorded. +-- players.birthState: birth state. +-- players.birthCountry: birth country. +-- players.highSchool: high school. null / empty refers to not recorded. +-- players.hsCity: high school city. null / empty refers to not recorded. +-- players.hsState: high school state. null / empty refers to not recorded. +-- players.hsCountry: high school country. null / empty refers to not recorded. +-- players.deathDate: deathdate. 0000-00-00 means this player is still alive. within clear date:. 2011-11-10, which means this guy was died on "2011-11-10". +-- players.race: B:black,. W: white. null or empty: nothing. +CREATE TABLE players +( + playerID TEXT not null + primary key, + useFirst TEXT null, + firstName TEXT null, + middleName TEXT null, + lastName TEXT null, + nameGiven TEXT null, + fullGivenName TEXT null, + nameSuffix TEXT null, + nameNick TEXT null, + pos TEXT null, + firstseason INTEGER null, + lastseason INTEGER null, + height REAL null, + weight INTEGER null, + college TEXT null, + collegeOther TEXT null, + birthDate DATE null, + birthCity TEXT null, + birthState TEXT null, + birthCountry TEXT null, + highSchool TEXT null, + hsCity TEXT null, + hsState TEXT null, + hsCountry TEXT null, + deathDate DATE null, + race TEXT null +); +-- players_teams.id: the unique number to identify this record. +-- players_teams.playerID: ID number identifying the unique number of the player. +-- players_teams.year: year. +-- players_teams.stint: the period of the time player spent played for this team. +-- players_teams.tmID: team ID. team name. abbreviated name. +-- players_teams.lgID: No description. +-- players_teams.GP: game presentatons. game presentatons (attendance). min: 0, max: 82. if this number is equal to 82, means full attendance. +-- players_teams.GS: game starting. min: 0, max: 82,. when GP = GS, it means that this player plays as the stating lineup fully. +-- players_teams.minutes: minutes. +-- players_teams.points: points. +-- players_teams.oRebounds: offense rebounds. empty or null refers to none offense rebounds,. 1: one offense rebound. +-- players_teams.dRebounds: defense rebounds. empty or null refers to none defense rebounds,. 1: one defense rebound. +-- players_teams.rebounds: total rebounds. empty or null refers to none total rebounds,. 3: totally gets 3 rebounds including offense and defense rebounds. commensense evidence:. total rebounds = offense rebounds + defense rebounds. +-- players_teams.assists: assistants. null or empty refers to none. 2: 2 assistants. +-- players_teams.steals: steals. null or empty refers to none. 2: 2 steals. +-- players_teams.blocks: blocks. null or empty refers to none. 2: 2 blocks. +-- players_teams.turnovers: turnovers. null or empty refers to none. 2: 2 turnovers. +-- players_teams.PF: personal fouls. null or empty refers to none. 2: 2 personal fouls. +-- players_teams.fgAttempted: field goal attempted. null or empty refers to none. 2: 2 field goal attempts. +-- players_teams.fgMade: field goal made. null or empty refers to none. 2: 2 field goal made. +-- players_teams.ftAttempted: free throw attempted. null or empty refers to none. 2: 2 free throw attempts. +-- players_teams.ftMade: free throw made. null or empty refers to none. 2: 2 free throw made. +-- players_teams.threeAttempted: three point attempted. null or empty refers to none. 2: 2 three point attempts. +-- players_teams.threeMade: three point made. null or empty refers to none. 2: 2 three point made. +-- players_teams.PostGP: post season game presentations. 0: this player doesn't present in the post season (playoffs). +-- players_teams.PostGS: post season game starting. +-- players_teams.PostMinutes: post season minutes. +-- players_teams.PostPoints: post season points. +-- players_teams.PostoRebounds: post season offense rebounds. null or empty refers to none. 1: 1 offense rebounds in the post season. +-- players_teams.PostdRebounds: post season defense rebounds. null or empty refers to none. 1: 1 defense rebounds in the post season. +-- players_teams.PostRebounds: post season defense rebounds. null or empty refers to none. 3: 3 rebounds in the post season totally. +-- players_teams.PostAssists: post season assistants. null or empty refers to none. 1: 1 assistance in the post season. +-- players_teams.PostSteals: post season steals. null or empty refers to none. 1: 1 offense steals in the post season. +-- players_teams.PostBlocks: post season blocks. null or empty refers to none. 1: 1 block in the post season. +-- players_teams.PostTurnovers: post season turnovers. null or empty refers to none. 1: 1 turnover in the post season. +-- players_teams.PostPF: post season personal fouls. null or empty refers to none. 1: 2 personal fouls in the post season. +-- players_teams.PostfgAttempted: post season field goal attempted. null or empty refers to none. 1: 1 field goal attempts in the post season. +-- players_teams.PostfgMade: post season field goal made. null or empty refers to none. 1: 1 field goal made in the post season. +-- players_teams.PostftAttempted: post season field free throw attempted. null or empty refers to none. 1: 1 free throw attempts in the post season. +-- players_teams.PostftMade: post season free throw made. null or empty refers to none. 1: 1 free throw made in the post season. +-- players_teams.PostthreeAttempted: post season three point attempted. null or empty refers to none. 1: 1 three point attempts in the post season. +-- players_teams.PostthreeMade: post season three point made. null or empty refers to none. 1: 1 three point made in the post season. +-- players_teams.note: No description. +CREATE TABLE "players_teams" +( + id INTEGER + primary key autoincrement, + playerID TEXT not null, + year INTEGER, + stint INTEGER, + tmID TEXT, + lgID TEXT, + GP INTEGER, + GS INTEGER, + minutes INTEGER, + points INTEGER, + oRebounds INTEGER, + dRebounds INTEGER, + rebounds INTEGER, + assists INTEGER, + steals INTEGER, + blocks INTEGER, + turnovers INTEGER, + PF INTEGER, + fgAttempted INTEGER, + fgMade INTEGER, + ftAttempted INTEGER, + ftMade INTEGER, + threeAttempted INTEGER, + threeMade INTEGER, + PostGP INTEGER, + PostGS INTEGER, + PostMinutes INTEGER, + PostPoints INTEGER, + PostoRebounds INTEGER, + PostdRebounds INTEGER, + PostRebounds INTEGER, + PostAssists INTEGER, + PostSteals INTEGER, + PostBlocks INTEGER, + PostTurnovers INTEGER, + PostPF INTEGER, + PostfgAttempted INTEGER, + PostfgMade INTEGER, + PostftAttempted INTEGER, + PostftMade INTEGER, + PostthreeAttempted INTEGER, + PostthreeMade INTEGER, + note TEXT, + FOREIGN KEY ("tmID","year") REFERENCES "teams" ("tmID","year") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("playerID") REFERENCES "players" ("playerID") ON UPDATE CASCADE ON DELETE CASCADE +); +-- series_post.id: unique number of this record. +-- series_post.year: year. +-- series_post.round: round. known abbreviations:. F:final. SF: semi-final. QF:quater-final 1/4. DF:division-final. DSF:division semi-final. +-- series_post.series: not useful. +-- series_post.tmIDWinner: team id winner. +-- series_post.lgIDWinner: league id winner. +-- series_post.tmIDLoser: team id loser. +-- series_post.lgIDLoser: league id loser. +-- series_post.W: wins. +-- series_post.L: loses. +CREATE TABLE "series_post" +( + id INTEGER + primary key autoincrement, + year INTEGER, + round TEXT, + series TEXT, + tmIDWinner TEXT, + lgIDWinner TEXT, + tmIDLoser TEXT, + lgIDLoser TEXT, + W INTEGER, + L INTEGER, + FOREIGN KEY ("tmIDLoser","year") REFERENCES "teams" ("tmID","year") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("tmIDWinner","year") REFERENCES "teams" ("tmID","year") ON UPDATE CASCADE ON DELETE CASCADE +); +-- teams.year: year. +-- teams.lgID: league ID. league name. main categories:. NBA, ABA. +-- teams.tmID: team ID. team id. abbreviated name. +-- teams.franchID: not useful. +-- teams.confID: not useful. +-- teams.divID: division ID. +-- teams.rank: rank. less is better. +-- teams.confRank: not useful. +-- teams.playoff: another name: post season. for brevity, if the value is not null or empty, it means this team attends the playoffs, otherwise, means not attend. +-- teams.name: full name of the team. +-- teams.o_fgm: offense field goal made. how many offense field goal made by this team in this season. +-- teams.o_ftm: offense free throw made. how many offense free throw made by this team in this season. +-- teams.o_pts: offense points. +-- teams.d_pts: defense points. +-- teams.homeWon: home wins. wins in the home. +-- teams.homeLost: home loses. loses in the home. +-- teams.awayWon: away wins. wins in the away. +-- teams.awayLost: away loses. loses in the away. +-- teams.won: total wins of this team in this year. +-- teams.lost: total losts of this team in this year. +-- teams.games: total number of games that this team played in this year (season). +-- teams.arena: arena. null or empty refers to the fact that this team doesn't have individual arenas, otherwise, it has individual arenas. +CREATE TABLE teams +( + year INTEGER not null, + lgID TEXT null, + tmID TEXT not null, + franchID TEXT null, + confID TEXT null, + divID TEXT null, + `rank` INTEGER null, + confRank INTEGER null, + playoff TEXT null, + name TEXT null, + o_fgm INTEGER null, + -- o_fga int null, + o_ftm INTEGER null, + -- o_fta int null, +-- o_3pm int null, +-- o_3pa int null, +-- o_oreb int null, +-- o_dreb int null, +-- o_reb int null, +-- o_asts int null, +-- o_pf int null, +-- o_stl int null, +-- o_to int null, +-- o_blk int null, + o_pts INTEGER null, + -- d_fgm int null, +-- d_fga int null, +-- d_ftm int null, +-- d_fta int null, +-- d_3pm int null, +-- d_3pa int null, +-- d_oreb int null, +-- d_dreb int null, +-- d_reb int null, +-- d_asts int null, +-- d_pf int null, +-- d_stl int null, +-- d_to int null, +-- d_blk int null, + d_pts INTEGER null, + -- o_tmRebound int null, +-- d_tmRebound int null, + homeWon INTEGER null, + homeLost INTEGER null, + awayWon INTEGER null, + awayLost INTEGER null, + -- neutWon int null, +-- neutLoss int null, +-- confWon int null, +-- confLoss int null, +-- divWon int null, +-- divLoss int null, +-- pace int null, + won INTEGER null, + lost INTEGER null, + games INTEGER null, + -- min int null, + arena TEXT null, + -- attendance int null, +-- bbtmID varchar(255) null, + primary key (year, tmID) +); diff --git a/schemas/public_review_platform.sql b/schemas/public_review_platform.sql new file mode 100644 index 0000000000000000000000000000000000000000..78bf75f35a56c13e08634026ee5cecfee7e1eed0 --- /dev/null +++ b/schemas/public_review_platform.sql @@ -0,0 +1,241 @@ +-- Attributes.attribute_id: attribute id. unique number identifying the attribute. +-- Attributes.attribute_name: attribute name. the name of the attribute. +CREATE TABLE Attributes +( + attribute_id INTEGER + constraint Attributes_pk + primary key, + attribute_name TEXT +); +-- Business.business_id: business id. unique number identifying the business. +-- Business.active: whether the business is still actively running until now. commonsense reasoning:. � "True": the business is still running. � "False": the business is closed or not running now. +-- Business.city: The city where the business is located. +-- Business.state: The state where the business is located. +-- Business.stars: ratings of the business. 5 � Great experience. 4 � Good experience. 3 � Average experience. 2 � Bad experience. 1 - Terrible experience. � the rating of >3 stars referring to "wonderful experience" or positive comments and vice versa. +-- Business.review_count: review count. the total number of reviews the users have written for a business. � If a business has a low total review count and a high star rating of >3, it means there is a low veracity of reviews. � higher review count and with high star rating of > 3 means this business is more popular or more appealing to users. +CREATE TABLE "Business" +( + business_id INTEGER + constraint Business_pk + primary key, + active TEXT, + city TEXT, + state TEXT, + stars REAL, + review_count TEXT +); +-- Business_Attributes.attribute_id: attribute id. id number identifying the attribute. +-- Business_Attributes.business_id: business id. id number identifying the business. +-- Business_Attributes.attribute_value: attribute value. sort of the attributes for each business. “None”, “No” or “FALSE” means the business does not have the attribute. +CREATE TABLE "Business_Attributes" +( + attribute_id INTEGER, + business_id INTEGER, + attribute_value TEXT, + constraint Business_Attributes_pk + primary key (attribute_id, business_id), + FOREIGN KEY ("business_id") REFERENCES "Business" ("business_id"), + FOREIGN KEY ("attribute_id") REFERENCES "Attributes" ("attribute_id") +); +-- Business_Categories.business_id: business id. id number identifying the business. +-- Business_Categories.category_id: category id. id number identifying the categories. +CREATE TABLE "Business_Categories" +( + business_id INTEGER, + category_id INTEGER, + constraint Business_Categories_pk + primary key (business_id, category_id), + FOREIGN KEY ("category_id") REFERENCES "Categories" ("category_id"), + FOREIGN KEY ("business_id") REFERENCES "Business" ("business_id") +); +-- Business_Hours.business_id: business id. id number identifying the business. +-- Business_Hours.day_id: day id. id number identifying each day of the week. +-- Business_Hours.opening_time: scheduled opening time in whole-hour AM/PM notation; 12AM is midnight and 12PM is noon. The Open 24 Hours business attribute is separately recorded and is not derived from this schedule. +-- Business_Hours.closing_time: scheduled closing time in whole-hour AM/PM notation. An earlier closing time falls on the following day. Equal opening and closing times represent a 24-hour operating interval. +CREATE TABLE "Business_Hours" +( + business_id INTEGER, + day_id INTEGER, + opening_time TEXT, + closing_time TEXT, + constraint Business_Hours_pk + primary key (business_id, day_id), + FOREIGN KEY ("day_id") REFERENCES "Days" ("day_id"), + FOREIGN KEY ("business_id") REFERENCES "Business" ("business_id") +); +-- Categories.category_id: category id. +-- Categories.category_name: category name. +CREATE TABLE Categories +( + category_id INTEGER + constraint Categories_pk + primary key, + category_name TEXT +); +-- Checkins.business_id: business id. id number identifying the business. +-- Checkins.day_id: day id. id number identifying each day of the week. +-- Checkins.label_time_0: indicates times of checkins on a business. label_time_0: 12:00 a.m. label_time_23: 23:00 p.m. If the label_time recorded "None" for check-in on one day, then it means the business is closed on that day. +-- Checkins.label_time_1: No description. +-- Checkins.label_time_2: No description. +-- Checkins.label_time_3: No description. +-- Checkins.label_time_4: No description. +-- Checkins.label_time_5: No description. +-- Checkins.label_time_6: No description. +-- Checkins.label_time_7: No description. +-- Checkins.label_time_8: No description. +-- Checkins.label_time_9: No description. +-- Checkins.label_time_10: No description. +-- Checkins.label_time_11: No description. +-- Checkins.label_time_12: No description. +-- Checkins.label_time_13: No description. +-- Checkins.label_time_14: No description. +-- Checkins.label_time_15: No description. +-- Checkins.label_time_16: No description. +-- Checkins.label_time_17: No description. +-- Checkins.label_time_18: No description. +-- Checkins.label_time_19: No description. +-- Checkins.label_time_20: No description. +-- Checkins.label_time_21: No description. +-- Checkins.label_time_22: No description. +-- Checkins.label_time_23: No description. +CREATE TABLE "Checkins" +( + business_id INTEGER, + day_id INTEGER, + label_time_0 TEXT, + label_time_1 TEXT, + label_time_2 TEXT, + label_time_3 TEXT, + label_time_4 TEXT, + label_time_5 TEXT, + label_time_6 TEXT, + label_time_7 TEXT, + label_time_8 TEXT, + label_time_9 TEXT, + label_time_10 TEXT, + label_time_11 TEXT, + label_time_12 TEXT, + label_time_13 TEXT, + label_time_14 TEXT, + label_time_15 TEXT, + label_time_16 TEXT, + label_time_17 TEXT, + label_time_18 TEXT, + label_time_19 TEXT, + label_time_20 TEXT, + label_time_21 TEXT, + label_time_22 TEXT, + label_time_23 TEXT, + constraint Checkins_pk + primary key (business_id, day_id), + FOREIGN KEY ("day_id") REFERENCES "Days" ("day_id"), + FOREIGN KEY ("business_id") REFERENCES "Business" ("business_id") +); +-- Compliments.compliment_id: compliment id. +-- Compliments.compliment_type: compliment type. +CREATE TABLE Compliments +( + compliment_id INTEGER + constraint Compliments_pk + primary key, + compliment_type TEXT +); +-- Days.day_id: day id. the unique id identifying the day of the week. +-- Days.day_of_week: day of week. indicate the day of the week. +CREATE TABLE Days +( + day_id INTEGER + constraint Days_pk + primary key, + day_of_week TEXT +); +-- Elite.user_id: user id. id number identifying the users. +-- Elite.year_id: year id. id number identifying the year. +CREATE TABLE "Elite" +( + user_id INTEGER, + year_id INTEGER, + constraint Elite_pk + primary key (user_id, year_id), + FOREIGN KEY ("year_id") REFERENCES "Years" ("year_id"), + FOREIGN KEY ("user_id") REFERENCES "Users" ("user_id") +); +-- Reviews.business_id: business id. the number identifying the business. +-- Reviews.user_id: user id. the number identifying the user who comments on this business. +-- Reviews.review_stars: review stars. review on this business. 5 – Great experience. 4 – Good experience. 3 – Average experience. 2 – Bad experience. 1 - Terrible experience. +-- Reviews.review_votes_funny: review votes funny. the amount of funny votes that the user received for the review. If the reviews receive an “Uber” number of votes for funny, they will also receive an “Uber”, “High” or “Medium” number of votes for “useful” and “cool”. +-- Reviews.review_votes_useful: review votes useful. how many useful votes that the user received for the review. +-- Reviews.review_votes_cool: review votes cool. how many cool votes that the user received for the review. +-- Reviews.review_length: review length. The length of the review written by the user. +CREATE TABLE "Reviews" +( + business_id INTEGER, + user_id INTEGER, + review_stars INTEGER, + review_votes_funny TEXT, + review_votes_useful TEXT, + review_votes_cool TEXT, + review_length TEXT, + constraint Reviews_pk + primary key (business_id, user_id), + FOREIGN KEY ("user_id") REFERENCES "Users" ("user_id"), + FOREIGN KEY ("business_id") REFERENCES "Business" ("business_id") +); +-- Tips.business_id: business id. the number identifying the business. +-- Tips.user_id: user id. the number identifying the user who comments on this business. +-- Tips.likes: Likes. how many likes of this tips. more likes mean this tip is more valuable. +-- Tips.tip_length: tip length. length of the tip. +CREATE TABLE "Tips" +( + business_id INTEGER, + user_id INTEGER, + likes INTEGER, + tip_length TEXT, + constraint Tips_pk + primary key (business_id, user_id), + FOREIGN KEY ("user_id") REFERENCES "Users" ("user_id"), + FOREIGN KEY ("business_id") REFERENCES "Business" ("business_id") +); +-- Users.user_id: user id. the unique id number identifying which user. +-- Users.user_yelping_since_year: user yelping since year. the time when the user join Yelp. +-- Users.user_average_stars: user average stars. the average ratings of all review. +-- Users.user_votes_funny: user votes funny. total number of funny votes sent by the user. +-- Users.user_votes_useful: user votes useful. how many useful votes created by the user. +-- Users.user_votes_cool: user votes cool. how many cool votes created by the user. +-- Users.user_review_count: user review count. total number of reviews the user has written. +-- Users.user_fans: user fans. total number of fans / followers the user has. Users with “Uber” number of fans indicate that they have sent an “Uber” number of ‘cool’, ‘useful’ and ‘funny” votes. +CREATE TABLE "Users" +( + user_id INTEGER + constraint Users_pk + primary key, + user_yelping_since_year INTEGER, + user_average_stars TEXT, + user_votes_funny TEXT, + user_votes_useful TEXT, + user_votes_cool TEXT, + user_review_count TEXT, + user_fans TEXT +); +-- Users_Compliments.compliment_id: compliment id. the id number indicating the compliment. +-- Users_Compliments.user_id: user id. the id number indicating the user. +-- Users_Compliments.number_of_compliments: number of compliments. how many compliments a user has received from other users. more number_of_compliments indicates this user is more welcome or he / she is high-quality user. +CREATE TABLE "Users_Compliments" +( + compliment_id INTEGER, + user_id INTEGER, + number_of_compliments TEXT, + constraint Users_Compliments_pk + primary key (compliment_id, user_id), + FOREIGN KEY ("user_id") REFERENCES "Users" ("user_id"), + FOREIGN KEY ("compliment_id") REFERENCES "Compliments" ("compliment_id") +); +-- Years.year_id: year id. the unique number identifying the year. +-- Years.actual_year: actual year. +CREATE TABLE Years +( + year_id INTEGER + constraint Years_pk + primary key, + actual_year INTEGER +); diff --git a/schemas/regional_sales.sql b/schemas/regional_sales.sql new file mode 100644 index 0000000000000000000000000000000000000000..fb5ee48f892f4b7b9d684ae6b07cd2599d4d97f0 --- /dev/null +++ b/schemas/regional_sales.sql @@ -0,0 +1,117 @@ +-- Customers.CustomerID: customer id. unique id number indicating which customer. +-- Customers.Customer Names: customer names. the name of the customer. +CREATE TABLE Customers +( + CustomerID INTEGER + constraint Customers_pk + primary key, + "Customer Names" TEXT +); +-- Products.ProductID: product id. unique id number representing each product. +-- Products.Product Name: product name. name of the product. +CREATE TABLE Products +( + ProductID INTEGER + constraint Products_pk + primary key, + "Product Name" TEXT +); +-- Regions.StateCode: state code. the unique code identifying the state. +-- Regions.State: full state name. +-- Regions.Region: the region where the state is located in. +CREATE TABLE Regions +( + StateCode TEXT + constraint Regions_pk + primary key, + State TEXT, + Region TEXT +); +-- Sales Orders.OrderNumber: Order Number. the unique number identifying the order. +-- Sales Orders.Sales Channel: Sales Channel. • In-Store. • Online. • Distributor. • Wholesale. +-- Sales Orders.WarehouseCode: Warehouse Code. if the warehouse code is the same, it means this product is shipped from the same ware house. +-- Sales Orders.ProcuredDate: Procured Date. date: month/date/year, 17--> 2017. +-- Sales Orders.OrderDate: Order Date. +-- Sales Orders.ShipDate: Ship Date. +-- Sales Orders.DeliveryDate: Delivery Date. the difference "DeliveryDate - OrderDate" is smaller, it means faster delivery. +-- Sales Orders.CurrencyCode: Currency Code. USD. +-- Sales Orders._SalesTeamID: _Sales Team ID. Sales Team ID. +-- Sales Orders._CustomerID: _Customer ID. +-- Sales Orders._StoreID: _Store ID. +-- Sales Orders._ProductID: _Product ID. +-- Sales Orders.Order Quantity: Order Quantity. 1 - 8:. higher means order quantity is higher or customer needs more. +-- Sales Orders.Discount Applied: Discount Applied. 0.2: 20% discount. +-- Sales Orders.Unit Price: No description. +-- Sales Orders.Unit Cost: net profit = Unit Price - Unit Cost. +CREATE TABLE "Sales Orders" +( + OrderNumber TEXT + constraint "Sales Orders_pk" + primary key, + "Sales Channel" TEXT, + WarehouseCode TEXT, + ProcuredDate TEXT, + OrderDate TEXT, + ShipDate TEXT, + DeliveryDate TEXT, + CurrencyCode TEXT, + _SalesTeamID INTEGER, + _CustomerID INTEGER, + _StoreID INTEGER, + _ProductID INTEGER, + "Order Quantity" INTEGER, + "Discount Applied" REAL, + "Unit Price" TEXT, + "Unit Cost" TEXT, + FOREIGN KEY ("_ProductID") REFERENCES "Products" ("ProductID"), + FOREIGN KEY ("_StoreID") REFERENCES "Store Locations" ("StoreID"), + FOREIGN KEY ("_CustomerID") REFERENCES "Customers" ("CustomerID"), + FOREIGN KEY ("_SalesTeamID") REFERENCES "Sales Team" ("SalesTeamID") +); +-- Sales Team.SalesTeamID: SalesTeam ID. unique sales team id. +-- Sales Team.Sales Team: sales team names. +-- Sales Team.Region: the region where the state is located in. +CREATE TABLE "Sales Team" +( + SalesTeamID INTEGER + constraint "Sales Team_pk" + primary key, + "Sales Team" TEXT, + Region TEXT +); +-- Store Locations.StoreID: Store ID. unique store id. +-- Store Locations.City Name: No description. +-- Store Locations.County: full county name. +-- Store Locations.StateCode: State Code. state code. +-- Store Locations.State: full state name. +-- Store Locations.Type: type of the store. City. Town. CDP (customer data platform). Unified Government. Consolidated Government. Other. Township. Urban County. Borough. Metropolitan Government. +-- Store Locations.Latitude: Latitude. +-- Store Locations.Longitude: Longitude. coordinates or detailed position: (Latitude, Longitude). +-- Store Locations.AreaCode: Area Code. +-- Store Locations.Population: Population. +-- Store Locations.Household Income: Household Income. +-- Store Locations.Median Income: Median Income. +-- Store Locations.Land Area: Land Area. +-- Store Locations.Water Area: Water Area. +-- Store Locations.Time Zone: Time Zone. +CREATE TABLE "Store Locations" +( + StoreID INTEGER + constraint "Store Locations_pk" + primary key, + "City Name" TEXT, + County TEXT, + StateCode TEXT, + State TEXT, + Type TEXT, + Latitude REAL, + Longitude REAL, + AreaCode INTEGER, + Population INTEGER, + "Household Income" INTEGER, + "Median Income" INTEGER, + "Land Area" INTEGER, + "Water Area" INTEGER, + "Time Zone" TEXT, + FOREIGN KEY ("StateCode") REFERENCES "Regions" ("StateCode") +); diff --git a/schemas/restaurant.sql b/schemas/restaurant.sql new file mode 100644 index 0000000000000000000000000000000000000000..d97f475dc0a799640d7ca22a84e06d1bc03c3d4c --- /dev/null +++ b/schemas/restaurant.sql @@ -0,0 +1,39 @@ +-- generalinfo.id_restaurant: id restaurant. the unique id for the restaurant. +-- generalinfo.label: the label of the restaurant. +-- generalinfo.food_type: food type. the food type. +-- generalinfo.city: the city where the restaurant is located in. +-- generalinfo.review: the review of the restaurant. the review rating is from 0.0 to 5.0. The high review rating is positively correlated with the overall level of the restaurant. The restaurant with higher review rating is usually more popular among diners. +CREATE TABLE generalinfo +( + id_restaurant INTEGER not null + primary key, + label TEXT null, + food_type TEXT null, + city TEXT null, + review REAL null, + FOREIGN KEY ("city") REFERENCES "geographic" ("city") ON UPDATE CASCADE ON DELETE CASCADE +); +-- geographic.city: the city. +-- geographic.county: country. the country the city belongs to. +-- geographic.region: corresponding regions. +CREATE TABLE geographic +( + city TEXT not null + primary key, + county TEXT null, + region TEXT null +); +-- location.id_restaurant: id restaurant. the unique id for the restaurant. +-- location.street_num: street number. the street number of the restaurant. +-- location.street_name: street name. the street name of the restaurant. +-- location.city: the city where the restaurant is located in. +CREATE TABLE location +( + id_restaurant INTEGER not null + primary key, + street_num INTEGER null, + street_name TEXT null, + city TEXT null, + FOREIGN KEY ("id_restaurant") REFERENCES "generalinfo" ("id_restaurant") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("city") REFERENCES "geographic" ("city") ON UPDATE CASCADE ON DELETE CASCADE +); diff --git a/schemas/retail_complains.sql b/schemas/retail_complains.sql new file mode 100644 index 0000000000000000000000000000000000000000..099f6a5326adbecc0098ce8892d77b4c5dc788b0 --- /dev/null +++ b/schemas/retail_complains.sql @@ -0,0 +1,147 @@ +-- callcenterlogs.Date received: complaint date. +-- callcenterlogs.Complaint ID: unique id number representing each complaint. +-- callcenterlogs.rand client: client id. +-- callcenterlogs.phonefinal: phone final. final phone number. +-- callcenterlogs.vru+line: voice response unit line. +-- callcenterlogs.call_id: call id. id number identifying the call. +-- callcenterlogs.priority: priority of the complaint. 0, 1, 2,. null: not available,. higher: -> higher priority,. -> more serious/urgent complaint. +-- callcenterlogs.type: type of complaint. +-- callcenterlogs.outcome: the outcome of processing of complaints. +-- callcenterlogs.server: server. +-- callcenterlogs.ser_start: server start. server start time. HH:MM:SS. +-- callcenterlogs.ser_exit: server exit. server exit time. +-- callcenterlogs.ser_time: server time. longer server time referring to more verbose/longer complaint. +CREATE TABLE callcenterlogs +( + "Date received" DATE, + "Complaint ID" TEXT, + "rand client" TEXT, + phonefinal TEXT, + "vru+line" TEXT, + call_id INTEGER, + priority INTEGER, + type TEXT, + outcome TEXT, + server TEXT, + ser_start TEXT, + ser_exit TEXT, + ser_time TEXT, + primary key ("Complaint ID"), + FOREIGN KEY ("rand client") REFERENCES "client" ("client_id") +); +-- client.client_id: client id. unique id client number. +-- client.sex: sex of client. +-- client.day: day of the birthday. +-- client.month: month of the birthday. +-- client.year: year when is born. +-- client.age: age. teenager: 13-19. adult: 19-65. elder: > 65. +-- client.social: social number. ssn: us id number for each person. +-- client.first: first name. +-- client.middle: middle name. +-- client.last: last name. +-- client.phone: phone number. +-- client.email: email. google email / account: @gamil.com. microsoft email / account: xxx@outlook.com. +-- client.address_1: address 1. +-- client.address_2: address 2. entire address = (address_1, address_2). +-- client.city: city. +-- client.state: state code. +-- client.zipcode: zipcode. +-- client.district_id: district id. district id number. +CREATE TABLE client +( + client_id TEXT + primary key, + sex TEXT, + day INTEGER, + month INTEGER, + year INTEGER, + age INTEGER, + social TEXT, + first TEXT, + middle TEXT, + last TEXT, + phone TEXT, + email TEXT, + address_1 TEXT, + address_2 TEXT, + city TEXT, + state TEXT, + zipcode INTEGER, + district_id INTEGER, + FOREIGN KEY ("district_id") REFERENCES "district" ("district_id") +); +-- district.district_id: district id. unique id number representing district. +-- district.city: city. +-- district.state_abbrev: state abbreviated code. +-- district.division: division. +-- Relationship: district(state_abbrev) to state(StateCode). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE district +( + district_id INTEGER + primary key, + city TEXT, + state_abbrev TEXT, + division TEXT +); +-- events.Date received: Date received. +-- events.Product: complaining about which product. +-- events.Sub-product: sub product if exists. detailed product. +-- events.Issue: problems leading to this complaints. +-- events.Sub-issue: sub problems leading to this complaints if exists. more detailed issue. +-- events.Consumer complaint narrative: Consumer complaint narrative. +-- events.Tags: tags of client. +-- events.Consumer consent provided?: Tags Consumer consent provided?. whether the tags labeled under permission of the clients. • null, 'N/A' or empty value: indicating that the company didn't get the permission of consent. • if the value is not empty: customers provide the consent for this tag. +-- events.Submitted via: Submitted via. +-- events.Date sent to company: Date sent to company. delay of the complaints = 'Date sent to company'. +-- events.Company response to consumer: Company response to consumer. +-- events.Timely response?: whether the response of the company is timely. +-- events.Consumer disputed?: whether the consumer dispute about the response from the company. +-- events.Complaint ID: id number indicating which complaint. +-- events.Client_ID: Client ID. id number indicating which client. +-- Relationship: events(Complaint ID) to callcenterlogs(Complaint ID). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE events +( + "Date received" DATE, + Product TEXT, + "Sub-product" TEXT, + Issue TEXT, + "Sub-issue" TEXT, + "Consumer complaint narrative" TEXT, + Tags TEXT, + "Consumer consent provided?" TEXT, + "Submitted via" TEXT, + "Date sent to company" TEXT, + "Company response to consumer" TEXT, + "Timely response?" TEXT, + "Consumer disputed?" TEXT, + "Complaint ID" TEXT, + Client_ID TEXT, + primary key ("Complaint ID", Client_ID), + FOREIGN KEY ("Client_ID") REFERENCES "client" ("client_id") +); +-- reviews.Date: No description. +-- reviews.Stars: No description. +-- reviews.Reviews: No description. +-- reviews.Product: No description. +-- reviews.district_id: No description. +CREATE TABLE reviews +( + "Date" DATE + primary key, + Stars INTEGER, + Reviews TEXT, + Product TEXT, + district_id INTEGER, + FOREIGN KEY ("district_id") REFERENCES "district" ("district_id") +); +-- state.StateCode: No description. +-- state.State: No description. +-- state.Region: No description. +CREATE TABLE state +( + StateCode TEXT + constraint state_pk + primary key, + State TEXT, + Region TEXT +); diff --git a/schemas/retail_world.sql b/schemas/retail_world.sql new file mode 100644 index 0000000000000000000000000000000000000000..c1f21002b78d203d5909fb083008b79286e7aa51 --- /dev/null +++ b/schemas/retail_world.sql @@ -0,0 +1,110 @@ +-- Categories.CategoryID: Category ID. the unique id for the category. +-- Categories.CategoryName: Category Name. the category name. +-- Categories.Description: the detailed description of the category. +CREATE TABLE Categories +( + CategoryID INTEGER PRIMARY KEY AUTOINCREMENT, + CategoryName TEXT, + Description TEXT +); +-- Customers.CustomerID: Customer ID. the unique id for customers. +-- Customers.CustomerName: Customer Name. the customer name. +-- Customers.ContactName: Contact Name. the contact person's name representing the company. +-- Customers.Address: the address of the customer. +-- Customers.City: the city where the customer is located. +-- Customers.PostalCode: Postal Code. the postal code. +-- Customers.Country: the country. +CREATE TABLE Customers +( + CustomerID INTEGER PRIMARY KEY AUTOINCREMENT, + CustomerName TEXT, + ContactName TEXT, + Address TEXT, + City TEXT, + PostalCode TEXT, + Country TEXT +); +-- Employees.EmployeeID: Employee ID. the unique id for employees. +-- Employees.LastName: Last Name. the employee's last name. +-- Employees.FirstName: First Name. the employee's first name. the employee's full name is 'first_name last_name'. +-- Employees.BirthDate: Birth Date. the birth date of the employee. +-- Employees.Photo: the photo of the employee. +-- Employees.Notes: some additional information of the employee. +CREATE TABLE Employees +( + EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT, + LastName TEXT, + FirstName TEXT, + BirthDate DATE, + Photo TEXT, + Notes TEXT +); +-- OrderDetails.OrderID: Order ID. the unique id for orders. +-- OrderDetails.ProductID: Product ID. the unique id for products. +-- OrderDetails.Quantity: the quantity of the ordered products. +-- OrderDetails.OrderDetailID: order detail id. id of the order detail. +CREATE TABLE OrderDetails( + OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT, + OrderID INTEGER, + ProductID INTEGER, + Quantity INTEGER, + FOREIGN KEY ("ProductID") REFERENCES "Products" ("ProductID"), + FOREIGN KEY ("OrderID") REFERENCES "Orders" ("OrderID") +); +-- Orders.OrderID: Order ID. the unique id for orders. +-- Orders.CustomerID: Customer ID. the unique id for customers. +-- Orders.EmployeeID: Employee ID. the unique id for employees. +-- Orders.OrderDate: Order Date. the order date. +-- Orders.ShipperID: Shipper ID. the unique id for shippers. +CREATE TABLE Orders( + OrderID INTEGER PRIMARY KEY AUTOINCREMENT, + CustomerID INTEGER, + EmployeeID INTEGER, + OrderDate DATETIME, + ShipperID INTEGER, + FOREIGN KEY ("ShipperID") REFERENCES "Shippers" ("ShipperID"), + FOREIGN KEY ("CustomerID") REFERENCES "Customers" ("CustomerID"), + FOREIGN KEY ("EmployeeID") REFERENCES "Employees" ("EmployeeID") +); +-- Products.ProductID: Product ID. the unique id for products. +-- Products.ProductName: Product Name. the name of the product. +-- Products.SupplierID: Supplier ID. the unique id for supplier. +-- Products.CategoryID: Category ID. the unique id for the product category. +-- Products.Price: the price. +-- Products.Unit: Unit. the unit of the product. +CREATE TABLE Products( + ProductID INTEGER PRIMARY KEY AUTOINCREMENT, + ProductName TEXT, + SupplierID INTEGER, + CategoryID INTEGER, + Unit TEXT, + Price REAL DEFAULT 0, + FOREIGN KEY ("SupplierID") REFERENCES "Suppliers" ("SupplierID"), + FOREIGN KEY ("CategoryID") REFERENCES "Categories" ("CategoryID") +); +-- Shippers.ShipperID: Shipper ID. the unique id for shippers. +-- Shippers.ShipperName: Shipper Name. the shipped company name. +-- Shippers.Phone: the phone of the company. +CREATE TABLE Shippers( + ShipperID INTEGER PRIMARY KEY AUTOINCREMENT, + ShipperName TEXT, + Phone TEXT +); +-- Suppliers.SupplierID: Supplier ID. the unique id for suppliers. +-- Suppliers.SupplierName: Supplier Name. the supplier name. +-- Suppliers.ContactName: Contact Name. the contact person's name representing the company. +-- Suppliers.Address: the address of the supplier. +-- Suppliers.City: the city where the supplier is located. +-- Suppliers.PostalCode: Postal Code. the postal code. +-- Suppliers.Country: the country. +-- Suppliers.Phone: the phone number. +CREATE TABLE Suppliers( + SupplierID INTEGER PRIMARY KEY AUTOINCREMENT, + SupplierName TEXT, + ContactName TEXT, + Address TEXT, + City TEXT, + PostalCode TEXT, + Country TEXT, + Phone TEXT +); diff --git a/schemas/retails.sql b/schemas/retails.sql new file mode 100644 index 0000000000000000000000000000000000000000..dca33f62be72cc1cf6f446591c74cf04bfa86bb1 --- /dev/null +++ b/schemas/retails.sql @@ -0,0 +1,161 @@ +-- customer.c_custkey: customer key. unique id number identifying the customer. +-- customer.c_mktsegment: customer market segment. the segment of the customer. +-- customer.c_nationkey: customer nation key. the nation key number of the customer. +-- customer.c_name: customer name. name of the customer. +-- customer.c_address: customer address. address of the customer. +-- customer.c_phone: customer phone. phone of the customer. +-- customer.c_acctbal: customer account balance. account balance. if c_acctbal < 0: this account is in debt. +-- customer.c_comment: customer comment. comment of the customer. +CREATE TABLE `customer` ( + `c_custkey` INTEGER NOT NULL, + `c_mktsegment` TEXT DEFAULT NULL, + `c_nationkey` INTEGER DEFAULT NULL, + `c_name` TEXT DEFAULT NULL, + `c_address` TEXT DEFAULT NULL, + `c_phone` TEXT DEFAULT NULL, + `c_acctbal` REAL DEFAULT NULL, + `c_comment` TEXT DEFAULT NULL, + PRIMARY KEY (`c_custkey`), + FOREIGN KEY ("c_nationkey") REFERENCES "nation" ("n_nationkey") ON UPDATE CASCADE ON DELETE CASCADE +); +-- lineitem.l_shipdate: line item ship date. ship date of line item. +-- lineitem.l_orderkey: line item order key. order key number of line item. +-- lineitem.l_discount: line item discount. discount of line item. 0.1: 10% off. +-- lineitem.l_extendedprice: line item extended price. extended price of line item. full price before discount. discounted price = (l_extendedprice*(1-l_discount)). +-- lineitem.l_suppkey: line item suppkey. suppkey of line item. +-- lineitem.l_quantity: line item quantity. quantity of line item. +-- lineitem.l_returnflag: line item return flag. return flag of line item. • “R” ? returned item. • “A” and "N": not returned item. +-- lineitem.l_partkey: line item part key. part key of line item. +-- lineitem.l_linestatus: line item line status. line status of line item. NOT USEFUL. +-- lineitem.l_tax: line item tax. tax of line item. charge = l_extendedprice * (1- l_discount) * (1+ l_tax). +-- lineitem.l_commitdate: line item commit date. commit date of line item. +-- lineitem.l_receiptdate: line item receipt date. receipt date of line item. freight / shipping / delivery time = l_receiptdate - l_commitdate; less shipping / delivery time --> faster shipping speed. +-- lineitem.l_shipmode: line item ship mode. ship mode of line item. +-- lineitem.l_linenumber: line item line number. unique id number identifying the line item. +-- lineitem.l_shipinstruct: line item ship instruct. ship instruct of line item. +-- lineitem.l_comment: line item comment. comment of line item. +CREATE TABLE lineitem +( + l_shipdate DATE null, + l_orderkey INTEGER not null, + l_discount REAL not null, + l_extendedprice REAL not null, + l_suppkey INTEGER not null, + l_quantity INTEGER not null, + l_returnflag TEXT null, + l_partkey INTEGER not null, + l_linestatus TEXT null, + l_tax REAL not null, + l_commitdate DATE null, + l_receiptdate DATE null, + l_shipmode TEXT null, + l_linenumber INTEGER not null, + l_shipinstruct TEXT null, + l_comment TEXT null, + primary key (l_orderkey, l_linenumber), + FOREIGN KEY ("l_partkey","l_suppkey") REFERENCES "partsupp" ("ps_partkey","ps_suppkey") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("l_orderkey") REFERENCES "orders" ("o_orderkey") ON UPDATE CASCADE ON DELETE CASCADE +); +-- nation.n_nationkey: nation key. unique id number identifying the nation. +-- nation.n_name: nation name. name of the nation. +-- nation.n_regionkey: nation region key. region key number of the nation. +-- nation.n_comment: nation comment. comment description of nation. +CREATE TABLE nation +( + n_nationkey INTEGER not null + primary key, + n_name TEXT null, + n_regionkey INTEGER null, + n_comment TEXT null, + FOREIGN KEY ("n_regionkey") REFERENCES "region" ("r_regionkey") ON UPDATE CASCADE ON DELETE CASCADE +); +-- orders.o_orderdate: order date. date of the order. earlier order date --> higher priority in delivery. +-- orders.o_orderkey: order key. unique id number identifying the order. +-- orders.o_custkey: order customer key. customer key of order. +-- orders.o_orderpriority: order priority. priority rate of order. A smaller number means a higher priority: 0-Urgent. +-- orders.o_shippriority: order ship priority. ship priority of order. NOT USEFUL. +-- orders.o_clerk: order clerk. clerk of order. +-- orders.o_orderstatus: order status. status of order. NOT USEFUL. +-- orders.o_totalprice: order total price. total price of the order. +-- orders.o_comment: order comment. comment description of order. +CREATE TABLE orders +( + o_orderdate DATE null, + o_orderkey INTEGER not null + primary key, + o_custkey INTEGER not null, + o_orderpriority TEXT null, + o_shippriority INTEGER null, + o_clerk TEXT null, + o_orderstatus TEXT null, + o_totalprice REAL null, + o_comment TEXT null, + FOREIGN KEY ("o_custkey") REFERENCES "customer" ("c_custkey") ON UPDATE CASCADE ON DELETE CASCADE +); +-- part.p_partkey: part key. unique id number identifying the part. +-- part.p_type: part type. type of part. +-- part.p_size: part size. size number of part. larger number --> larger part. +-- part.p_brand: part brand. brand of part. +-- part.p_name: part name. name of part. +-- part.p_container: part container. container of part. +-- part.p_mfgr: part manufacturer. manufacturer of part. +-- part.p_retailprice: part retail price. retail price of part. +-- part.p_comment: part comment. comment description text of part. +CREATE TABLE part +( + p_partkey INTEGER not null + primary key, + p_type TEXT null, + p_size INTEGER null, + p_brand TEXT null, + p_name TEXT null, + p_container TEXT null, + p_mfgr TEXT null, + p_retailprice REAL null, + p_comment TEXT null +); +-- partsupp.ps_partkey: part supply part key. unique id number identifying the part key. +-- partsupp.ps_suppkey: part supply supply key. unique id number identifying the supply key. +-- partsupp.ps_supplycost: part supply cost. cost number of the part supply. profit = (l_extendedprice*(1-l_discount)) - (ps_supplycost * l_quantity)] l_quantity comes from table lineitem! +-- partsupp.ps_availqty: part supply available quantity. available quantity of the part supply. if ps_availqty < 10 --> closer to OOS (out of stock). +-- partsupp.ps_comment: part supply comment. comment description of the part supply. +CREATE TABLE partsupp +( + ps_partkey INTEGER not null, + ps_suppkey INTEGER not null, + ps_supplycost REAL not null, + ps_availqty INTEGER null, + ps_comment TEXT null, + primary key (ps_partkey, ps_suppkey), + FOREIGN KEY ("ps_suppkey") REFERENCES "supplier" ("s_suppkey") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("ps_partkey") REFERENCES "part" ("p_partkey") ON UPDATE CASCADE ON DELETE CASCADE +); +-- region.r_regionkey: region key. unique id number identifying the region. +-- region.r_name: region name. name of the region. +-- region.r_comment: region comment. comment description of the region. +CREATE TABLE region +( + r_regionkey INTEGER not null + primary key, + r_name TEXT null, + r_comment TEXT null +); +-- supplier.s_suppkey: supply key. unique id number identifying the supply. +-- supplier.s_nationkey: supplier nation key. nation key of the supply. +-- supplier.s_comment: supplier comment. comment description of the comment. +-- supplier.s_name: supplier name. name of the supplier. +-- supplier.s_address: supplier address. address of the supplier. +-- supplier.s_phone: supplier phone. phone number of the supplier. +-- supplier.s_acctbal: supplier account balance. account balance of the supplier. if c_acctbal < 0: this account is in debt. +CREATE TABLE supplier +( + s_suppkey INTEGER not null + primary key, + s_nationkey INTEGER null, + s_comment TEXT null, + s_name TEXT null, + s_address TEXT null, + s_phone TEXT null, + s_acctbal REAL null, + FOREIGN KEY ("s_nationkey") REFERENCES "nation" ("n_nationkey") +); diff --git a/schemas/sales.sql b/schemas/sales.sql new file mode 100644 index 0000000000000000000000000000000000000000..6d0da8f289e6b147eb1b0f97b859750fd506f8ce --- /dev/null +++ b/schemas/sales.sql @@ -0,0 +1,51 @@ +-- Customers.CustomerID: Customer ID. the unique id of the customer. +-- Customers.FirstName: First Name. the customer's first name. +-- Customers.MiddleInitial: Middle Initial. the customer's middle initial. +-- Customers.LastName: Last Name. the customer's last name. +CREATE TABLE Customers +( + CustomerID INTEGER not null + primary key, + FirstName TEXT not null, + MiddleInitial TEXT null, + LastName TEXT not null +); +-- Employees.EmployeeID: Employee ID. the unique id of the employee. +-- Employees.FirstName: First Name. the employee's first name. +-- Employees.MiddleInitial: Middle Initial. the employee's middle initial. +-- Employees.LastName: Last Name. the employee's last name. +CREATE TABLE Employees +( + EmployeeID INTEGER not null + primary key, + FirstName TEXT not null, + MiddleInitial TEXT null, + LastName TEXT not null +); +-- Products.ProductID: Product ID. the unique id of the product. +-- Products.Name: the product name. +-- Products.Price: the price of the product. unit price. if the price = 0.0, it means this product is free or a gift. +CREATE TABLE Products +( + ProductID INTEGER not null + primary key, + Name TEXT not null, + Price REAL null +); +-- Sales.SalesID: Sales ID. the unique id of the sales. +-- Sales.SalesPersonID: SalesPerson ID. the unique id of the sale person. +-- Sales.CustomerID: Customer ID. the unique id of the customer. +-- Sales.ProductID: Product ID. the unique id of the product. +-- Sales.Quantity: trading quantity. total price = quantity x Products' Price. +-- Relationship: Sales(SalesPersonID) to Employees(EmployeeID). The source contains non-NULL keys absent from the lookup. Preserve both catalogs and disclose incomplete coverage. +CREATE TABLE Sales +( + SalesID INTEGER not null + primary key, + SalesPersonID INTEGER not null, + CustomerID INTEGER not null, + ProductID INTEGER not null, + Quantity INTEGER not null, + FOREIGN KEY ("ProductID") REFERENCES "Products" ("ProductID") ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY ("CustomerID") REFERENCES "Customers" ("CustomerID") ON UPDATE CASCADE ON DELETE CASCADE +); diff --git a/schemas/sales_in_weather.sql b/schemas/sales_in_weather.sql new file mode 100644 index 0000000000000000000000000000000000000000..29be3fd6354e5c9630c0bc944c30fdba5717edd2 --- /dev/null +++ b/schemas/sales_in_weather.sql @@ -0,0 +1,66 @@ +-- relation.store_nbr: store number. the id of stores. +-- relation.station_nbr: station number. the id of weather stations. +-- Relationship: relation(station_nbr) to weather(station_nbr). The declared relationship requires a matching parent, but its key is not unique at the parent table grain. Validate existence without imposing uniqueness. +-- Relationship: relation(store_nbr) to sales_in_weather(store_nbr). The declared relationship requires a matching parent, but its key is not unique at the parent table grain. Validate existence without imposing uniqueness. +CREATE TABLE relation +( + store_nbr INTEGER + primary key, + station_nbr INTEGER +); +-- sales_in_weather.date: the date of sales. +-- sales_in_weather.store_nbr: store number. +-- sales_in_weather.item_nbr: item number. item / product number. +-- sales_in_weather.units: the quantity sold of an item on a given day. +CREATE TABLE sales_in_weather +( + date DATE, + store_nbr INTEGER, + item_nbr INTEGER, + units INTEGER, + primary key (store_nbr, date, item_nbr) +); +-- weather.station_nbr: station number. the id of weather stations. +-- weather.date: date. +-- weather.tmax: temperature max. max temperature. +-- weather.tmin: temperature min. min temperature. temperature range / difference = tmax - tmin. +-- weather.tavg: temperature average. average temperature. +-- weather.depart: departure from normal. Temperature departure from the normal indicates if the dekadal average temperatures were above or below the 30-year normal. • if null: the temperature is 30-year normal. • if the value is positive: the temperature is above the 30-year normal,. • if the value is negative: the temperature is below the 30-year normal,. +-- weather.dewpoint: dew point. The dew point is the temperature to which air must be cooled to become saturated with water vapor, assuming constant air pressure and water content. +-- weather.wetbulb: wet bulb. • The wet-bulb temperature (WBT) is the temperature read by a thermometer covered in water-soaked (water at ambient temperature) cloth (a wet-bulb thermometer) over which air is passed. • At 100% relative humidity, the wet-bulb temperature is equal to the air temperature (dry-bulb temperature); • at lower humidity the wet-bulb temperature is lower than dry-bulb temperature because of evaporative cooling. +-- weather.heat: calculated heating degree. +-- weather.cool: calculated cooling degree. +-- weather.sunrise: calculated sunrise. +-- weather.sunset: calculated sunset. +-- weather.codesum: code summarization. code summarization for the weather. • PY SPRAY. • SQ SQUALL. • DR LOW DRIFTING. • SH SHOWER. • FZ FREEZING. • MI SHALLOW. • PR PARTIAL. • BC PATCHES. • BL BLOWING. • VC VICINITY. • - LIGHT. • + HEAVY. • "NO SIGN" MODERATE. +-- weather.snowfall: snowfall. snowfall (inches AND tenths). +-- weather.preciptotal: precipitation total. inches (240hr period ending at indicated local standard time). +-- weather.stnpressure: station pressure. +-- weather.sealevel: sea level. +-- weather.resultspeed: resultant speed. resultant wind speed. +-- weather.resultdir: resultant direction. resultant wind direction. who degree. +-- weather.avgspeed: average speed. average wind speed. if avgspeed is larger: much more wind. +CREATE TABLE weather +( + station_nbr INTEGER, + date DATE, + tmax INTEGER, + tmin INTEGER, + tavg INTEGER, + depart INTEGER, + dewpoint INTEGER, + wetbulb INTEGER, + heat INTEGER, + cool INTEGER, + sunrise TEXT, + sunset TEXT, + codesum TEXT, + snowfall REAL, + preciptotal REAL, + stnpressure REAL, + sealevel REAL, + resultspeed REAL, + resultdir INTEGER, + avgspeed REAL, + primary key (station_nbr, date) +); diff --git a/schemas/shakespeare.sql b/schemas/shakespeare.sql new file mode 100644 index 0000000000000000000000000000000000000000..1490af6fb98954327663de4294457bdf168d7412 --- /dev/null +++ b/schemas/shakespeare.sql @@ -0,0 +1,57 @@ +-- chapters.id: unique id number identifying the chapter. +-- chapters.Act: An act is a major division of a theatre work, including a play, film, opera, or musical theatre. An act can consist of one or more scenes. +-- chapters.Scene: A scene is a dramatic part of a story, at a specific time and place, between specific characters. +-- chapters.Description: textual description of the chapter. +-- chapters.work_id: work id. id number identifying the work. +CREATE TABLE "chapters" +( + id INTEGER + primary key autoincrement, + Act INTEGER not null, + Scene INTEGER not null, + Description TEXT not null, + work_id INTEGER not null, + FOREIGN KEY ("work_id") REFERENCES "works" ("id") +); +-- characters.id: unique id number identifying the characters. +-- characters.CharName: char name. character name. +-- characters.Abbrev: abbreviation. abbreviation. An abbreviation is a shortened form of a word or phrase. +-- characters.Description: description of the character. +CREATE TABLE "characters" +( + id INTEGER + primary key autoincrement, + CharName TEXT not null, + Abbrev TEXT not null, + Description TEXT not null +); +-- paragraphs.id: unique id number identifying the paragraphs. +-- paragraphs.ParagraphNum: paragraph number. unique id number identifying the paragraph number. +-- paragraphs.PlainText: Plain Text. main content of the paragraphs. +-- paragraphs.character_id: character id. unique id number identifying the mentioned character. +-- paragraphs.chapter_id: chapter id. unique id number identifying the related chapter. if number of the paragraphs is > 150, then it means this is a long chapter. +CREATE TABLE "paragraphs" +( + id INTEGER + primary key autoincrement, + ParagraphNum INTEGER not null, + PlainText TEXT not null, + character_id INTEGER not null, + chapter_id INTEGER default 0 not null, + FOREIGN KEY ("chapter_id") REFERENCES "chapters" ("id"), + FOREIGN KEY ("character_id") REFERENCES "characters" ("id") +); +-- works.id: unique id number identifying the work. +-- works.Title: title of the work. the short title or abbreviated title. +-- works.LongTitle: Long Title. full title of the work. +-- works.Date: character id. date of the work. +-- works.GenreType: genre type. the type of the genere. +CREATE TABLE "works" +( + id INTEGER + primary key autoincrement, + Title TEXT not null, + LongTitle TEXT not null, + Date INTEGER not null, + GenreType TEXT not null +); diff --git a/schemas/shipping.sql b/schemas/shipping.sql new file mode 100644 index 0000000000000000000000000000000000000000..7adbcba8103685d19a49a57c321e602215f6f5f7 --- /dev/null +++ b/schemas/shipping.sql @@ -0,0 +1,88 @@ +-- city.city_id: city id. unique identifier for the city. +-- city.city_name: city name. name of the city. +-- city.state: state in which the city is. +-- city.population: population of the city. +-- city.area: square miles the city covers. population density (land area per capita) = area / population. +CREATE TABLE city +( + city_id INTEGER + primary key, + city_name TEXT, + state TEXT, + population INTEGER, + area REAL +); +-- customer.cust_id: customer id. Unique identifier for the customer. +-- customer.cust_name: customer name. Business name of the customer. +-- customer.annual_revenue: annual revenue. Annual revenue of the customer. +-- customer.cust_type: customer type. Whether the customer is a manufacturer or a wholes. +-- customer.address: Physical street address of the customer. +-- customer.city: City of the customer's address. +-- customer.state: State of the customer's address. please mention its full name in the question, by referring to. https://www23.statcan.gc.ca/imdb/p3VD.pl?Function=getVD&TVD=53971. e.g., NY --> New York. +-- customer.zip: Postal code of the customer's address. +-- customer.phone: Telephone number to reach the customer. +CREATE TABLE customer +( + cust_id INTEGER + primary key, + cust_name TEXT, + annual_revenue INTEGER, + cust_type TEXT, + address TEXT, + city TEXT, + state TEXT, + zip REAL, + phone TEXT +); +-- driver.driver_id: driver id. Unique identifier for the driver. +-- driver.first_name: first name. First given name of the driver. +-- driver.last_name: last name. Family name of the driver. full name = first_name + last_name. +-- driver.address: Street address of the driver's home. +-- driver.city: City the driver lives in. +-- driver.state: State the driver lives in. please mention its full name in the question, by referring to. https://www23.statcan.gc.ca/imdb/p3VD.pl?Function=getVD&TVD=53971. e.g., NY --> New York. +-- driver.zip_code: zip code. postal code of the driver's address. +-- driver.phone: telephone number of the driver. +CREATE TABLE driver +( + driver_id INTEGER + primary key, + first_name TEXT, + last_name TEXT, + address TEXT, + city TEXT, + state TEXT, + zip_code INTEGER, + phone TEXT +); +-- shipment.ship_id: ship id. Unique identifier of the shipment. +-- shipment.cust_id: customer id. A reference to the customer table that indicates which customer the shipment is for. +-- shipment.weight: The number of pounds being transported on the shipment. +-- shipment.truck_id: truck id. A reference to the truck table that indicates which truck is used in the shipment. +-- shipment.driver_id: driver id. A reference to the driver table that indicates which driver transported the goods in the shipment. +-- shipment.city_id: city id. A reference to the city table that indicates the destination of the shipment. +-- shipment.ship_date: ship date. the date the items were received by the driver. yyyy-mm-dd. +CREATE TABLE shipment +( + ship_id INTEGER + primary key, + cust_id INTEGER, + weight REAL, + truck_id INTEGER, + driver_id INTEGER, + city_id INTEGER, + ship_date TEXT, + FOREIGN KEY ("truck_id") REFERENCES "truck" ("truck_id"), + FOREIGN KEY ("driver_id") REFERENCES "driver" ("driver_id"), + FOREIGN KEY ("city_id") REFERENCES "city" ("city_id"), + FOREIGN KEY ("cust_id") REFERENCES "customer" ("cust_id") +); +-- truck.truck_id: truck id. Unique identifier of the truck table. +-- truck.make: The brand of the truck. • Peterbilt headquarter: Texas (TX). • Mack headquarter: North Carolina (NC). • Kenworth headquarter: Washington (WA). can ask question about headquarters of the truck. +-- truck.model_year: model year. The year the truck was manufactured. The truck with earlier model year means this truck is newer. +CREATE TABLE truck +( + truck_id INTEGER + primary key, + make TEXT, + model_year INTEGER +); diff --git a/schemas/shooting.sql b/schemas/shooting.sql new file mode 100644 index 0000000000000000000000000000000000000000..2566bd56d07fd3668c0f14b294b8cd7fd7cd0cde --- /dev/null +++ b/schemas/shooting.sql @@ -0,0 +1,52 @@ +-- incidents.case_number: case number. +-- incidents.date: date. +-- incidents.location: location. +-- incidents.subject_statuses: subject statuses. statuses of the victims. +-- incidents.subject_weapon: subject weapon. +-- incidents.subjects: subjects. +-- incidents.subject_count: subject_count. +-- incidents.officers: officers. +CREATE TABLE incidents +( + case_number TEXT not null + primary key, + date DATE not null, + location TEXT not null, + subject_statuses TEXT not null, + subject_weapon TEXT not null, + subjects TEXT not null, + subject_count INTEGER not null, + officers TEXT not null +); +-- officers.case_number: case number. +-- officers.race: No description. +-- officers.gender: gender. M: male; F: female. +-- officers.last_name: last name. +-- officers.first_name: first name. +-- officers.full_name: full name. +CREATE TABLE officers +( + case_number TEXT not null, + race TEXT null, + gender TEXT not null, + last_name TEXT not null, + first_name TEXT null, + full_name TEXT not null, + FOREIGN KEY ("case_number") REFERENCES "incidents" ("case_number") +); +-- subjects.case_number: case number. +-- subjects.race: No description. +-- subjects.gender: gender. M: male; F: female. +-- subjects.last_name: last name. +-- subjects.first_name: first name. +-- subjects.full_name: full name. +CREATE TABLE subjects +( + case_number TEXT not null, + race TEXT not null, + gender TEXT not null, + last_name TEXT not null, + first_name TEXT null, + full_name TEXT not null, + FOREIGN KEY ("case_number") REFERENCES "incidents" ("case_number") +);