mysql - database grouping data in tables -


i have database 3 main tables, , every of table has first 7 of 20 fields same.

for example:

table1 - a,b,c,d,e,f,g,x,y,z,df,gt,er,re,re     table2 - a,b,c,d,e,f,g,q,w,c,v,t,v,b,t,l,f     table3 - a,b,c,d,e,f,g,b,n,m,j,h,g,d,f,r,e 

first fields (a,b,c,d,e,f,g) same , other different.

my question is:

  • is make 1 table fields , branching?

together_table:a,b,c,d,e,f,g

table1 - together_table_id,x,y,z,df,gt,er,re,re     table2 - together_table_id,q,w,c,v,t,v,b,t,l,f     table3 - together_table_id,b,n,m,j,h,g,d,f,r,e 

or muste like:

table1 - a,b,c,d,e,f,g,x,y,z,df,gt,er,re,re     table2 - a,b,c,d,e,f,g,q,w,c,v,t,v,b,t,l,f     table3 - a,b,c,d,e,f,g,b,n,m,j,h,g,d,f,r,e 

i using mysql

together_table:a,b,c,d,e,f,g

table1 - together_table_id,x,y,z,df,gt,er,re,re     table2 - together_table_id,q,w,c,v,t,v,b,t,l,f     table3 - together_table_id,b,n,m,j,h,g,d,f,r,e 

this much, better. normal form. databases designed in 3rd normal form (also written 3nf). there, start first guess , apply rules make 1nf (first normal form). apply rules of 2nf, , 3nf. there other higher normal forms required rare circumstances.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -