• Aucun résultat trouvé

Exercise sheet on Relational Algebra Prerequisites Uncertain data management

N/A
N/A
Protected

Academic year: 2022

Partager "Exercise sheet on Relational Algebra Prerequisites Uncertain data management"

Copied!
1
0
0

Texte intégral

(1)

Exercise sheet on Relational Algebra Prerequisites

Uncertain data management

Silviu Maniu November 21st, 2017

Exercise 1

Consider a database schema that consists of the following tables:

• Supplier(sid,sname,address), indicating supplier details,

• Parts(pid,pname,color), indicating the details of each part, and

• Catalog(sid,pid,cost), listing the prices charged for parts by suppliers.

Write the following queries in relational algebra and in SQL:

1. Find the names of suppliers who supply some red part.

2. Find the sids of suppliers who supply some red or green part.

3. Find the sids of suppliers who supply some red part or are at 221 Packer Street.

4. Find the sids of suppliers who supply some red part and some green part.

5. Find pairs of sids such that the supplier with the first sid charges more for some part than the supplier with the second sid.

6. Find the pids of parts supplied by at least two different suppliers.

Exercise 2

Given two relationsR1 andR2, whereR1 containsN1tuples,R2containsN2 tuples, andN2 > N1 >0, give the minimum and maximum possible sizes (in tuples) for the resulting relation produced by each of the following relational algebra expressions:

1. R1∪R2, 2. R1∩R2, 3. R1−R2, 4. R1×R2, 5. σa=5(R1), 6. πa(R1).

Sources

R. Ramakrishnan, J. Gehrke. Database Management Systems, 3rd ed., 2002. Exercises 4.3 and 4.2.

Références

Documents relatifs

Le mucus va entrainer avec lui des cellules mucineuses qui vont essaimer dans la cavité péritonéale et se multiplier pour former un pseudomyxome. Pour cela

In this article, we provide a Coq mechanised, executable, formal semantics for realistic SQL queries consisting of select [distinct] from where group by having queries with NULL

Streams: a a good abstraction for iterative distributed execu- tion. • no order

Π teacher,resp (Class) teacher resp Antoine Fabian Silviu Fabian.. → Duplicates

Write a Boolean relational algebra query that asks whether some class has a scheduled lab in the same room as the exam for that class.. (By scheduled, we mean that the

Even practi- cal algorithm to approximate certain answers (answers which are true regardless of how incomplete information is interpreted) are often de- veloped in the model with

graph analysis, the proposed algebra allows the construc- tion of queries involving subgoals such as: obtain a sub- graph based on given nodes properties and edge labels; cal-

Temporal databases are queried using a temporal relational algebra (TRA) which extends the relational algebra point-wise upon the set of natural numbers, Although TRA lacks the