PrimeAcademy / biscayne-syllabus

1 stars 4 forks source link

help :D data structuring #17

Closed janetscanlon closed 4 months ago

janetscanlon commented 4 months ago

Description

Your Real Name

janet hehe What do you want to happen? I want guidance on how to change my sqlQuery to include reviews that the user has written AND who the user follows What is actually happening? I was able to implement the sqlQuery we discussed with kristin and the feed successfully shows reviews that the user is following

no errors :)

Screenshots / Code Snippets

current query ! `SELECT "reviews"."id", "reviews"."user_id", "reviews".book_author, "reviews".book_title, "reviews".genre, "reviews".review_input, "reviews".review_timestamp, "reviews".rating, COUNT("review_likes".id) AS "like_count", "user".first_name AS "reviewAuthor_firstName", "user".pronouns AS "reviewAuthor_pronouns" FROM "follow" JOIN "reviews" ON "follow".followed_user_id = "reviews".user_id LEFT JOIN "review_likes" ON "reviews"."id" = "review_likes"."review_id" JOIN "user" ON "reviews"."user_id" = "user"."id" WHERE "follow".user_id = $1

                GROUP BY "reviews".id, "user".id
                ORDER BY "reviews".id;
        `

What did you try? Who did you ask?

What branch is your code on? Did you git push?

When was the last time you took a break?