I need to do generalization on the data structure. I have a table with unnecessary data (42 columns)
Some examples:
files_shit (id, file name string, upload_user, user_name, tag text, ...) and I I want to create 3 tables file , user and tags I have around 30 000 records. What is the best way to copy data from
file_shit to files , users code> and Tags and creating references? (Another table between the tag and the file will be file_tags )
First of all , You can not change this table. You have to use new people. Use this table as a staging table. Create a new table then choose from this table and add them to those people.
You must identify the primary key for each table. Then fill out the tables (you have to identify which table is referred to before due integrity ... etc).
Insert the code into the code: eg files (columns). ) & Lt; File column & gt; Select primary_colum by files_shit group; (Note - This means that you will use the primary column as the primary column (primary), if you want to use the autoconnected integer (optimum) You have to look up ...)
Lot is dependent on new schemas and relationships (which you have clearly defined). Hope this will be helpful.
Edit - Lookup
You will have an INT ID field for each table. File_id. These systems will be prepared (most auto_nature) in simple words, this information is not in your current table. Therefore, when you add a file to the file table, and it receives file_id, you need to complete your foreign key relationships. To add the user to the table, the file's ID will be 'Viewed' (depending on their existence). Simple examples - Try adding additional file_id / tag_id columns to your main table.
Fill the tag table first (basically those who do not see anybody else)
Fill the tag_id key tables for each row by joining the tag table. update Main tab & gt; Mt.tag_id = tT.tag_id Now enter the file ... file_pk_col, select the Tag_ID group by file_pk_col
SET mt.tag_id = MTT tag_table TT MTtag_PACK_LOMPY = TTTAGAGE_PNGLog < / P>
- This tag is an example look for the table.
Comments
Post a Comment