Question

Can you write below relations like these (with symbols)? (∏ PName (σ TName = ‘Fire’ (Pokemon...

Can you write below relations like these (with symbols)?

(∏ PName (σ TName = ‘Fire’ (Pokemon X Type))), (∏ SSN, Surname(σ Name = ‘Gary’ (Trainer)))

3)Select PName from Pokémon inner join InType on Pokémon.PID = InType.PID inner join Type on Type.TID = InType.TID where TName = 'Fire';

4)Select SSN, Surname from Trainer where name = 'Gary';

5)Select TName from Type inner join StrongAgainst on Type.TID = StringAgainst.TID_String where TID_Weak = 'Electricity';

6)Select Name, Surname from Trainer, Owns, Pokemon where Trainer.SSN = Owns.SSN and Owns.PID != Pokémon.PID ;

7)Select PName, TName from Pokémon inner join InType on Pokémon.PID = InType.PID inner join Type on Type.TID = InType.TID inner join Owns on Pokémon.PID = Owns .PID inner join Trainer on Owns.TID = Trainer.TID where Trainer.Name = 'Drizzt' or Trainer.Name = 'Bruenor';

8)Select PName, Name, Surname from Trainer inner join Owns on Owns.TID = Trainer.TID inner join Pokémon on Pokémon.PID = Owns .PID group by PName having count(PName) >= 1;

9)Select Trainer.SSN from Trainer, Owns, Pokémon, SpecializedIn where Trainer.SSN = Owns.SSN and Owns.PID != Pokémon.PID and Trainer.SSN = SpecializedIn.SSN;

10)Select Nickname from Pokémon inner join Owns on Pokémon.PID = Owns .PID where weight = (Select max(weight) from Owns);

11)Select PName,Weight,Height from Pokémon inner join Owns on Pokémon.PID = Owns .PID inner join Trainer on Owns.TID = Trainer.TID where Trainer.SSN = '1837837';

12)Select PName, Level from Pokémon inner join Owns on Pokémon.PID = Owns .PID inner join Trainer on Owns.TID = Trainer.TID inner join SpecializedIn on Trainer.SSN = SpecializedIn.SSN inner join StrongAgainst on SpecializedIn.TID = StrongAgainst.TID_Strong where TID_Weak = 'Rock' or TID_Weak= 'Water';

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Note: As Chegg’s Policy I’m only allowed to answer the first 4 parts of a question. Please post the other questions separately.

3) Select PName from Pokémon inner join InType on Pokémon.PID = InType.PID inner join Type on Type.TID = InType.TID where TName = 'Fire';

ΠPname (Pokemon ⋈(Pokemon.PID=InType.PID) InType⋈(InType.TID=Type.TID ⋀ TName=’Fire’) Type)

4) Select SSN, Surname from Trainer where name = 'Gary';

ΠSSN, Surname(name=’Gary’) (Trainer))

5) Select TName from Type inner join StrongAgainst on Type.TID = StringAgainst.TID_String where TID_Weak = 'Electricity';

ΠTname (Type⋈(Type.TID=StrongAgainst.TID_String ⋀ TID_Weak=’Electricity’) StrongAgainst)

6) Select Name, Surname from Trainer, Owns, Pokemon where Trainer.SSN = Owns.SSN and Owns.PID != Pokémon.PID ;

ΠName, Surname(Tainer.SSN=Owns.SSN ⋀ Owns.PID!=Pokemon.PID) (Trainer X Owns X Pokemon)

Add a comment
Know the answer?
Add Answer to:
Can you write below relations like these (with symbols)? (∏ PName (σ TName = ‘Fire’ (Pokemon...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The following relational schema is given for a Pokemon Database: Pokemon (PID, PName) Type (TID, TName)...

    The following relational schema is given for a Pokemon Database: Pokemon (PID, PName) Type (TID, TName) Trainer (SSN, Name, Surname) InType (PID, TID) StrongAgainst (TID_Strong, TID_Weak) Owns (SSN, PID, Nickname, Level, Height, Weight, Catch_Date) SpecializedIn (SSN, TID) In this database, Pokemon (Imaginary creatures, short for “Pocket Monsters”) are stored in the entity set Pokemon, with a unique PID and PName. Pokemon types are stored in the entity set Type, with a unique TID and TName. Pokemon trainers are stored in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT