-- Mar 17 In-Class Exercise
CREATE TABLE Users (
uid INT PRIMARY KEY,
fname STRING,
lname STRING
)
CREATE TABLE Posts (
pid INT PRIMARY KEY,
uid INT REFERENCES Users(uid),
content STRING,
popularity INT,
timestamp DATE
)
Functional Dependencies:
Users
uid → (fname, lname)
Posts
pid → (uid, content, popularity, timestamp)
Is this in BCNF?
Yes, because the left side of each FD is a key for the table.(
Edited: 2021-03-17)
<pre>
CREATE TABLE Users (
uid INT PRIMARY KEY,
fname STRING,
lname STRING
)
</pre>
<pre>
CREATE TABLE Posts (
pid INT PRIMARY KEY,
uid INT REFERENCES Users(uid),
content STRING,
popularity INT,
timestamp DATE
)
</pre>
<br><br>
Functional Dependencies:<br>
Users<br>
uid → (fname, lname)
<br>
Posts<br>
pid → (uid, content, popularity, timestamp)
<br><br>
Is this in BCNF?
<br>
Yes, because the left side of each FD is a key for the table.