We assume that, as suggested in the instructions, you have loaded the
data into a table called "hw1_data". The queries to help determine
which functional dependencies exist are listed below.
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.name=H2.name and H1.discount !=H2.discount;
--Returns a count of 36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.name=H2.name and H1.month !=H2.month;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.name=H2.name and H1.price !=H2.price;
--0-->YES, is FD
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.name!=H2.name and H1.discount =H2.discount;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.discount =H2.discount and H1.month !=H2.month;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.discount=H2.discount and H1.price !=H2.price;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.name!=H2.name and H1.month =H2.month;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.discount!=H2.discount and H1.month =H2.month;
--0-->YES, is FD
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.month =H2.month and H1.price !=H2.price;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.name!=H2.name and H1.price =H2.price;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.discount!=H2.discount and H1.price =H2.price;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.month!=H2.month and H1.price =H2.price;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.month=H2.month and H1.price =H2.price and H1.name!=H2.name;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.month!=H2.month and H1.discount=H2.discount and H1.name=H2.name;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.month!=H2.month and H1.discount=H2.discount and H1.price=H2.price;
--36
select count(DISTINCT H1.name)
from hw1_data H1, hw1_data H2
where H1.name!=H2.name and H1.discount=H2.discount and H1.price=H2.price;
--36
The dependencies are name->price
and month->discount.