Docsity

Database Programming for WWW - sample examination | INFS 740, Study notes of Database Programming

Toggle sidebar
bg1
Sample Midterm Examination
INFS 740 – Database Programming for the WWW - Prof. A. Brodsky
Student ID:
Student Name:
Signature:
Under the honor code, I will not discuss the content of this exam with any
person who has not taken it.
pf3
pf4
pf5

Partial preview of the text

Download Database Programming for WWW - sample examination | INFS 740 and more Study notes Database Programming in PDF only on Docsity!

Sample Midterm Examination

INFS 740 – Database Programming for the WWW - Prof. A. Brodsky

Student ID:

Student Name:

Signature:

Under the honor code, I will not discuss the content of this exam with any

person who has not taken it.

INFS 740 – Prof. Brodsky

Midterm Examination

Provide all your answers in the space provided (use back of pages if necessary). You have 1 hour 45 minutes. You

MAY use any books or notes, but NOT computers. You are not allowed to receive help from any other person. Be brief

and neat in your answers. Good luck!

Consider the following “Orders-Items-Payments” relational schema:

Order(id: integer,customerName: string, customerNum: integer)

Item(orderID: integer,description: string,cost: real)

Payment(orderID: integer,dueDate: string,amount: real)

Consider also the following “hierarchical orders” XML document:

GMU 12345 2.00 45.0 30.00 17.00 …

Problem 1. Write an XML schema to describe the “hierarchical orders” XML document above as accurately as

possible

Problem 4. Write XQueries that, given a “hierarchical orders” XML document:

a. For every order, creates an element “total items” with the number of items in that order.

b. For every item of $50,000 or more, creates an element “customers” that lists all “customer” elements

for those customers who have an order with that item.

c. Find all customers who have an order with both the most expensive item (i.e., no item is more

expensive) and the least expensive item (i.e., no item is less expensive)

d. Find all customers whose balance is $1000 or more on 10/15/2004. The balance for a customer is

defined as the total price of ordered items minus all the payments that are due before 10/15/