database-normalization

Is a candidate key determinant good enough for BCNF?

半城伤御伤魂 提交于 2019-12-11 20:06:43
问题 A question that came up in my homework is as follows: If a determinant is part of a candidate key, is that good enough for BCNF? I don't think so, because a relation is in BCNF if all non-key attributes depend on the whole primary key, and nothing else. This says the determinant is part of a candidate key, so does this imply a partial functional dependency? However, I began to second guess myself because there's a possibility that the candidate key is a super key, but it doesn't seem like

Database Schema for an almost tree

两盒软妹~` 提交于 2019-12-11 10:54:47
问题 I have the following structure: Block A Foo 1 Bar 1 Bar 2 Foo 2 Bar 1 Bar 3 Bar 4 Block B Foo 3 Every Foo belongs to exactly on Block. Every Bar belongs to exactly on Block. A Bar can belong to none, one or more Foo's of the same Block . The schema is currently like this: Block 1/ \1 n/ \n Foo-n---m-Bar The problem with this is that there can be Bar's which belong to Foo's of different Block's Is there a schema which has neither redundancy nor allows inconsistencies? 回答1: Yes, there is a way.

Can one have optional fields in a 3NF / BCNF database?

限于喜欢 提交于 2019-12-11 07:32:42
问题 I have a database that I am trying to set up and I would like it to be in at least 3NF. However, some fields are not necessary in all situations, and the necessity of this field, not the value itself, depends on another. In essence, I want to keep track of jobs that are on hold for one reason or another. My main table right now includes these fields: Job No (primary Key) | Short Text | Storage Location | Coordinator I have other tables for employee list and storage locations. Now my problem

A confusion about 2nd normal form for relation (R,N,S,C,X,P)

眉间皱痕 提交于 2019-12-11 04:59:23
问题 In a GATE question paper, I got a question to solve and I want your help to solve it. I have a relation E=(R,N,S,C,X,P) And I have some FDs P->C,X S->P C->P X->P According to the answer, the relation is in 2NF but I failed to get that. According to me, its primary key is NSR and S->P IS NOT SUPPORTING 2NF CONDITIONS. Could you help me with this? 回答1: None of the FDs (functional dependencies) determines R, N or S, so they must be prime, ie in every CK (candidate key). They determine all other

What is best design for one-to-many relationship with back references to each other?

我的梦境 提交于 2019-12-11 04:37:14
问题 I am trying to find best design for SQL database schema for one-to-many relationship. In my project i have objects which consist of number of nodes and i would like each object to have optional foreign key reference to root_node . So my initial solution looks like this (for clarity i am skipping dependency problem): -- schema A CREATE TABLE objects ( object_id integer NOT NULL PRIMARY KEY, root_node integer REFERENCES nodes(node_id), <some other data> ); CREATE TABLE nodes ( node_id integer

Difference between 2nd normalization phase and 3rd normalization phase

大兔子大兔子 提交于 2019-12-11 02:49:00
问题 I have normalized some tables up to 2nd normal form. Below are the normalized tables. I am really confused with the 3 normalization phase as it is some what similar to 2nd normalization phase. My question is, is the nurse table already in the 3rd normalization phase or not ? Also can some one explain me , what is the difference between the 2nd normalization form and 3 normalization form. I know that 2nd normalization form has partial dependencies and 3rd normalization form has transitive

One table column for many fk tables?

断了今生、忘了曾经 提交于 2019-12-10 23:37:00
问题 What is the best solution/practice for situation like this? I have a table, that can reference to multiple tables (objects)? Here is an example for a table UserCalendar. It's a table where user saves his event, but also system inserts in this table from behind. User executes some services, which have deadlines and those are inserted in this table also. Problem is that there is no such a table as UserEvent table. User should save all his events in this calendar as description. I should make

Lossless Join Property

孤街醉人 提交于 2019-12-10 17:45:24
问题 Can someone please explain to me what is meant by the lossless join property in a relation schema? Is it the ability to maintain the semantics of information/data during the decomposition of relations whilst normalising? 回答1: @Falcon - you are right - but this is a more substantial definition... The lossless join property is a feature of decomposition supported by normalisation. It is the ability to ensure that any instance of the original relation can be identified from corresponding

Lossless decomposition vs Dependency Preservation

北城以北 提交于 2019-12-10 09:37:50
问题 Does anyone of them implies the other? My logic is that if all dependencies are preserved, then there is no loss of information and similarly, if decomposition is lossless then no functional dependency must have been violated. So essentially, dependency preservation is a way to ensure that your decomposition is lossless. I am having a hard time accepting/denying it. So do both of these guarantee one another or are there cases where one can be achieved without the other? 回答1: In general these

Am I Properly Normalizing this Data

ぐ巨炮叔叔 提交于 2019-12-10 02:11:31
问题 I am completing normalization exercises from the web to test my abilities to normalize data. This particular problem was found at: https://cs.senecac.on.ca/~dbs201/pages/Normalization_Practice.htm (Exercise 1) The table this problem is based of is as follows: The unnormalized table that can be created from this table is: To comply with First Normal form, I have to get rid of repeating fields in the table by moving visitdate, procedure_no, and procedure_name to their own respective tables: