Click here to Skip to main content
12,700,242 members (34,435 online)
Rate this:
Please Sign up or sign in to vote.
See more: SQL database
I have two tables; Table1 with 15 fields Table2 with 6 fields. Among these 6 fields 5 fields will share same data as in Table1. Which means If Table1 is updated I have to update Table2 as well, apart from this Table2 will have its own data as well.

My question is should I get rid of Table2 & add one extra field to Table1, in this case the remaining 9 fields will have null values for the data that was going into Table2 before.

Or I keep Table2; but in that case I will have to programmatically maintain both tables, which will cause data duplication. It is very important that the data of these two tables always match as it is the heart of the program.

Thanks in Advance.
Posted 16-Sep-12 2:53am
Updated 16-Sep-12 3:01am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I recommend third solution. Create third table which will be contain 5 fields common to previous table and some Id field. In this case you will kept in table1 and table2 only reference by id to needed data.

Share data always should be kept in one place.
divyang_dv 16-Sep-12 12:26pm
Thanks grzelix25, I am feeling so dumb now as I didn't thought of this solution... :) I'll start accordingly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170118.1 | Last Updated 16 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100