Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DBS-project
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hlm
DBS-project
Commits
432f4acc
Commit
432f4acc
authored
7 years ago
by
Maria Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
part 1: database script
parent
14d14789
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
db_skript.sql
+29
-0
29 additions, 0 deletions
db_skript.sql
with
29 additions
and
0 deletions
db_skript.sql
0 → 100644
+
29
−
0
View file @
432f4acc
CREATE
TABLE
twitter_user
(
id
serial
PRIMARY
KEY
,
handle
text
NOT
NULL
UNIQUE
);
CREATE
TABLE
hashtag
(
id
serial
PRIMARY
KEY
,
hash_tag_text
text
NOT
NULL
);
CREATE
TABLE
tweet
(
id
serial
PRIMARY
KEY
,
retweet_count
int
NOT
NULL
DEFAULT
0
,
favorite_count
int
NOT
NULL
DEFAULT
0
,
tweet_text
text
NOT
NULL
,
tweet_time
timestamp
NOT
NULL
,
original_author
text
,
CONSTRAINT
vorgaenger_ID
FOREIGN
KEY
(
id
)
REFERENCES
tweet
(
id
)
);
CREATE
TABLE
tweet_hat_hashtag
(
FK_tweet
integer
,
FK_hashtag
integer
,
hashtag_text
text
NOT
NULL
,
FOREIGN
KEY
(
FK_tweet
)
REFERENCES
tweet
(
id
)
ON
UPDATE
CASCADE
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
FK_hashtag
)
REFERENCES
hashtag
(
id
)
ON
UPDATE
CASCADE
ON
DELETE
CASCADE
,
PRIMARY
KEY
(
FK_tweet
,
FK_hashtag
)
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment