If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Functional dependencies

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-06-06, 14:52
krishna17 krishna17 is offline
Registered User
 
Join Date: Feb 2006
Posts: 18
relational algebra

there are 2 relations R(A,B) and S(B,C) where |R| = 3000,|R| = 1000 and B is the primary key of S.Then |R| natural join|S| <= 1000.

Is this true or false?

I think R Natjoin S is less than or equal to 1000,but the answer is false....why is this so? please answer.....
Reply With Quote
  #2 (permalink)  
Old 05-06-06, 15:49
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
R has 3000 rows? then the answer is less than or equal to 3000, not 1000

each row in R has a value for B, so joining R to S using B, every row in R will match at most one row in B

suppose R is some set of people, A=name and B=gender (e.g. M/F)

suppose S is the set of genders, B=gender (M/F), C=name (Male/Female)

joining R to S you get one row for every person, right?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 05-07-06, 19:57
krishna17 krishna17 is offline
Registered User
 
Join Date: Feb 2006
Posts: 18
Functional dependencies

F={A →B, AC →D, AB →C}
X=A
Result should be X+=ABCD

A->B.......AB
AB->C (given) therefore ABC
ABC......ABCD ....as AC->D


Is this right?

suppose for example A->B...then can we write AA->AB
so AA is nothing but A...so A->AB..is this right..
Reply With Quote
  #4 (permalink)  
Old 05-07-06, 23:53
krishna17 krishna17 is offline
Registered User
 
Join Date: Feb 2006
Posts: 18
Functional Dependencies!

F = { I -> B, IS -> Q, B -> O}
• a. What are the keys of the relation?
• b. Is the relation in BCNF?
IS -> ISBQO IS is the only key...

How is IS the key....can anyone please elaborate?
Reply With Quote
  #5 (permalink)  
Old 05-08-06, 16:32
krishna17 krishna17 is offline
Registered User
 
Join Date: Feb 2006
Posts: 18
functional dependencies

Show that the following “rule” for functional dependencies is not sound: If
A->B and C->B then A->B..??????????


ans:for example 3 attributes:lets assume ::A is ssn ; C is empno ; B is name.

ssn name empno
100000 abc E4343
200000 bhh E6456
300000 njk E9079

can the above rule be disproved...

and one more doubt is

in FD: A->B (A determines B )means A is the key...
so

A B
1000 rr
1000 rr

this table satisfies A-> B

but how can there be two 1000's as A is the key ???
Reply With Quote
  #6 (permalink)  
Old 05-08-06, 17:42
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
look, this is the 4th separate thread you've started, and, as with the other ones, i'm going to merge them into one thread

please keep to one thread per topic, thanks
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 05-08-06, 18:34
krishna17 krishna17 is offline
Registered User
 
Join Date: Feb 2006
Posts: 18
fd's--urgent reply wanted please

C = CourseNo, SN = SecNo, OD = OfferingDept, CH = CreditHours, CL = CourseLevel,
I = InstructorSSN, S = Semester, Y = Year, D = Days_Hours, RM = RoomNo,
NS = NoOfStudents
Hence, R = {C, SN, OD, CH, CL, I, S, Y, D, RM, NS}, and the following functional
dependencies hold:
{C} -> {OD, CH, CL}
{C, SN, S, Y} -> {D, RM, NS, I}
{RM, D, S, Y} -> {I, C, SN}

solution:
(a) All attributes of R are in F. Attributes only in LHS: S,Y. Attributes only in RHS:
OD,CH,CL,I,NS. Thus, attributes S and Y must be part of any candidate key, and the
attributes OD,CH,CL,I,NS are not part of any candidate key. We combine S and Y
with the remaining attributes: C, SN, D, RM. By looking at the LHS of the given FDs,
we notice that {S,Y} is not a candidate key, and no combination of three attributes is
a candidate key. The only sets of attributes that can generate the entire schema are:
{S,Y,C,SN} and {S,Y, RM,D}, which are the candidate keys.
why is this so...can anone please elaborate...from the bold....how can we decipher by looking at the LHS of the given fd's that s,y is not a candidate key.......
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On