-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQL-Conceptual model.txt
90 lines (83 loc) · 2.34 KB
/
SQL-Conceptual model.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
CREATE TABLE `Tweet_Mentions` (
`tweet_id` Integer,FK,
`source` String,
`target_user` String
);
CREATE TABLE `MBTA` (
`tweet_id` Integer,FK,
`created_at` DateTime,
`tweet_text` String ,FK,
`location` String,
`followers_count` Integer,
`favourites_count` Integer,
`retweet_count` Integer,
`source` String,
`description` String,
`verified_account` boolean,
`status_count` Integer,
`user_account_created` DateTime,
`listed_counted ` Integer
);
CREATE TABLE `Uber` (
`tweet_id` Integer,FK,
`created_at` DateTime,
`tweet_text` String ,FK,
`user_name` String,
`followers_count` Integer,
`retweet_count` Integer,
`language` String,
`hastag` String,
`source` String,
`verified_account` boolean,
FOREIGN KEY (`tweet_text`) REFERENCES `Tweets`(`tweet_text`)
);
CREATE TABLE `LYFT ` (
`tweet_id` Integer,FK,
`created_at` DateTime,
`tweet_text` String ,FK,
`user_name` String,
`followers_count` Integer,
`retweet_count` Integer,
`language` String,
`hastag` String,
`source` String,
`verified_account` boolean
);
CREATE TABLE `RESULT(UBER_LYFT)` (
`tweet_id` Integer,FK,
`created_at` DateTime,
`tweet_text` String ,FK,
`user_name` String,
`followers_count` Integer,
`retweet_count` Integer,
`language` String,
`hastag` String,
`source` String,
`verified_account` boolean
);
CREATE TABLE `User` (
`tweet_id` Integer,PK,
`name` String ,
`description` String ,
`followers_count` Integer,
`friends_count` Integer,
FOREIGN KEY (`name`) REFERENCES `Tweet_Mentions`(`tweet_id`),
FOREIGN KEY (`tweet_id`) REFERENCES `MBTA`(`tweet_id`),
FOREIGN KEY (`tweet_id`) REFERENCES `Uber`(`tweet_id`),
FOREIGN KEY (`tweet_id`) REFERENCES `LYFT `(`tweet_id`),
FOREIGN KEY (`tweet_id`) REFERENCES `RESULT(UBER_LYFT)`(`tweet_id`)
);
CREATE TABLE `Tweets` (
`tweet_id` Integer,FK,
`tweet_text` String,PK,
`created_at` DateTime,
FOREIGN KEY (`tweet_id`) REFERENCES `User`(`tweet_id`),
FOREIGN KEY (`tweet_text`) REFERENCES `LYFT `(`tweet_text`),
FOREIGN KEY (`tweet_text`) REFERENCES `RESULT(UBER_LYFT)`(`tweet_text`),
FOREIGN KEY (`tweet_text`) REFERENCES `MBTA`(`tweet_text`)
);
CREATE TABLE `Tweet_Tags` (
`tweet_id` Integer,FK,
`tags` String,
FOREIGN KEY (`tweet_id`) REFERENCES `User`(`tweet_id`)
);