Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve the following relational algebra problems The following tables include information about tourists, their organizations, some organizations may have planned tours and information is kept

image text in transcribedSolve the following relational algebra problems

The following tables include information about tourists, their organizations, some organizations may have planned tours and information is kept about the tourists to participate in each tour; a tourist may work-for more than one organization. A tourist may participate in any tour whether organized by his/her organization or not. Each tourist has a city and a country where they live which may be different than their citizenship. Note that tid means tourist ID, code means tour code, org_name means organization name, sin fdl and sin_fd2 represent sin numbers of a person and his/her friend, citizenship is a country Tour(code, city, country, time, day) Tourist(tid, sin, name, citizenship, city, country, age, gender) Participate(tid, code, class) Organization(name, code, leader-tid, leader-sin, city, year_started) Works-for(tid,org-name) Friend(sin fdi, sin fd2) Code the following queries in SOL: a) Find codes of tours which do not have any first-class participant who lives in Canada? b) Find the number and average age of tourists who participated in at least one tour with an Italian tourist? c) Find the name of each organization whose leader is a tourist who lives in the same city where the organization is located? Code the following queries in Relational Algebra: d) Find tours which have the largest number of Canadian participants? (notice that Canada is a citizenship) e) Find the name of tourist who participated in all the tour(s) in his/her country of citizenship? f) Find id's and names of tourists who live in Toronto and participated in a tour in Berlin organized by an organization in London? Code the following queries in Tuple Relational Calculus: g) Find id's of organizations which do not have any Spanish workers? (notice that Spain is a citizenship) h) Find organizations who have German leaders and at least one worker who lives in India? The following tables include information about tourists, their organizations, some organizations may have planned tours and information is kept about the tourists to participate in each tour; a tourist may work-for more than one organization. A tourist may participate in any tour whether organized by his/her organization or not. Each tourist has a city and a country where they live which may be different than their citizenship. Note that tid means tourist ID, code means tour code, org_name means organization name, sin fdl and sin_fd2 represent sin numbers of a person and his/her friend, citizenship is a country Tour(code, city, country, time, day) Tourist(tid, sin, name, citizenship, city, country, age, gender) Participate(tid, code, class) Organization(name, code, leader-tid, leader-sin, city, year_started) Works-for(tid,org-name) Friend(sin fdi, sin fd2) Code the following queries in SOL: a) Find codes of tours which do not have any first-class participant who lives in Canada? b) Find the number and average age of tourists who participated in at least one tour with an Italian tourist? c) Find the name of each organization whose leader is a tourist who lives in the same city where the organization is located? Code the following queries in Relational Algebra: d) Find tours which have the largest number of Canadian participants? (notice that Canada is a citizenship) e) Find the name of tourist who participated in all the tour(s) in his/her country of citizenship? f) Find id's and names of tourists who live in Toronto and participated in a tour in Berlin organized by an organization in London? Code the following queries in Tuple Relational Calculus: g) Find id's of organizations which do not have any Spanish workers? (notice that Spain is a citizenship) h) Find organizations who have German leaders and at least one worker who lives in India

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

Describe the four motives or reasons for holding cash.

Answered: 1 week ago