• Non ci sono risultati.

Homework n. 1 - Relational Algebra

N/A
N/A
Protected

Academic year: 2021

Condividi "Homework n. 1 - Relational Algebra"

Copied!
1
0
0

Testo completo

(1)

Introduction to Databases

Homework n. 1 - Relational Algebra

1. Given the following relational schema

USER (UID, Name, Surname, DateOfBirth, City) VIDEO (VID, Title, Category)

VIEW (UID, VID, #Views)

Write the following query in relational algebra

a. Show name and surname of users living in Turin who have viewed only videos in the category Entertainment.

2. Given the following relational schema

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

a. Show name and surname of guests born after 1990/01/01 who have stayed only in hotels located in region Piedmont.

b. Show name and city of hotels that have never hosted clients for stays shorter than 3 days (difference between StartDate and EndDate)

3. Given the following relational schema

PLAYER (PID, Nickname, DateOfBirth, Country) VIDEOGAME (VID, Name, Category)

MATCH (PID, VID, Date, #Hours) Write the following queries in relational algebra

a. Show the nicknames of players who have played all video games belonging to category arcade.

b. Show nickname and country of players who played, on the same date, two different video games belonging to the same category.

1

Riferimenti

Documenti correlati

 Define what is a Spectral Bloom filter, the operations supported, and show the formula of the error rate (as a function of the space and number of keys) and prove its correctness.

1a. Provide the definitions of ‘Giffen good’, and ‘inferior good’. Explain why, if consumer’s money income is given, a Giffen good is necessarily an inferior good, but an

Clinical Pharmacology and Therapeutics, Economic Notes, Health Economics, International Journal of Game Theory, Journal of Institutional and Theoretical Economics, Journal of

Clinical Pharmacology and Therapeutics, Economic Notes, Health Economics, International Journal of Game Theory, Journal of Institutional and Theoretical Economics, Journal of

Clinical Pharmacology and Therapeutics, Economic Notes, Frontiers in Blockchain, Health Economics, International Journal of Game Theory, Journal of Institutional and

Description: These data measure protein consumption in twenty-five European countries for nine food groups. It is possible to use multivariate methods to determine whether there

Multivariate techniques, such as cluster analysis and principal components analysis, may be used to examine which countries have similar employment patterns.. Country: Name

Description: Price and consumption per capita of beef and pork annually from 1925 to 1941 together with other variables relevant to an economic analysis of price and/or consumption