Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Considering the following four tables: Farmer(SIN, name, age, sex, vname) Village(name, area, population, province) KKids(SIN, f_sin, m_sin, s_name) School(sname, vname, no_classes) Where: sname=school name, vname

Considering the following four tables: Farmer(SIN, name, age, sex, vname) Village(name, area, population, province) KKids(SIN, f_sin, m_sin, s_name) School(sname, vname, no_classes) Where: sname=school name, vname =village name, f_sin and m_sin stand for the father`s and mother`s SIN, respectively.

2) Code the following queries in XQuery: a) Find SIN of farmers who have some kids going to school? b) Find name of each school attended only by kids from the same village where the school is located? c) Find the name of the most crowded village(s) (most population)? d) Find SIN numbers of farmers who have at least one kid in every school registered in the database? e) Find names of villages with no schools? f) Find the school attended by all kids of Mark? (all kids of Mark must go to school and must attend same school) g) Find names of farmers whose kids go only to schools outside the Province where the farmers live? (the farmer may have kids not going to schools at all, but if some of the kids go to schools then the schools they attend must be in other Provinces)

PLEASE ANSWER IT IN FORM OF XQUERY NOT TRC DRC

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

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions

Question

Directors own a company. True/False?

Answered: 1 week ago

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago