The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+31 votes
5.6k views

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 $3NF$ but not in $\text{BCNF}$
  3. The schema is in $2NF$ but not in $3NF$
  4. The schema is not in $2NF$
in Databases by Veteran (98.3k points)
edited by | 5.6k views
+1
Option A in BCNF
+1
How (street,city) is key because two suppliers can live in the same city and same [email protected] [email protected] mam
0

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

In the Arjun sir answer it is mentioned @ srestha mam

+3
yes, I was wrong

here dependencies are

$sid\rightarrow sid,same,city,street$

$same,city\rightarrow sid,same,city,street$

$street,city\rightarrow sid,same,city,street$

all left side are candidate key
+1

My doubt it....How (street,city) is key because two suppliers can live in the same city and same street then (street,city)--->sname fails...please clarify this @srestha mam!

+1
+2

"No other functional dependencies are implied other then those implied by primary key and candidate keys"

 Isn't this line enough to say that the schema is BCNF!

If not then what does this line mean?

0

Yes the above line is enough.

All the LHS should be a key for the relation to be in BCNF.

5 Answers

+41 votes
Best answer

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

  1. $(sname, city) \to street$
  2. sid → street
  3. (sname, city) → sid
  4. sid → sname
  5. sid → 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$

by Veteran (416k points)
edited by
+3
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
+2
Yes, that is a candidate key as it is unique. I corrected the last part.
0
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.
+1
how (STREET,CITY) is candidate key??
0
"each supplier and each street within a city has unique name" because of this statement.
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..
+9

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.

0
sir this line "This means when supplier name cannot repeat within a city and same for street." is not clear .please explain..
+2
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.
+4
(street,city) not a candidate key.. two suppliers can live on the same street and this does not violate the condition.
0
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.
0
Can two $sid$ point to same $city$? is that allowed, or will it break the super key property?
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
How can we take out the non trivial FD?
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

@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
@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
this question is concern about only Suppliers schema???
+3 votes
i  think ans is d

because street and sname functionally depend on city (acc to question)
by Active (1.6k points)
0
D can not be possible since that combination is given as candidate key .so it satisfy bcnf
+1

"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.

 

+3

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

 

dont this directly says that it is in BCNF.

0
@manav ,exactly i also think the same.
0 votes
Please explain clearly i am not getting the concept that how we can conclude BCNF without FD's and by theory i think we can only derive that (sname , city) is candidate key and city --> sname but how bcnf is concluded ?
by Active (1.4k points)
0
What i understood is in a city the street names are unique. But in a street there can be multiple suppliers residing. And candidate key basically means it should identify a row uniquely. But (street, city) returns multiple sid's. How can it be candidate key?

Please correct me if i am wrong.
0
@Arjun sir please help.

I still do not understand how (street,city) can uniquely identify a supplier.
0 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.

by Active (1.5k points)
0 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.

by Junior (595 points)
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,830 questions
54,735 answers
189,349 comments
80,095 users