Tag Info

New answers tagged

1

It is quite common to copy the data as it stands at the point in time that a transaction occurred - in your case the Settings when a FoodMaker made something. This happens with financial systems a lot for audit and reporting purposes. Yes, it is duplication, but in a known and controlled way for a purpose. The alternative is to add time range columns to ...


1

Four tables will solve and normalize the data: Person - person_id - name - dob - address Account - account_id - creation_date PersonAccountRole - person_id (PK) - account_id (PK) - role_id - etc... Role - role_id - role_descrip - etc...


0

In order to avoid using a large amount of joins, which could be a heavy load on a database server, store each user individually in a separate table. The only problem you can face with this type of structure is with the evolution of the application. At some point you may want to store an extra bit of information about two particular types of users(i.e admin ...


1

A simple design you can go for is to choose three tables Table MasterUser UserId - PK - Identity(auto increment) phone mail Table AdminNormalUser UserId -- Pk of this table and UserId of `MasterUser` FirstName LastName Table CompanyPorviderUser UserId -- Pk of this table and UserId of `MasterUser` CompanyName Fax This design will give you a ...


1

If you keep the Separate tables, you may face issues with referential integrity if both type users are interacting with same data, but you dont want unnecessary nulls in your user table so what I would suggest is create a separate user attribute table for non common user attributes so 1) tbl_user contains all the common columns with flag to specify type of ...


0

Please add unique key in Employee_Contact_Number in Employee table and then data type of Staff_Type is not same in both doctor and employee table. In doctor it is varchar and in employee it is int. You can use following code: drop table Doctor ; CREATE TABLE Doctor ( Staff_Number INT(9) NOT NULL, INDEX (Staff_Number), Staff_Type INT(24) NOT NULL, ...


0

Check to see if InnoDB is your default engine, as the engine is not specified in the create statement. Note that MyISAM doesn't support Foreign Keys.



Top 50 recent answers are included