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 8311471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:49:37+00:00 2026-06-08T19:49:37+00:00

I have a table for users. Each user has certain skills they teach. So

  • 0
  1. I have a table for users. Each user has certain skills they teach. So for example:

    • Bob can teach karate
    • Louise can teach piano and knitting
    • Roger can teach judo, sailing and fencing

This is how I’ve done it in the database:

Table users
pk: uid, name

1 Bob, 
2 Louise, 
3 Roger

Table skills
pk: sk_id, skill

1 karate,
2 piano,
3 knitting,
4 judo,
5 sailing,
6 fencing

Table user_skill (relationship between user and skills)
pk:usk_id, fk:uid, sk_id

1 1 1,
2 2 2,
3 2 3,
4 3 4,
5 3 5,
6 3 6,

I want to then display “Roger has these skills: judo, basketweaving”

select name, skill 
from users, skills, user_skill
where users.uid = user_skill.uid
and users.uid = 3

Is this the right way to go about it – both in terms of designing the tables and querying (mysql)?

  1. Then say I want to update their profile with the areas they teach in:

    • Bob can teach karate in London
    • Louise can teach piano in Bolton and knitting in Manchester
    • Roger can teach judo in London and Manchester, sailing in Liverpool and fencing in Bradford

So I add the following tables:

Table cities
pk: city_id, city

1 London,
2 Manchester,
3 Liverpool,
4 Bolton,
5 Bradford,

But I’m confused as to how to do the relationships. I keep writing it out and realizing it doesnt work and starting again so I’ve obviously gone wrong somewhere.

  • 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-08T19:49:40+00:00Added an answer on June 8, 2026 at 7:49 pm

    I would say your general DB structure is fine as far as the relations go. To incorporate the cities aspect you could use your proposed cities table, but also add a column to your user_skill table to include a reference to the city table.

    Also make sure you use proper join statements in the select queries as this is best practice and helps the queries run as efficiently as possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table users with primary index userId . Currently, each user has
I have 200 users each user will eventually have a reviewINFO table with certain
I have a table called users and each user can belong to one group,
I have about 1 million data in users table. Now I want each user
I have a table with user items. Each user may have several types of
I have the table users and scores . Here are the associations: belongs_to :user
I have a table users which has a primary key userid and a datetime
I have a table containing roles. Many users can be assigned to a role.
I have a table full of Actions. Each Action is done by a certain
I have a reward_points table with structure similar to 'id', 'user_id', 'points', 'datetime_gained'. Each

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.