0% found this document useful (0 votes)
9 views5 pages

Schema

The document outlines the schema for a database with various entity sets including user roles, profiles, logins, friend requests, and posts. Each entity set includes attributes, primary keys, and foreign key constraints that define relationships between entities. The schema supports functionalities such as user management, social interactions, content sharing, and privacy settings.

Uploaded by

aby.ivy007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Schema

The document outlines the schema for a database with various entity sets including user roles, profiles, logins, friend requests, and posts. Each entity set includes attributes, primary keys, and foreign key constraints that define relationships between entities. The schema supports functionalities such as user management, social interactions, content sharing, and privacy settings.

Uploaded by

aby.ivy007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Entity set Attributes Constraints

user_role role_id : numeric(5), PRIMARY KEY :


role_name : varchar2(10), role_id
create_date : date
user_profile user_id : numeric(20), PRIMARY KEY :
f_name : varchar2(50) NOT NULL, User_id
l_name : varchar2(50) NOT NULL,
nick_name : varchar2(50) NOT NULL,
dob : date NOT NULL,
interest : vicar(500),
gender : vicar(10) NOT NULL,
current_location : varchar2(50),
language_known : varchar2(100),
profilepic_url : varchar2(500)
user_login user_id : Numeric(20) , FOREIGN KEY :
username : varchar2(50) NOT NULL, (role_Id) references
password : varchar2(50) NOT NULL, user_role (role_Id),
email : varchar2(30) NOT NULL, (user_Id) references
create_date : date, user_profile (user_Id)
last_login : date,
last_passchange : date,
is_active : char(1) NOT NULL,
is_locked : char(1) NOT NULL,
role_id : numeric(5)
friend_request request_id : numeric(10), PRIMARY KEY :
from_id : numeric(20) NOT NULL, request_id
to_id : numeric(20) NOT NULL, FOREIGN KEY :
flag : char(1) NOT NULL, (from_id) references
request_date :date NOT NULL, user_Profile (user_Id),
accept_date : date, (to_Id) references
comment : varchar2(500) user_profile (user_Id)
friend_group_ group_id : numeric(20), primary key : group_id
mast user_id : numeric(20), FOREIGN KEY :
group_name : varchar2(50) NOT NULL (user_id) references
user_Profile (user_Id)
friend_list user1_id : numeric(20) NOT NULL, FOREIGN KEY :
user2_id : numeric(20) NOT NULL, (user1_id) references
group_id : numeric(20) NOT NULL user_Profile (user_Id),
(user2_Id) references
user_profile (user_Id),
(group_id) references
friend_group_mast
(group_id)
Primary Key :
user1_id,user2_id,gropu
e_id
block_friend user_id : numeric(20) NOT NULL, FOREIGN KEY
blocked_user_id : numeric(20) NOT (user_id) references
NULL, user_Profile (user_Id),
(blocked_user_id)
references user_profile
(user_Id)
table not_id : numeric(20), primary key : not_id
notification user_id : numeric(20) not NULL, FOREIGN KEY :
details : varchar2(500) not null, flag : (user_id) references
char(1) NOT NULL, user_Profile (user_Id)
entry_time : date NOT NULL,
read_time : Date
wall_post post_id : numeric(20) primary KEY : post_id
from_user_id : numeric(20) NOT NULL, FOREIGN KEY :
to_user_id : numeric(20) NOT NULL, (from_user_id)
detail : varchar(700) NOT NULL, references user_Profile
post_date : Date NOT NULL (user_Id), (to_user_id)
references user_profile
(user_Id)
wall_post_det u_id : numeric(20), primary key : u_id
ail post_id : numeric(20) NOT NULL, FOREIGN KEY
user_id : numeric(20) not null, (user_id) references
type : char(2) NOT NULL, user_Profile (user_Id),
detail : varchar2(500) not NULL, (post_id) references
create_date : date not NULL, wall_post (post_id)
place_master place_id : numeric(20), primary key : place_id
user_id : numeric(20) NOT NULL, FOREIGN KEY :
place_name : varchar2(100) NOT NULL, (user_id) references
location :varchar2(100) NOT NULL, user_Profile (user_Id)
city : varchar2(100) NOT NULL,
state : varchar2(100) NOT NULL,
Country : varchar2(100) NOT NULL,
lat : varchar2(20) NOT NULL,
lon : varchar2(20) NOT NULL,
detail : varchar2(500) NOT NULL,
pic_url : varchar(500),
tags : varchar2(500)
place_review palce_id : numeric(20) NOT NULL, PRIMARY KEY :
user_id : numeric(20) NOT NULL, place_id,user_id
experience : varchar2(800) NOT NULL, FOREIGN KEY :
rating : int, (user_id) references
entry_date : date NOT NULL, user_Profile (user_Id),
(place_id) references
place_master (place_id)
user_place_su user_id : numeric(20) NOT NULL, PRIMARY KEY :
b place_id : numeric(20) NOT NULL, place_id,user_id
sub_date : date NOT NULL FOREIGN KEY :
(user_id) references
user_Profile (user_Id),
(place_id) references
place_master (place_id)

user_wishlist user_id : numerci(20) , PRIMARY KEY :


