in Databases edited by
27,994 views
61 votes
61 votes

Consider the following relational schema:

$\text{Suppliers}(\underline{\text{sid:integer}},\text{ sname:string, city:string, street:string})$ 

$\text{Parts}(\underline{\text{pid:integer}}, \text{ pname:string, color:string})$ 

$\text{Catalog}(\underline {\text{sid:integer, pid:integer}}, \text{cost:real})$

Assume that, in the suppliers relation above, each supplier and each street within a city has unique name, and (sname, city) forms a candidate key. No other functional dependencies are implied other than those implied by primary and candidate keys. Which one of the following is $\text{TRUE}$ about the above schema?

  1. The schema is in $\text{BCNF}$
  2. The schema is in $\text{3NF}$ but not in $\text{BCNF}$
  3. The schema is in $\text{2NF}$ but not in $\text{3NF}$
  4. The schema is not in $\text{2NF}$
in Databases edited by
28.0k views

4 Comments

oh yes you are right. The relations are already in BCNF decomposed form. I assumed it to be FDs while making that comment. Thanks

1
1

how can (sname, city) forms a candidate key? we have a primary key as sid , so we have minimal super key sid as one and only candidate key.
@Arjun sir is i am wrong?

0
0

bro @Golla Sai Venkatesh every primary key is a ck which is superkey and minimal too . and (sname, city) they gave as ck we are not explicitly assuming this thing from our side.

0
0

6 Answers

79 votes
79 votes
Best answer

The non-trivial $\text{FD}$s are 

  1. (sname, city) $\to$ street
  2. sid $\to$ street
  3. (sname, city) $\to$ sid
  4. sid $\to$ sname
  5. sid $\to$ city

For all these, $\text{LHS}$ is a super key and hence $\text{BCNF}$ condition is satisfied. But we have some more dependencies here:

"each supplier and each street within a city has unique name"

This basically means each supplier in a city has unique name making (sname, city) determine sid and hence making it a candidate key. Each street within a city also has a unique name and so (street, city) is also a candidate key. Even then with all $3$ candidate keys (for Suppliers schema), for any $\text{FD}$, the $\text{LHS}$ is a super key here, and hence the relation schema (for other two relations it is straight forward) is in $\text{BCNF}$.

http://db.grussell.org/section009.html

Correct Answer: $A$

edited by
by

26 Comments

sir,

from above explanaion (Street,city) -> sname also becuase (street,city ) is unique.

can't it be candidate key??

also if its a candidate key then no problem its in BCNF,

otherwise its not in bcnf but in 3NF

please reply sir.

piyush
4
4
Yes, that is a candidate key as it is unique. I corrected the last part.
3
3
Sir is it not having partial dependency? Because (sname,city) is C.K and (city,street) is also a C.K. City is present in both the dependency!. So option d should be correct?

Please correct me if am wrong.
0
0
how (STREET,CITY) is candidate key??
1
1
"each supplier and each street within a city has unique name" because of this statement.
0
0
each supplier and each street within a city has unique name

It means CITY -> Street,Supplier.Am i right ???

if not please correct me..
0
0

each supplier and each street within a city has unique name

This means when supplier name cannot repeat within a city and same for street.

CITY -> Street,Supplier is wrong as it basically says all street and supplier must be same for a city.

13
13
sir this line "This means when supplier name cannot repeat within a city and same for street." is not clear .please explain..
0
0
Sir what i understood from the statement is that within a city streets and suppliers are unique. So the combination of city,street and city,supplier should be unique.
2
2
(street,city) not a candidate key.. two suppliers can live on the same street and this does not violate the condition.
4
4
because each street is unique within a city and hence combination of street and city will be unique in ech tuple of the relation making it a candidate key.
1
1
Can two $sid$ point to same $city$? is that allowed, or will it break the super key property?
0
0
" each supplier and each street within a city has unique name "

means supplier, street and city are unique combination of 3 elements.

And unique means , it could represent a key by it

So, any two combination of them will be unique candidate key.
0
0
How can we take out the non trivial FD?
0
0
But two different suppliers can live on same street and city combination in that case street and city combination will not be key right
0
0

@Arjun 

sir about your comment 

Each street within a city also has a unique name and so (street, city) is also a candidate key.

