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';
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)
Can you write below relations like these (with symbols)? (∏ PName (σ TName = ‘Fire’ (Pokemon...
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...