0% found this document useful (0 votes)
36 views

CREATE TABLE IF NOT EXISTS 'Facebook - Likes - Track' (

The document contains SQL commands to create 5 tables in a database: 1) A "facebook_likes_track" table to track likes on posts and comments. 2) A "facebook_posts" table to store post details like content, author, likes, media etc. 3) A "facebook_posts_comments" table to store comments on posts. 4) A "member" table to store user profile details. 5) The tables are created with the necessary fields and indexes if they don't already exist.

Uploaded by

kurocaki
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

CREATE TABLE IF NOT EXISTS 'Facebook - Likes - Track' (

The document contains SQL commands to create 5 tables in a database: 1) A "facebook_likes_track" table to track likes on posts and comments. 2) A "facebook_posts" table to store post details like content, author, likes, media etc. 3) A "facebook_posts_comments" table to store comments on posts. 4) A "member" table to store user profile details. 5) The tables are created with the necessary fields and indexes if they don't already exist.

Uploaded by

kurocaki
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

CREATE TABLE IF NOT EXISTS `facebook_likes_track` (

`id` int(11) NOT NULL AUTO_INCREMENT,


`post_id` int(11) NOT NULL,
`comment_id` int(11) NOT NULL,
`member_id` int(11) NOT NULL,
PRIMARY KEY (`id`)

CREATE TABLE IF NOT EXISTS `facebook_posts` (
`p_id` int(11) NOT NULL AUTO_INCREMENT,
`post` text NOT NULL,
`type` varchar(55) NOT NULL,
`value` int(11) NOT NULL,
`date_created` int(11) NOT NULL,
`userid` int(11) NOT NULL,
`posted_by` int(11) NOT NULL,
`likes` int(11) NOT NULL,
`media` int(11) NOT NULL,
`uip` varchar(222) NOT NULL,
`title` varchar(255) NOT NULL,
`description` text NOT NULL,
`url` text NOT NULL,
`cur_image` text NOT NULL,
`post_type` tinyint(1) NOT NULL,
PRIMARY KEY (`p_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `facebook_posts_comments` (
`c_id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) NOT NULL,
`comments` text NOT NULL,
`date_created` int(11) NOT NULL,
`post_id` int(11) NOT NULL,
`clikes` int(11) NOT NULL,
`uip` varchar(222) NOT NULL,
PRIMARY KEY (`c_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE IF NOT EXISTS `member` (
`member_id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(100) NOT NULL,
`password` varchar(50) NOT NULL,
`firstname` varchar(30) NOT NULL,
`lastname` varchar(40) NOT NULL,
`picture` varchar(100) NOT NULL,
`gender` varchar(2) NOT NULL,
PRIMARY KEY (`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

You might also like