palce_id : numeric(20) , place_id,user_id
flag : char(1) FOREIGN KEY :
(user_id) references
user_Profile (user_Id),
(place_id) references
place_master (place_id)
blog_master blog_id : numeric(20), primary key : blog_id
user_id : numeric(20) NOT NULL, FOREIGN KEY :
blog_name : varchar2(200) NOT NULL, (user_id) references
detail : varchar2(500) , user_Profile (user_Id)
create_date : date NOT NULL,
last_update : date,
blog_post blog_id : numeric(20) NOT NULL, FOREIGN KEY
post_id : numeric(20) primary key, (blog_id) references
post_title : varchar2(100) NOT NULL, blog_master (blog_id)
post_detail : varchar(1000) NOT NULL,
post_date : date NOT NULL,
tags : varcahr2(500)
blog_sub user_id : numeric(20) NOT NULL, FOREIGN KEY :
blog_id : numeric(20) NOT NULL, (blog_id) references
sub_date : date blog_master (blog_id),
(user_id) references
user_profile (user_id)
PRIMARY KEY :
blog_id,user_id
picvid_album album_id : numeric(20), PRIMARY KEY :
user_id : numeric(20) NOT NULL, album_id
album_name : varchar2(100) NOT NULL, FOREIGN KEY :
create_date : date NOT NULL, (user_id) references
user_profile (user_id)
picvid picvid_id : numeric(20), primary key : picvid_id
type : varhcar2(2) NOT NULL, FOREIGN KEY
content_type : varchar2(20) NOT NULL, (album_id) references
link_id : numeric(20) NOT NULL, picvid_album
url : varcahr2(500) NOT NULL, (album_id),
album_id : numeric(20) (user_id) references
add_time : date not NULL, user_profile (user_id)
picvid_comm picvid_id : numeric(20) NOT NULL, PRIMARY_KEY :
ent comment_id : numeric(20), comment_id
user_id : numeric(20) NOT NULL, FOREIGN KEY:
comment : varchar2(500) NOT NULL, (user_id) references
create_date : date NOT NULL, user_profile (user_id),
(picvid_id) references
picvid (picvid_id)
forum_maste topic_id : numeric(20), primary key : topic_id
topic_name : varhcar2(200) NOT NULL
forum_thread topic_id : numeric(20) NOT NULL, PRIMARY KEY :
thread_id : numeric(20), thread_id
user_id : numeric(20) NOT NULL, FOREIGN KEY :
thread_title : varchar2(500) NOT NULL, (user_id) references
view : int NOT NULL, user_profile (user_id),
create_date : date NOT NULL, (topic_id) references
tags : varchar2(500), forum_maste (topic_id)
forum_post thread_id : numeric(20) not null, primary key: u_id
u_id : numeric(20) FOREIGN KEY
user_id : numeric(20) NOT NULL, (user_id) references
post : varchar2(5000) NOT NULL, user_profile (user_id),
post_date : date NOT NULL, (thread_id) references
tags : varchar2(500), forum_thread
(thread_id)
user_location u_id : numeric(20), primary key : u_id
user_id : numeric(20) N0T null, FOREIGN KEY :
lat : varchar2(10) NOT NULL, (user_id) references
long : varchar2(10) NOT NULL, user_profile (user_id)
add_date : date NOT NULL,
event_master event_id : numeric(20), primary key : event_id
user_id : numeric(20) NOT NULL, FOREIGN KEY :
event_name : varchar2(200) NOT NULL, (user_id) references
creat_date : date NOT NULL, user_profile (user_id)
event_time : varchar2(50) NOT NULL,
pic_url : varchar2(500),
event_share event_id : numeric(20) NOT NULL, FOREIGN KEY:
user_id : numeric(20) NOT NULL, (user_id) references
touser_id : numeric(20) NOT NULL, user_profile (user_id),
flag : char(2) (Touser_id) references
user_profile (user_id),
(event_id) references
event_master (user_id)
PRIMARY KEY :
user_id, user_id,
to_userid
user_message msg_id : numeric(20), PRIMARY KEY:
fuser_id : numeric(20) NOT NULL, msg_id
tuser_id : numeric(20) NOT NULL, FOREIGN KEY :
msg : varchar2(5000), (fuser_id) references
type : char(2) not null, user_profile (user_id),
send_time : date NOT NULL, (tuser_id) references
flag : char(2) NOT NULL user_profile (user_id),
(fuser_id) references
user_profile (user_id)
user_privacy u_id : numeric(20) , FOREIGN KEY
user_id : numeric(20) NOT NULL, (user_id) references
content_type : varchar(20) NOT NULL, user_profile (user_id)
link_id : numeric (20) NOT NULL, PRIMARY KEY: u_id
user_privacy_ u_id : numeric(20), FOREIGN KEY :u_id
detail link_id : numeric(20), references user_privacy
(u_id),

PRIMARY KEY
:u_id,link_id
photo_tag tag_id : numeric(20) , PRIMARY KEY :tag_id
u_id : numeric(20) NOT NULL, FOREIGN KEY (u_id)
user_id : numeric(20) NOT NULL, references picvid (u_id),
dimension : varchar2(20) NOT NULL,
tagged_by : numeric(20) NOT NULL, FOREIGN KEY
(tagged_by) references
user_profile (user_id)

FOREIGN KEY
(user_id) references
user_profile (user_id)

You might also like