database-design

is this a flaw?

一曲冷凌霜 提交于 2020-01-06 13:50:51
问题 In Visio I can only alter one side of the relationship. If I want a "1-M" relationship, I have to choose "Identifying", but this automatically makes the FK becomes PK, which doesn't seem right to me. Someone with the same problem said it was a flaw, so there is no way around it in visio? 回答1: Make sure "Required" is checked for the foreign key column(s) in the column list in the child table. If you do that you should see the relationship depicted as: -II--O<-, which I guess is what you want.

Suggest improvements for the database design

試著忘記壹切 提交于 2020-01-06 12:42:20
问题 Design :- 1)A story board has a number of slides, each slide can have one or more captions or images. 2)Each storyboard can have one or more author , and zero or more reviewers. 3) Each of the objects image,slide and caption(probably more objects will come later like audio etc) can have comments on them . These comments can be given by authors or reviewers. For storing comments I have created a comment table. 4)It is necessary to remember the order of slides and order of images in a slide ,

Avoid using dynamic table names, but how?

≡放荡痞女 提交于 2020-01-06 07:26:19
问题 I am new to database design and I'm trying to get into the best practices early. So far everywhere I look their seems to be an agreement that you "Create the table names at the start of development, and insert your data, do not use variables for table names. Well I was looking to make an asset management system and I can't get past what seems like a design flaw. This software would be very similar to "quickbase" if you're familiar. Here is the scenario. User can create accounts, each account

How to represent many similar attributes of an entity in a database?

流过昼夜 提交于 2020-01-06 07:00:16
问题 Let's say I'm building a website about cars. The car entity has a lot of enum-like attributes: transmission (manual/automatic) fuel (gasoline/diesel/bioethanol/electric) body style (coupe/sedan/convertible/...) air conditioning (none/simple/dual-zone) exterior color (black/white/gray/blue/green/...) interior color (black/white/gray/blue/green/...) etc. The list of these attributes is likely to change in the future. What is the optimal way to model them in the database? I can think of the

Users and Staff in the same table or separate tables?

感情迁移 提交于 2020-01-06 06:50:27
问题 I have to decide on design of my database for my application. So far I have Users table that stores these fields: **USERS** RecID - auto increment UserID - unique id (Primary key) UserName Password Salt TempPassword FirstName LastName Email SystemAdmin QuestionID Answer Active CreateDate CreateUID This table stores all information about users. There is another section in the app named Staff. According to the specs they want to see on the form **STAFF** First name Last name Middle Initial

Database Design - Conditional Null Values

拥有回忆 提交于 2020-01-06 01:54:15
问题 I have a work_orders entity, it can have child work orders, so there is a parent_id on the table. There are cases where the child order can be invoiced separately or with the parent. So I have another column called bill_with_parent . Since that bill_with_parent column only ever applies to child work orders, I've been setting it to NULL for non child work orders, and if it's a child, it's either going to be 0 or 1 . Is that the proper way to handle something like this? 回答1: While it's not

Turn two database tables into one?

ε祈祈猫儿з 提交于 2020-01-05 12:10:33
问题 I am having a bit of trouble when modelling a relational database to an inventory managament system. For now, it only has 3 simple tables: Product ID | Name | Price Receivings ID | Date | Quantity | Product_ID (FK) Sales ID | Date | Quantity | Product_ID (FK) As Receivings and Sales are identical, I was considering a different approach: Product ID | Name | Price Receivings_Sales (the name doesn't matter) ID | Date | Quantity | Type | Product_ID (FK) The column type would identify if it was

Database Table Schema and Aggregate Roots

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-05 11:42:25
问题 Applicaiton is single user, 1-tier(1 pc), database SqlCE. DataService layer will be (I think) : Repository returning domain objects and quering database with LinqToSql (dbml). There are obviously a lot more columns, this is simplified view. LogTime in separate table: http://i53.tinypic.com/9h8cb4.png LogTime in ItemTimeLog table (as Time): http://i51.tinypic.com/4dvv4.png alt text http://i53.tinypic.com/9h8cb4.png This is my first attempt of creating a >2 tables database. I think the table

Specific BCNF decomposition

為{幸葍}努か 提交于 2020-01-05 08:56:59
问题 I'm trying to do a BCNF decomposition of the following relation: R(A,B,C,D,E,F) with functional dependencies: A -> DF B -> AC F -> E I get the superkey to B, and by following the decomposition algorithm for BCNF I get the following decomposition: R1{ADF}, R2{ABC} R3{FE} However, I suspect that R3 is not correct. Can anyone explain why, and where my error is? 来源: https://stackoverflow.com/questions/22437018/specific-bcnf-decomposition

Pros and Cons of different Schema designs for tables that all have a relationship to one data item

一世执手 提交于 2020-01-05 08:17:11
问题 I am developing a system that will have a database backend. I am intending that every table have a PK that is arbitary, system generated and maintained. My environment (for development and production) is Windows 7; Delphi; and an embedded database (probably Firebird). My data structures include one table OWNER, that has very little information associated with it - probably no more than name and description. The rest of the data structure will be about 50 tables, each with name and description