0

I want to create database which allow me to store IT job offers from various websites. While creating ER diagram I started wondering if I really need an id column in one particular table. Look at this situation below: enter image description here

  1. Every job offer has a title and a source website. It happens quite often that job offers from the same website have the same title so in order to distinguish them somehow I created column job_id which makes each offer (row in table) unique.
  2. Job offers sometimes contain information about required additional Tech_skill. For these I made a separate table. As with job offers, their names are often repeated. And this is where the main thread comes in: unlike in case of job offers, I think I don't need to store every Tech_skill name because if I did this they would repeat. Instead, I think I can add only unique ones (those that haven't appeared yet) to my Tech_skill table so that there wouldn't be repetition. And if I needed to associate job offer with one or several skills then I'd use linking table (many to many relationship).

So if I were to inserting non-repeating skill names into a Tech_skill table would I need to create an id column?

1
  • You might be interested in this.
    – Vérace
    Commented Sep 23, 2021 at 17:27

1 Answer 1

0

The skill_id column? well, without it you would have to use the skill name as a value in the join table, that would make the Tech_skill table entirely redundant. Creating a numeric skill_id allows you to only repeat numbers in the join table, and numbers take much less space than text making things more efficient.

So adding an artificial ID makes sense and is often done, but it is not required and you can do without it if you are not concerned with performance/space requirements implications.

Not the answer you're looking for? Browse other questions tagged or ask your own question.