• Non ci sono risultati.

Relational algebra Exercises on Relational Algebra Tania Cerquitelli

N/A
N/A
Protected

Academic year: 2021

Condividi "Relational algebra Exercises on Relational Algebra Tania Cerquitelli"

Copied!
5
0
0

Testo completo

(1)

DB M G

Relational algebra

Exercises on Relational Algebra

Tania Cerquitelli

(2)

DB M G

Exercise n. 1(a)

For each Italian tour guide who has only guided types of tours lasting more than 2 hours, show name and surname of the guide.

TOUR-GUIDE (GuideCode, Name, Surname, Nationality) TYPE-OF-TOUR (TourTypeCode, Monument, Duration, City) GROUP (GroupCode, NumberOfParticipants, Language)

GUIDED-TOUR-CARRIED-OUT (GroupCode, Date, StartTime, TourTypeCode, GuideCode)

(3)

DB M G

Exercise n. 1(b)

Show surname and nationality of the guides who have guided all types of tours.

TOUR-GUIDE (GuideCode, Name, Surname, Nationality) TYPE-OF-TOUR (TourTypeCode, Monument, Duration, City) GROUP (GroupCode, NumberOfParticipants, Language)

GUIDED-TOUR-CARRIED-OUT (GroupCode, Date, StartTime, TourTypeCode, GuideCode)

(4)

DB M G

Exercise n. 2

Show the name of laboratories with a capacity greater than 10 people, where at least 2 experiments were performed on the same day with devices of type 'video camera' .

STUDENT(StudentID, Name, Surname, DegreeCourse) LABORATORY(LabID, LabName, Capacity)

DEVICE(DeviceID, DeviceName, Type, LabID)

EXPERIMENT(DeviceID, StudentID, Date, Description, Category)

(5)

DB M G

Exercise n. 3

Show the name and surname of the teenagers who subscribed on the same date ( SubscriptionDate ) to at least two different activities, which are organized by two distinct summer camps located in the same city.

TEENAGER(SSN, Name, Surname, BirthDate, CityOfResidence, Sex) ACTIVITY(ActivityCode, AName, Description, Category)

SUMMER-CAMP(CampCode, CampName, City)

SUBSCRIPTION-TO-ACTIVITY-IN-SUMMER-CAMP(SSN, ActivityCode, CampCode, SubscriptionDate)

Riferimenti

Documenti correlati

Find the codes of the sailors who have never booked a red boat SAILOR (SId, SName, Expertise, DateofBirth). BOOKING (SId, BId, Date) BOAT(Bid,

CUSTOMER (CustCode, CustName, Gender, AgeRange, CustCountry) VACATION-RESORT (ResCode, ResName, ResType, Location, ResCountry). RESERVATION(CustCode, StartDate,

TOUR-GUIDE (GuideCode, Name, Surname, Nationality) TYPE-OF-TOUR (TourTypeCode, Monument, Duration, City) GROUP (GroupCode, NumberOfParticipants, Language)..

’Data Mining’, show the code of the author, the surname of the author, her/his university, and the total number of articles presented by the author in each edition of every

Guest (GID, Name, Surname, DateOfBirth) HOTEL (HID, Name, City, Region, #Stars) STAY (GID, HID, StartDate, EndDate) Write the following queries in relational algebra.. Show name

[r]

D102 Smith Computer engineering D105 Jones Computer engineering D104 White Electronics. ProfID PSurname

Department Head Sales De Rossi Personnel Fox π Department, Head