CREATE TABLE users(
user_id INT PRIMARY KEY,
username VARCHAR(50) UNIQUE,
first_name VARCHAR(50),
last_name VARCHAR(50),
dob DATE,
join_date DATE,
gender VARCHAR(50),
email_id VARCHAR(50) UNIQUE
);
CREATE TABLE posts(
post_id INT PRIMARY KEY,
user_id INT,
posting_date DATETIME,
content VARCHAR(50),
caption VARCHAR(200),
FOREIGN KEY(user_id) references users(user_id)
);
CREATE TABLE likes(
like_id INT PRIMARY KEY,
user_id INT,
post_id INT,
like_date DATETIME,
FOREIGN KEY(user_id) references users(user_id),
FOREIGN KEY(post_id) references posts(post_id)
);
CREATE TABLE comments(
comment_id INT PRIMARY KEY,
user_id INT,
post_id INT,
comment_date DATETIME,
comment_text TEXT,
FOREIGN KEY(user_id) references users(user_id),
FOREIGN KEY(post_id) references posts(post_id)
);
INSERT INTO users VALUES
(101,"priya550","Priya","Sharma","2005-10-11","2022-05-06","Female","priyasharma123@gmail.com"),
(102,"julia345","Julia","Roberts","2002-10-01","2024-05-21","Female","juliaroberts123@gmail.com"),
(103,"rahul2002","Rahul","Roy","2000-06-31","2018-10-06","Male","rahulroy123@gmail.com"),
(104, 'sneha_24', 'Sneha', 'Gupta', '2003-02-14', '2025-04-05', 'Female', 'sneha@gmail.com'),
(105, 'arjun_25', 'Arjun', 'Sen', '2002-09-18', '2025-05-12', 'Male', 'arjun@gmail.com');
INSERT INTO posts VALUES
(201, 101, '2026-10-01 10:30:00', 'image1.jpg', 'My first post!'),
(202, 102, '2026-10-02 12:00:00', 'image2.jpg', 'Beautiful day!'),
(203, 103, '2026-10-03 15:45:00', 'video1.mp4', 'Travel diaries'),
(204, 101, '2026-10-05 18:20:00', 'image3.jpg', 'Weekend vibes');
INSERT INTO likes VALUES
(301, 102, 201, '2026-10-01 11:00:00'),
(302, 103, 201, '2026-10-01 11:30:00'),
(303, 104, 201, '2026-10-01 12:00:00'),
(304, 101, 202, '2026-10-02 13:00:00'),
(305, 103, 202, '2026-10-02 14:00:00');
INSERT INTO comments VALUES
(401, 102, 201, '2026-10-01 11:15:00', 'Amazing picture!'),
(402, 103, 201, '2026-10-01 11:45:00', 'Looking great!'),
(403, 104, 201, '2026-10-01 12:15:00', 'Beautiful'),
(404, 101, 202, '2026-10-02 13:30:00', 'Lovely post'),
(405, 105, 202, '2026-10-02 14:30:00', 'Keep it up!'),
(406, 102, 203, '2026-10-03 17:00:00', 'Where is this place?');
To embed this project on your website, copy the following code and paste it into your website's HTML: