Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sinres's avatar

Correct table name for separate table with media types

Hello !

I have table knowledge_media where I have three type of media - Webinar, Podcast, Ebook. When I create record of this table I must select one of this type. I want to create other table where will I store these types and allowed file formats for the type. I don't know what is best name for this table maybe knowledge_media_type_designation? The name is a bit too long .. Is it a good idea to keep the types in a separate table? What do you think?

0 likes
4 replies
azimidev's avatar
azimidev
Best Answer
Level 55

In my honest opinion, you should do normalization. You can research that on your own but basically is where you break down complex data structures into simpler, related tables to reduce data redundancy and improve data integrity.

The table could look something like this:

knowledge_media_types
- id (primary key)
- type (string)
- allowed_file_formats (string)

In the knowledge_media table, you can then add a foreign key knowledge_media_type_id to link the media to its type in the knowledge_media_types table.

knowledge_media
- id (primary key)
- name (string)
- file (string)
- knowledge_media_type_id (foreign key)

Then you don't need to modify the data in the knowledge_media table. Don't know what exactly you want in your columns but this is where I would start.

1 like
Sinres's avatar

@azimidev thank you. I think this is best solution. @martinbean I think "media types" is too general and with a large structure of tables there may be less order, especially since the table will only store types for knowledge_media but thank you for answer

1 like

Please or to participate in this conversation.