Question: Please write a query to insert a comment into the database. The comment should be 'First comment' and it should be made by the user

Please write a query to insert a comment into the database. The comment should be 'First comment' and it should be made by the user with the username 'newton'. The comment should be associated with the post that has a post_id of 2.
Tables Schema as Below:
post
columnName dataType
id int
username varchar(24)
post_title varchar (72)
post_description text
datetime_created datetime
number_of_likes int
photo blob
comments
columnName dataType
username varchar(24)
comment_text text
post_id int
Input

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!