but according to question

"each supplier and each street within a city has unique name"
this statement can also mean that given a street name within a city can also have more than 1 suppliers(different name).

 

0
0
@Arjun
 Sir if (street, city) is candidate key. Then by same argument (sid, city) is also a key[superkey because sid is a candidate key]. Therefore (sid, city) -> sname and (street, city) -> sid are true.

But how can we say that (sname, city) ->sid
0
0
this question is concern about only Suppliers schema???
0
0

yes, only supplier table.

chk this line

Assume that, in the suppliers relation above, 

0
0

each supplier and each street within a city has unique name

gives you following FDs in addition to those implied:

  1. (sname,city)=>sid 
  2. (street,city)=>sid

Hence, making both of them {(sname,city);(street,city)} Candidate keys.

0
0

@GauravYadav 

How you got this  “ (street,city)=>sid “

“each supplier and each street within a city has unique name “ It means each supplier within a city has unique supplier name and  each street within a city has unique street name.

So your 2nd FD should be “(street,city)=>street” which is trivial.

Hence we have two CK’s {sid, (sname,city)} and Supplier is BCNF.

Is this correct?

0
0

From the statement “each supplier and each street within a city has unique name“ can we infer (sname,street) also a candidate key like (sname,city) and (city,street) ?

0
0
  1. sid → sname

How was this derived?

 

0
0

@ sir why are we not considering these dependencies

$pid \rightarrow pname, color$

$sid, pname\rightarrow cost$

These clearly seem to be lossless and dependency preserving decomposition of the whole schema. And the question is asking

“which one of the following is true about the above schema

And then because of $pid \rightarrow pname, color$ FD, it is not even in 2NF.

1
1

@Arjun

Sir,

each supplier and each street within a city has unique name

For this you have mentioned below

 

This means when supplier name cannot repeat within a city and same for street.

CITY -> Street,Supplier is wrong as it basically says all street and supplier must be same for a city.

 My question is this : Does that mean that for each CITY Street or Supplier can have multiple values.

For Example –

CITY = “ Delhi”  Street = “MG Road” Supplier = “ABC”

CITY = “ Delhi”  Street = “Nehru Road” Supplier = “EFG”

CITY = “ Mumbai” Street = “MG Road” Supplier = “EFG”

CITY = “ Mumbai” Street = “Nehru Road” Supplier = “ABC”

Is above valid ? If yes , doesn’t it means that they form Multi-valued Dependency?

Please correct if I am wrong.

1
1

@Arjun Sir @srestha ma’am 

Is the table represent the above question statement…..

    sid    sname      city  street
     1     Amit    Pune    A
     2     Ravi    Pune    B
     3     Ravi  Kolkata    C
     4     Amit  Kolkata    B
     5   Soham    Pune    E

here, sid→ sname,sid→ city,sid→ street;

(sname,city)→ sid;  (sname,city)→ street;

Also for the statement in the suppliers relation above, each supplier and each street within a city has unique name  means (Look at above table)

(street,city)→ sname;  (street,city)→ sid;

Thank you for reading…..

  

0
0
12 votes
12 votes
"No other functional dependencies are implied other than those implied by primary and candidate keys"

This line is sufficient to indicate that we have superkeys on LHS always which is the necessary condition to be the relation in BCNF.

So, option A is correct.

2 Comments

Yes true. I don’t get it why people are bothered about other things :(
1
1

@Deepak Poonia sir, can we declare directly ??

1
1
4 votes
4 votes

From the given data the FDs will be ,

(Sid, Street) $\rightarrow$  Sname

As Sid is a primary key, then
(Sid, Street) will be super key.
Hence, it is in BCNF.

3 votes
3 votes
i  think ans is d

because street and sname functionally depend on city (acc to question)

4 Comments

D can not be possible since that combination is given as candidate key .so it satisfy bcnf
0
0

"each supplier and each street within a city has unique name"

@indrajeet
I guess here you think that,  City->name , City->street
It is wrong. 

It means  
name,City -> sid
street,City -> sid
So BCNF.

 

2
2

No other functional dependencies are implied other than those implied by primary and candidate keys.

 

dont this directly says that it is in BCNF.

6
6
@manav ,exactly i also think the same.
0
0
Answer:

Related questions