[ Prev ]
2021-03-17

-- Mar 17 In-Class Exercise
USER(USER_ID, USERNAME, EMAIL, PASSWORD) POST(POST_ID, USERID, POST, POPULARITY) USER_ID → USERNAME, EMAIL, PASSWORD POST_ID → USERID, POST, POPULARITY
My tables are in BCNF
USER(USER_ID, USERNAME, EMAIL, PASSWORD) POST(POST_ID, USERID, POST, POPULARITY) USER_ID → USERNAME, EMAIL, PASSWORD POST_ID → USERID, POST, POPULARITY My tables are in BCNF

-- Mar 17 In-Class Exercise
users(user_id, username, email, password) post(post_id, user_id, post, likes) user_id -> username, email, password post_id -> user_id, post, likes
These tables are in BCNF
users(user_id, username, email, password) post(post_id, user_id, post, likes) user_id -> username, email, password post_id -> user_id, post, likes These tables are in BCNF

-- Mar 17 In-Class Exercise
 Functional dependencies:
 USERID, PASSWORD--> USERNAME, EMAIL
 POST--> USERID, PCONTENT, PTIME, PPOPULARITY.
 Tables:
 USER(USERID, PASSWORD, USERNAME, EMAIL)
 POST(USERID, POST, PCONTENT, PTIME, PPOPULARITY)
 My tables are in BCNF because the left elements fix the rest elements.
 For the USER table, if we know USERID and PASSWORD, we know USERNAME and EMAIL.
 For the POST table, if we know POST, we know USERID, PCONTENT, PTIME, and PPOPULARITY.
(Edited: 2021-03-17)
Functional dependencies: USERID, PASSWORD--> USERNAME, EMAIL POST--> USERID, PCONTENT, PTIME, PPOPULARITY. Tables: USER(USERID, PASSWORD, USERNAME, EMAIL) POST(USERID, POST, PCONTENT, PTIME, PPOPULARITY) My tables are in BCNF because the left elements fix the rest elements. For the USER table, if we know USERID and PASSWORD, we know USERNAME and EMAIL. For the POST table, if we know POST, we know USERID, PCONTENT, PTIME, and PPOPULARITY.

-- Mar 17 In-Class Exercise
-------------------------------------- Types -------------------------------------- UID string USERNAME string EMAIL string PW string PID int TEXT string UPVOTES int -------------------------------------- Functional Dependencies -------------------------------------- UID --> USERNAME, PW, EMAIL PID --> UID, TEXT, UPVOTES -------------------------------------- Tables -------------------------------------- USER(UID, USERNAME, EMAIL, PW) POST(PID, UID, TEXT, UPVOTES) -------------------------------------- Reasoning -------------------------------------- The tables are BCNF because knowing the UID in the USER table will fix the entire row: USERNAME, EMAIL, and PW, and knowing the PID in the POST table will resolve the row containing UID, TEXT, and UPVOTES.
(Edited: 2021-03-17)
<nowiki> -------------------------------------- Types -------------------------------------- UID string USERNAME string EMAIL string PW string PID int TEXT string UPVOTES int -------------------------------------- Functional Dependencies -------------------------------------- UID --> USERNAME, PW, EMAIL PID --> UID, TEXT, UPVOTES -------------------------------------- Tables -------------------------------------- USER(UID, USERNAME, EMAIL, PW) POST(PID, UID, TEXT, UPVOTES) -------------------------------------- Reasoning -------------------------------------- The tables are BCNF because knowing the UID in the USER table will fix the entire row: USERNAME, EMAIL, and PW, and knowing the PID in the POST table will resolve the row containing UID, TEXT, and UPVOTES.</nowiki>

-- Mar 17 In-Class Exercise
USERS(USERID, USERNAME) POSTS(POSTID, USERID, CONTENT, POPULARITY) USERID -> USERNAME POSTID -> USERNAME, CONTENT, POPULARITY
(Edited: 2021-03-18)
USERS(USERID, USERNAME) POSTS(POSTID, USERID, CONTENT, POPULARITY) USERID -> USERNAME POSTID -> USERNAME, CONTENT, POPULARITY
2021-03-22

-- Mar 17 In-Class Exercise
USER(USERID, EMAIL, PASSWORD, USERNAME) POST(POSTID, USERID, LIKES, POSETDESC) functional dep: USERID -> EMAIL, PASSWORD, USERNAME POSTID -> USERID, LIKES, POSTDESC
USER(USERID, EMAIL, PASSWORD, USERNAME) POST(POSTID, USERID, LIKES, POSETDESC) functional dep: USERID -> EMAIL, PASSWORD, USERNAME POSTID -> USERID, LIKES, POSTDESC
X