Section 1
Exercise 11.1.1
a)
b)
c)
Exercise 11.1.2
Exercise 11.1.3
Exercise 11.1.4
Exercise 11.1.5
In the semistructured model, nodes represent data elements, i.e., entities rather than entity sets. In
Section 2
Exercise 11.2.1
<? xml version = “1.0” encoding = “utf-8” standalone = “yes” ?>
<StarMovieData>
<Star starID = “cf” starredIn = “sw”>
<Street>456 Oak Rd.</Street>
<City>Brentwood</City>
</Address>
</Star>
Exercise 11.2.2
Title
Year
Length
Wind
Star Wars
1977
124
1992
95
Gone with the
1939
231
Figure 2.3: The Relation Movies
The relation Movies in XML:
<Movies>
<Movie>
<Title>Gone with the Wing</title>
Exercise 11.2.3
An empty element can be represented as a SubElement whose childID value is null (or a prede-
fined ID that does not map to any element).
Exercise 11.2.4
DocRoot(docID, rootElementID)
Section 3
Exercise 11.3.1
<?xml version = “1.0” encoding = “utf-8” standalone = “yes” ?>
<StarMovieData>
</Star>
<Star starID = “mh” starredIn = “sw tesb rotj”>
<Name>Mark Hamill</Name>
<Address>
<Street>456 Oak Rd.</Street>
<City>Brentwood</City>
</Address>
<Year>1980</Year>
</Movie>
<Movie movieID = “rotj” starsOf = “cf mh hf”>
<Title>Return of the Jedi</Title>
Exercise 11.3.2
<!DOCTYPE Bank [
<!ELEMENT BANK (CUSTOMER*, ACCOUNT*)>
<!ELEMENT CUSTOMER (NAME, ADDRESS, PHONE, SSNO)>
<!ATTLIST CUSTOMER
custId ID
Exercise 11.3.3
<!DOCTYPE Sport [
<!ELEMENT SPORT(TEAM*, FAN*)>
<!ELEMENT TEAM(NAME, PLAYER+, COLOR+)>
<!ATTLIST TEAM
captain IDREF #REQUIRED
Exercise 11.3.4
<!DOCTYPE Genealogy [
<!ELEMENT GENEALOGY(PERSON*)>
Exercise 11.3.5
Relation schema: RELATIONNAME(attribute list)
<!DOCTYPE RELATIONNAME [
<!ELEMENT RELATIONNAME(ROW*)>
Section 4
Exercise 11.4.1
<Movies>
<Movie>
<Title>Star Wars</Title>
Exercise 11.4.2
<?xml version=”1.0″ encoding=”UTF-8″?>
<xs:schema xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
Exercise 11.4.3
<!DOCTYPE MOVIES [
<!ELEMENT Title (#PCDATA)>
]>
<!DOCTYPE STARS [
<!ELEMENT Stars (Star+)>
Note: DTD is not as granular as XML schema; some restrictions in XML schema cannot be en-