functional-dependencies

Finding functional dependency

十年热恋 提交于 2021-02-20 04:38:20
问题 How do I determine the functional dependency and the candidate key based on this case study? Course module and it can be performed by lecturer, student or visitor user. Course module consist of subject code and subject name. When admin creates course, it will store course ID, subject code, lecturer ID, course name, and ..... Students are required to enroll in the course and the course enrollment consist of registration ID, student information, date of enrollment, date of completion and....

Can MySQL be convinced of functional dependency when HAVING COUNT(*) = 1?

与世无争的帅哥 提交于 2021-02-11 04:59:39
问题 I'm trying to find orders with only one item in a database running on MySQL 5.7.23 on Ubuntu 18.04 LTS. But somehow MySQL can't infer that COUNT(*) = 1 implies a functional dependence. The following 2-table database of orders with order items illustrates the failure: DROP TABLE IF EXISTS t_o, t_oi; CREATE TABLE t_o ( order_id INTEGER UNSIGNED PRIMARY KEY, placed_on DATE NOT NULL, INDEX (placed_on) ); INSERT INTO t_o (order_id, placed_on) VALUES (1, '2018-10-01'), (2, '2018-10-02'); CREATE

Can MySQL be convinced of functional dependency when HAVING COUNT(*) = 1?

可紊 提交于 2021-02-11 04:56:48
问题 I'm trying to find orders with only one item in a database running on MySQL 5.7.23 on Ubuntu 18.04 LTS. But somehow MySQL can't infer that COUNT(*) = 1 implies a functional dependence. The following 2-table database of orders with order items illustrates the failure: DROP TABLE IF EXISTS t_o, t_oi; CREATE TABLE t_o ( order_id INTEGER UNSIGNED PRIMARY KEY, placed_on DATE NOT NULL, INDEX (placed_on) ); INSERT INTO t_o (order_id, placed_on) VALUES (1, '2018-10-01'), (2, '2018-10-02'); CREATE

Can MySQL be convinced of functional dependency when HAVING COUNT(*) = 1?

拥有回忆 提交于 2021-02-11 04:56:21
问题 I'm trying to find orders with only one item in a database running on MySQL 5.7.23 on Ubuntu 18.04 LTS. But somehow MySQL can't infer that COUNT(*) = 1 implies a functional dependence. The following 2-table database of orders with order items illustrates the failure: DROP TABLE IF EXISTS t_o, t_oi; CREATE TABLE t_o ( order_id INTEGER UNSIGNED PRIMARY KEY, placed_on DATE NOT NULL, INDEX (placed_on) ); INSERT INTO t_o (order_id, placed_on) VALUES (1, '2018-10-01'), (2, '2018-10-02'); CREATE

Why does this instance fail the coverage condition?

99封情书 提交于 2021-02-08 23:45:00
问题 Why does the following instance declaration fail the coverage condition in the absence of UndecidableInstances ? It seems that if the functional dependency is satisfied in the context then it is satisfied in the new instance. {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE UndecidableInstances #-} class Foo a b | a -> b where instance (Foo a b, Foo a' b') => Foo (a, a') (b, b') where If I try to replicate the same thing with a type family there is no problem. {-# LANGUAGE TypeFamilies #-

Functional dependencies in case of nulls

倖福魔咒の 提交于 2021-02-08 09:52:52
问题 Suppose we have a table with 3 columns A,B and C A B C --------------- 1 2 3 2 4 5 4 6 7 n 5 n Here 'n' means null. Can we say that A -> B and A -> C? I know the definition of functional dependencies but I'm just confused in the case of null values. 回答1: If null is considered a value, then the answer is yes. A -> B, C holds in the given data. However, to be a value imposes certain requirements. All operators applicable to the domain (e.g. integers) like equality, addition, less than, and so

Explanation of ER model to functional dependencies solution

久未见 提交于 2020-06-27 06:36:09
问题 I am trying to understand solution on one exercise that translates ER model to functional dependencies. As you can see above, we only have relation names and nothing else besides that, and by solution, they somehow come up to conclusion that mother, daughter → father father, daughter → mother mother, son → father father, son → mother And that moreover we can infer additional f dependencies to represent real world more accurately: mother, son → father father, son → mother What I don't

Identifying Functional Dependencies II

假装没事ソ 提交于 2020-05-12 01:56:50
问题 I was getting a little confused with the last post so I found a nice example which should clear things up. hireDate & carReg are the primary keys. So my question can anyone find any extra functional dependencies other than the ones I have identified below....Modifications also welcome: fd1 carReg -> make, model, outletNo, outletLoc fd2 custNo -> custName fd3 outletNo -> outletLoc fd4 model -> make (only if we assume a model name is unique to a make) fd5 carReg, hireDate -> make, model, custNo

Identifying Functional Dependencies II

▼魔方 西西 提交于 2020-05-12 01:56:48
问题 I was getting a little confused with the last post so I found a nice example which should clear things up. hireDate & carReg are the primary keys. So my question can anyone find any extra functional dependencies other than the ones I have identified below....Modifications also welcome: fd1 carReg -> make, model, outletNo, outletLoc fd2 custNo -> custName fd3 outletNo -> outletLoc fd4 model -> make (only if we assume a model name is unique to a make) fd5 carReg, hireDate -> make, model, custNo