Professional Documents
Culture Documents
Exercise 11.1.2 p.487:
Ajouter les faits suivants
_Star Wars Movie was directed by George Lucas, and was produced by Gary Kurtz
_Carrie Fisher and Mark Hamill appeared in Empire Strikes Back Movie and Return of the Jedi Movie
_ Fox studio, is a studio in Hollywood. It owns Empire Strikes Back Movie and Return of the Jedi Movie
Exercise 11.1.2 p.528:
(b) Find all the Class elements for classes with a displacement larger than 35000.
(c) Find all the Ship elements for ships that were launched before 1917.
ou avec XQuery
(e) Find the years in which ships having the same name as their class were launched.
//Ship[@name = ../@name]/@launched
(g) Find the Ship elements for all ships that fought in two or more battles.
//Ship[count(Battle) >= 2]
(a) Find the names of the classes that had at least 10 guns.
→ sol 1
return data($class/@name)
→ sol 2
let $x := //Class
for $class in $x
return data($class/@name)
(b) Find the names of the ships that had at least 10 guns.
(c) Find the names of the ships that were sunk.
(d) Find the names of the classes with at least 3 ships.
(e) Find the names of the classes such that no ship of that class was in a battle.
(f) Find the names of the classes that had at least two ships launched in the same year.
(g) Produce a sequence of items of the form
<Battle name = x> <Ship name = y />… < /Battle>
a) //Ship/@name
Kongo
Hiei
Kirishima
Hurana
North Carolina
Washington
Tennessee
California
King George V
Prince of Wales
Duke of York
Howe
Anson
1941
1920
1940
F) /Ships/Class/Ship [Battle]/@name
Kirishima
Washington
Tennessee
California
Prince of Wales
Duke of York
Exercise 12.2.2
a)
return data($class/@name)
b)
return data($class/Ship/@name)
c)
return data($ship/@name)
d)
return data($class/@name)
e)
return data($class/@name)
or
where count($class//Battle) = 0
return data($class/@name)
f)
return data($class/@name)
}</Battle>