CREATE TABLE "User" (
	"UserID"	INTEGER NOT NULL,
	"Username"	TEXT,
	"Verified"	TEXT,
	"Followers"	INTEGER,
	PRIMARY KEY("UserID")
);
CREATE TABLE "Tweet" (
	"TweetID"	INTEGER NOT NULL,
	"UserID"	INTEGER NOT NULL,
	"Content"	TEXT,
	CONSTRAINT FK_UserID
	FOREIGN KEY("UserID") REFERENCES "User"("UserID")
		ON DELETE CASCADE,
	PRIMARY KEY("TweetID")
);
CREATE TABLE "Comments" (
	"CommentID"	INTEGER NOT NULL,
	"UserID"	INTEGER NOT NULL,
	"TweetID"	INTEGER,
	"FK_CommentID"	INTEGER,
	"Content"	TEXT,
	CONSTRAINT FK_UserID
	FOREIGN KEY("UserID") REFERENCES "User"("UserID")
		ON DELETE CASCADE,
	CONSTRAINT FK_CommentID
	FOREIGN KEY("FK_CommentID") REFERENCES "Comments"("CommentID")
		ON DELETE CASCADE,
	CONSTRAINT FK_TweetID
	FOREIGN KEY("TweetID") REFERENCES "Tweet"("TweetID")
		ON DELETE CASCADE,
	PRIMARY KEY("CommentID")
);
CREATE TABLE "Likes" (
	"LikeID"	INTEGER NOT NULL,
	"UserID"	INTEGER NOT NULL,
	"TweetID"	INTEGER,
	"CommentID"	INTEGER,
	PRIMARY KEY("LikeID"),
	CONSTRAINT FK_UserID
	FOREIGN KEY("UserID") REFERENCES "User"("UserID")
		ON DELETE CASCADE,
	CONSTRAINT FK_CommentID
	FOREIGN KEY("CommentID") REFERENCES "Comments"("CommentID")
		ON DELETE CASCADE,
	CONSTRAINT FK_TweetID
	FOREIGN KEY("TweetID") REFERENCES "Tweet"("TweetID")
		ON DELETE CASCADE
);
CREATE TABLE "Hashtag" (
	"HashtagID"	INTEGER,
	"Content"	TEXT,
	PRIMARY KEY("HashtagID")
);
CREATE TABLE "HashtagsInContent" (
	"HashtagID"	INTEGER NOT NULL,
	"TweetID"	INTEGER,
	"CommentID"	INTEGER,
	CONSTRAINT FK_HashtagID
	FOREIGN KEY("HashtagID") REFERENCES "Hashtag"("HashtagID")
		ON DELETE CASCADE,
	CONSTRAINT FK_TweetID
	FOREIGN KEY("TweetID") REFERENCES "Tweet"("TweetID")
		ON DELETE CASCADE,
	CONSTRAINT FK_CommentID
	FOREIGN KEY("CommentID") REFERENCES "Comments"("CommentID")
		ON DELETE CASCADE
)


