Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7818595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:37:38+00:00 2026-06-02T06:37:38+00:00

I need to use Joins for a project but I have forgot how to

  • 0

I need to use Joins for a project but I have forgot how to use it. It’s all just messing with my head now, I can’t quite figure it out.

I have five tables, all of which I need to join:

categories - id, name
movies_categories - movie_id, category_id
movies - id, title, description, release_date, cover_image
users - id, username, password
user_movies - user_id, movie_id, favorite, review, watch_date, rating

As you can see the project is movie related, and user_movies contains all the movies the user has watched. What I need to do is get all the movies a certain user has watched. So, I need all of the movie info for each movie, the username (that’s pretty much all the info I need from the user), and some of the columns from user_movies (all of them except the first two). I also need to combine all of the categories for each movies into one “variable”. I believe you can use GROUP_CONCAT() to do that, I’ve done it before.

It’s a tricky task, I really need to get my head around this. If anyone can help me out I’d appreciate it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:37:40+00:00Added an answer on June 2, 2026 at 6:37 am

    If you had provided table schemas (create table scripts) I could test query on sqlfiddle so I couldn’t test but I think this query is what you need.

    select u.username, u.password
         , um.user_id, um.movie_id, um.favorite
         , um.review, um.watch_date, um.rating 
         , m.movie_title, m.description, m.release_date, m.cover_image
         , mc.category_id
         , group_concat(distinct c.name) as movie_categorynames
    from user_movies um
    inner join users u on u.id = um.user_id
    inner join movies m on m.id = um.movie_id
    inner join movies_categories mc on mc.movie_id = um.movie_id
    inner join categories c on c.id = mc.category_id
    where um.user_id=1
    group by um.user_id
    
    
    
    USERNAME    PASSWORD    USER_ID MOVIE_ID    FAVORITE    REVIEW  WATCH_DATE  RATING  MOVIE_TITLE DESCRIPTION RELEASE_DATE    COVER_IMAGE CATEGORY_ID MOVIE_CATEGORYNAMES
    nike    5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8    1   3   0   This is my movie review!    51351   7   It's Kind of a Funny Story  A clinically depressed teenager gets a new start after he checks himself into an adult psychiatric ward.    2010    8d27232902780886db032afb8d4883a7.jpg    5   Comedy,Drama
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number of queries (in a C# project) that all use the
During sql queries with joins, do i need to use transactions? I was thinking
I have installed Matlab r2010a on my computer I need use the function xlsread
So, I need use this event so I can navigate trought blog posts. I
Need to use own imaged markers instead built-in pins. I have several questions. 1.
I've never worked with Database Functions, but my current project requires it. I need
I have one project where I need to apply a dozen or so regex
I need some help in adding the replace all functionality into my Flex project.
I can't quite figure this one out. To make it simple I'll explain what
I need use this method with three distinct classes: Orders, Customers, Suppliers public void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.