CSE 444 Midterm

Autumn 2000

Solutions

 

 

  1. Relations:
    1. Person(ssn, name)
    2. Buyer(ssn, income)
    3. Seller(ssn)
    4. Realtor(ssn, rid, cellular, companyName)
    5. Sales(buyerSsn, sellerSsn, buyerAgentRid, sellerAgentRid, price)
    6. Company(name, phone)

 

 

      2. a.   AB+  = ABM

b.      AC+ = ACMNS

c.       BC+ =  BCMNSAD

d.      The following instance is such an example:

A

B

C

D

M

N

S

a

b1

c

d1

m

n

s

a

b2

c

d2

m

n

s

 

 

      3.   a.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

     b. i.

Select distinct url

From WebPage

Where “Old English” = ALL (select origin

                                                 From Contains, Dictionary

                                                 Where url=pageUrl AND dictWord = word)

 

         ii.
            Select author

            From WebPage, Contains

            Where url=pageUrl

            Group By author

            Having count(distinct dictWord) >= 10000

 

         iii.

              select x.url, y.url

              from Contains x, Contains y

              where x.dictWord = y.dictWord

              group by x.url, y.url

              having count(distinct x.dictWord) >= 50

 

 

4.

 

<memories>                  

<party> <date>1999</date>

<person> <name>John</name>

                <email>j@partygoers.org </email>

</person>

<person> <name>Jim</name> 

</person>

<person> <name> Mary </name>

  <phone>555-1234</phone>

  <email>m@partygoers.org</email>

</person>

</party>

<party> <date>2000</date> 

<date>2001</date>

 
             <everybody>  </everybody>

</party>

<party><person><name>John</name>

                           <phone>555-2345</phone>

            </person>

                         <everybody> </everybody>

</party>

</memories>