Database Design
QUERIES
Query Design
 It is important to design all queries that might be required.
 Query design should include the following:
 Fields
 Tables
 Criteria for query
 Sort order
Example
 Design a query to list hotel names and phone numbers with at least a 4
star rating and a swimming pool:
Field (s) hotelName, hotelNumberm StarRating, SwimmingPool
Table (s) Hotel
Search Criteria StarRating => 4 AND SwimmingPool = True
Sort Order

Database query design

  • 1.
  • 2.
    Query Design  Itis important to design all queries that might be required.  Query design should include the following:  Fields  Tables  Criteria for query  Sort order
  • 3.
    Example  Design aquery to list hotel names and phone numbers with at least a 4 star rating and a swimming pool: Field (s) hotelName, hotelNumberm StarRating, SwimmingPool Table (s) Hotel Search Criteria StarRating => 4 AND SwimmingPool = True Sort Order