2018-09-05

Sep. 5 In-Class Exercise Thread.

Post your solutions to the Sep 5 In-Class Exercise to this thread.
Best,
Chris
(Edited: 2018-09-05)
Post your solutions to the Sep 5 In-Class Exercise to this thread. Best, Chris

-- Sep. 5 In-Class Exercise Thread
Discussion(postId:integer, userId:integer, message:string, date:string, votes:integer)
(1, 1, "Hello, this is a test post", "12/12/12", 0) (2, 3, "Hello, World!", "10/10/10", 100) (100, 6, "askejsk", "01/02/18", 1337)
Key for discussion comments: postId
(Edited: 2018-09-05)
Discussion(postId:integer, userId:integer, message:string, date:string, votes:integer) (1, 1, "Hello, this is a test post", "12/12/12", 0) (2, 3, "Hello, World!", "10/10/10", 100) (100, 6, "askejsk", "01/02/18", 1337) Key for discussion comments: postId

-- Sep. 5 In-Class Exercise Thread
Post(userId:string, postId:integer, message:string)
Some example tuples:
(adala123, 12345, Hello everyone)
(student4, 12346, Hello to you too)
(anotherperson, 12347, Hi)
An example key:
postId
(Edited: 2018-09-05)
Post(userId:string, postId:integer, message:string)<br> Some example tuples:<br> (adala123, 12345, Hello everyone)<br> (student4, 12346, Hello to you too)<br> (anotherperson, 12347, Hi)<br> An example key:<br> postId

-- Sep. 5 In-Class Exercise Thread
posts(user_id:integer, author:string, content:string)
Example Tuples: (0001, "John", "This is an example post.") (9283, "Eve", "This is another example post.")
In this case, each user_id would be unique, so that could be used as the key.
posts(user_id:integer, author:string, content:string) Example Tuples: (0001, "John", "This is an example post.") (9283, "Eve", "This is another example post.") In this case, each user_id would be unique, so that could be used as the key.

-- Sep. 5 In-Class Exercise Thread
Discussion [ userid:integer, postID:integer, comment: string, date:string] Example tuple:
(1(identification #), (1P), "This is my first post", 9/5/18)
An example of a key would be the postid.
(Edited: 2018-09-05)
Discussion [ userid:integer, postID:integer, comment: string, date:string] Example tuple: (1(identification #), (1P), "This is my first post", 9/5/18) An example of a key would be the postid.

-- Sep. 5 In-Class Exercise Thread
 Discussion(user_id:String, timestamp:date, content:String)
 example: ("johndoe", '2018-02-22', "I love cheese")
 The key would be the combination of the user and the timestamp attributes
(Edited: 2018-09-05)
Discussion(user_id:String, timestamp:date, content:String) example: ("johndoe", '2018-02-22', "I love cheese") The key would be the combination of the user and the timestamp attributes

-- Sep. 5 In-Class Exercise Thread
Relation: (username:string, date posted:string, title of post:string, post:string)
Example tuples: (Amit.ranganathan, 11/11/2018, test post, hello this is a test post),
                           (CSStudent1, 02/23/2017, life of a student, life sucks being a student. It is a lot of work)
Key: username
Relation: (username:string, date posted:string, title of post:string, post:string) Example tuples: (Amit.ranganathan, 11/11/2018, test post, hello this is a test post), (CSStudent1, 02/23/2017, life of a student, life sucks being a student. It is a lot of work) Key: username

-- Sep. 5 In-Class Exercise Thread
 Post(name: string, timestamp: timestamp, body: string, message_uuid: string)
 (Conover Wang, 1536182605, this is the body of the discussion post, ABCD-f8adjk-asds00akda)
 (John Doe, 1536182605, this is the body of the discussion post, CBCA-f8adjk-asds00akda)
a key could be the timestamp + uuid
(Edited: 2018-09-05)
Post(name: string, timestamp: timestamp, body: string, message_uuid: string) (Conover Wang, 1536182605, this is the body of the discussion post, ABCD-f8adjk-asds00akda) (John Doe, 1536182605, this is the body of the discussion post, CBCA-f8adjk-asds00akda) a key could be the timestamp + uuid

-- Sep. 5 In-Class Exercise Thread
DiscussionBoard(name:string, studentId:integer, message:string, date:string) example tuple: (Monsi, 0001, here is my post, 08/05/2018) example key: studentId
(Edited: 2018-09-05)
DiscussionBoard(name:string, studentId:integer, message:string, date:string) example tuple: (Monsi, 0001, here is my post, 08/05/2018) example key: studentId

-- Sep. 5 In-Class Exercise Thread
Relation: Thread(postId:integer, createdAt:string, message:string, depth:integer, parent:integer)
Examples: (17, 2017-10-05T14:48:00.000Z, test, 0, 0)
(20, 2018-03-02T10:12:30.000Z, reply to test, 1, 17)
(21, 2018-3-05T19:33:00.000Z, wow, 0, 0)
(Edited: 2018-09-05)
Relation: Thread(postId:integer, createdAt:string, message:string, depth:integer, parent:integer) Examples: (17, 2017-10-05T14:48:00.000Z, test, 0, 0) (20, 2018-03-02T10:12:30.000Z, reply to test, 1, 17) (21, 2018-3-05T19:33:00.000Z, wow, 0, 0)
[ Next ]
X