I'm new to working with relational databases and have a sound understanding of how to query and join tables. My question today is a bit of a 2 part question because I don't really know how else to phrase it.
First you should try to study Third Normal Form.
The number the columns isnt the main factor, the important is try to avoid repetition so maintenance become easier.
For example if you have a table
employee: [id, first_name, last_name]
You wont need to split it that into two tables, ok this is extreme but you get the idea.
employee_first: [id, first_name] employee_last: [id, last_name]
The other case is avoid repeat data.
if you have a field
favorite_fruit instead of using a text field you create a fk table and save integers.
favorite_fruit favorite_fruit id fruit orange 1 1 orange orange 1 2 apple apple ==> 2 3 pineapple pineapple 3
Save space and is easy to edit, for example if you want change
orange juice only need replace one.
Not sure what is your case, but for example if you have different type of
upload you can have a master table
type_id and each type can have a separated table for details.
UPLOAD | table: [UPLOAD TYPE1] upload_id type_id | upload_id [fields unique for type1] xxxx 1 ==> | xxxxx ooooooo yyyy 2 |===================================== | table: [UPLOAD TYPE2] | upload_id [fields unique for type2] | yyyyy oooooooo
Another example is employee adress.
istead of add multiple field for
building, street, zip code you create three tables
employee: employee_id adress: address_id, building, street, zip code employee_adress: employee_id, adress_id.
That way one employee can have multiple address just adding a separated entity
address and assign to