database-normalization

First normal form and temporal data

霸气de小男生 提交于 2019-12-04 17:23:34
The first normal form says that row ordering should not matter. Does this mean that a table with date as part of the key is not 1NF? e.g. Consider a table of ticker prices where date/time is part of the PK. In this case, you get the last price by ordering the data by date and selecting the top 1 row. Does this mean that for to fulfill 1NF you need to split the table into: 1) TickerCurrentPrice (1 row per ticker) 2) TickerHistoricalPrice Thanks 1NF is aspect of a table representing a relation , not of a table as such. If your relation says ticket HAS price , that it's a 1NF violation, as you

Normalization of Many to Many relation in sql

拥有回忆 提交于 2019-12-04 16:01:49
I have a product table that contains two column ProductID Desc 1 Fan 2 Table 3 Bulb I have another table that contains supplier information SupplierID Desc 1 ABC 2 XYZ 3 HJK Now One supplier can supply multiple products and one product can be supplied by multiple suppliers To achieve this I have created another table tbl_Supplier_Product SupplierID ProductID 1 1 1 2 2 1 2 2 2 3 Is it a good way to link this table to supplier and product table through primary composite key. In this table the primary key would be a composite key (SupplierID and ProductID) or should I add an extra column row ID

Skipping steps in Normalization?

喜夏-厌秋 提交于 2019-12-04 06:31:11
问题 Just curious: is there some reason why one cannot do all necessary normalizations in a single step? Isnt normalization ultimately the redrawing of the Functional Dependency (FD) graph? We start out with an FD diagram/graph and we want to end up with a graph (vertices are attributes, there is an edge between attributes a,b if b is FD on a ) representing a relation in (Edit) BCNF ? EDIT: What I mean is : we start with a FD graph , which is a graph pairing attributes a,b iff b is FD on A, i.e.,

Dependency preserving

最后都变了- 提交于 2019-12-04 05:28:28
So I am looking over my database notes and material trying to refresh myself on the general concepts and terminology for upcoming interviews. I have gotten stuck at dependency however and lossless-join decompositions though. I have searched all over and see lots of mathy equations but I am looking for a plain and simple English response or example. I have a found a powerpoint from http://www.cs.kent.edu/~jin/DM09Fall/lecture6.ppt which illustrates an example that I cannot fully understand. It is posted below. R = (A, B, C)F = {A → B, B → C) Can be decomposed in two different ways R1 = (A, B),

Break atomicity rule storing list of items when there is no reason to query about items? Verses join table that requires whole join table be scanned

杀马特。学长 韩版系。学妹 提交于 2019-12-04 02:35:36
问题 This specific case is regarding lists, and items. The same item may belong to multiple lists, and each list has many items. Option A (the "proper" way as I understand it): Make a join table, which has list_ID and item_ID. When I want all the items in a list query for list_ID. Option B (break the atomicity rule): Make a list table. Primary Key, and either repeating columns or non-atomic columns. As I understand it both of these deviations suffer the exact same drawbacks, which is the inability

Database schema normalization checker?

岁酱吖の 提交于 2019-12-03 12:34:50
I'm interested in learning about tools that operate like this: Given a database schema and some data, suggest whether the schema is likely structured in any particular normal form, and then tell how the schema might be factored to produce further normalization. Basically, a static analysis tool for database schema design. Like other static analysis tools, such a database tool need not generate perfect results (I doubt such a "perfect" tool is computationally feasible), or applicable to all database systems, or free/open source, or anything else. The tool need not be stand-alone; it could be

What are the pros and cons of Anchor Modeling? [closed]

六眼飞鱼酱① 提交于 2019-12-03 11:33:35
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 months ago . I am currently trying to create a database where a very large percentage of the data is temporal. After reading through many techniques for doing this (most involving 6nf normalization) I ran into Anchor Modeling. The schema that I was developing strongly resembled the Anchor

How to represent a two ways relationship in a Firebase JSON tree?

雨燕双飞 提交于 2019-12-03 09:57:20
问题 Warning: this is an exercise to understand better JSON database design in Firebase it is not necessarily realistic I have got a two ways relationship between users and door keys. I would like to understand: how to represent this relationship visually ( I can imagine it only as two separate trees ) how this would work on Firebase, would both users and door-keys be child of a parent node "myparentnodename"? If I model the database in this way it feels highly inefficient because every time I

Is it worth breaking out address information into a separate database table?

血红的双手。 提交于 2019-12-03 05:47:11
问题 I have a table called "Person" with the following fields Id (Primary Key) FirstName LastName DateOfBirth City State Country Should things like City, or State or Country be normalized and broken up into their own table and then this table have CityId and StateId columns. We were having a debate whether this was a good or bad decision. To add, I do have a City and a State table (for other reasons not related to this person table). I am curious around answers with or without this additional fact

Functional dependency and normalization

早过忘川 提交于 2019-12-03 03:51:20
问题 I am trying to find a great resource to study for functional dependency and normalization. Anyone have any idea where should I look to? I am having difficulty differentiating whether a FD is in 1NF, 2NF or 3NF? I've been reading Wikipedia and used Google search to find good research, but can't find any that explains it in simple terms. Maybe you all can share on how you learned FD's and normalization during your life as well. 回答1: A functional dependency defines a functional relationship