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

  • Home
  • SEARCH
  • 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 8880263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:07:58+00:00 2026-06-14T20:07:58+00:00

Please help a MySQL newbie. I have 3 tables: table users-username is primary key,

  • 0

Please help a MySQL newbie. I have 3 tables: table users-username is primary key, table song – idsong is primary key and second column is title, third table purchased with column “ref” as primary key, “idsong” is foreign key from song table and “username” is foreign key from users table. So I need to generate a query that will pull which songs has a particular user purchased, and I need the titles display. So far I have:

SELECT idsong FROM purchased  
   JOIN users ON users.username=purchased.username  
   WHERE users.username='admin';   

and this gives me the song id for the user, but I am not sure how to add the title to display from the third table. Please help!

  • 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-14T20:07:59+00:00Added an answer on June 14, 2026 at 8:07 pm
    SELECT s.idsong, s.title
      FROM purchased p 
     INNER JOIN users u ON u.username=p.username
     INNER JOIN song s ON p.idsong = s.idsong
     WHERE u.username='admin';   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please help me with MySQL Trigger Lets say I have two Tables
Please help me: I have two columns in mysql table - date1 (datetime) and
Please help. I'm using MySQL 5.1.30 Community Edition. I have four tables: nts, operator,
i am a beginner of MYSQL please help me. i have a two table
Hi i need help with mysql. I have tow table artist and song_artist now
please help with this mysql query in rails 3: In my controller i have:
I have MySQL tables looking like that regions table id | region ------------------- 1
Please help me to sort my table in MySQL. I need to make it
In my MySQL table I have a column named member_id . That column stores
I have two tables in my mysql database. table1: shoutbox table2: users My tables

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.