Questions from Database Management


Q: Write an SQL query that lists the vendor ID, vendor name

Write an SQL query that lists the vendor ID, vendor name, material ID, material name, and supply unit prices for all those materials that are provided by more than one vendor.

See Answer

Q: Review the first query in the “Correlated Subqueries” section.

Review the first query in the “Correlated Subqueries” section. Can you identify a special set of standard prices for which this query will not yield the desired result? How might you rewrite the query...

See Answer

Q: List the IDs and names of all products that cost less than

List the IDs and names of all products that cost less than the average product price in their product line.

See Answer

Q: List the IDs and names of those sales territories that have at

List the IDs and names of those sales territories that have at least 50 percent more customers as the average number of customers per territory.

See Answer

Q: Write an SQL query to list the order number, product ID

Write an SQL query to list the order number, product ID, and ordered quantity for all ordered products for which the ordered quantity is greater than the average ordered quantity for that product.

See Answer

Q: Write an SQL query to list the salesperson who has sold the

Write an SQL query to list the salesperson who has sold the most computer desks.

See Answer

Q: For each of the descriptions below, perform the following tasks:

For each of the descriptions below, perform the following tasks: i. Identify the degree and cardinalities of each relationship. ii. Express the relationships in each description graphically with an E-...

See Answer

Q: Display in product ID order the product ID and total amount ordered

Display in product ID order the product ID and total amount ordered of that product by the customer who has bought the most of that product; use a derived table in a FROM clause to answer this query....

See Answer

Q: Display employee information for all the employees in each state who were

Display employee information for all the employees in each state who were hired before the most recently hired person in that state.

See Answer

Q: The head of marketing is interested in some opportunities for cross-

The head of marketing is interested in some opportunities for cross-selling of products. She thinks that the way to identify cross-selling opportunities is to know for each product how many other prod...

See Answer