Tag Info

New answers tagged

0

I would examine your model and see if it needs some normalization. It would appear that the two types of model are sub-types of a common model. I have found this kind of implementation requires some design. Using the same id sequencing for both tables opens up a number of options for implementation. Creating an intermediate Model table containing the ...


1

Can you get a different answer for subtotal for any specific pair of quantity and price_charged? No, of course not. Arithmetic is arithmetic. Quantity and price charged depend on invoice_number and line_number, not on product_code at all. In fact, product_code also depends on invoice_number and line_number. EDIT: Partial Dependencies are ...


1

The right way is like the following: Users {user_id (PK), username (Unique)} Profiles {profile_id(PK), user_id FK, user_views} in the given structure, we are making user_id as PK to link between tables, and making the username as Unique to avoid duplication, some people will do the username as PK, but this will make a problem if you want to update the ...


0

I think that the first option is correct as compared to creating 2 different tables as creating more tables and then using "JOIN" queries on them seems quite costly process for the database(i.e costly in terms of performance)



Top 50 recent answers are included