Tutorial_3 - agency? select phoneNumber from AgencyTbl...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 115107 Tutorial 3 Jia Yi Lu 2009S2 1 Querying Relational Databases Topics Queries are used to describe which data is to be retrieved from a database. Jia Yi Lu 2009S2 2 Query by examples – SQL queries Example Case Jia Yi Lu 2009S2 3 Relational tables (relational data model) Jia Yi Lu 2009S2 4 Creating QBE Queries 1. Using QBE, create a query that would return names of all clients at the following phone number: 234-4352 Jia Yi Lu 2009S2 5 QBE Query design Results Jia Yi Lu 2009S2 6
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Creating QBE Queries 2. Using QBE, create a query that would list for each offer, its value, the name of the agency via which it was made, the agency's phone number Jia Yi Lu 2009S2 7 and the address of the house for which the offer was made. Query Design Jia Yi Lu 2009S2 8 Results Creating SQL Queries 1. List the names of all clients at the following phone number: 234-4352 select name from ClientTbl where phoneNumber='234-4352’ Jia Yi Lu 2009S2 9 2. What is the phone number of 'Bayleys'
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: agency? select phoneNumber from AgencyTbl where name='Bayleys' Creating SQL Queries 3. For each offer worth more than 30000, list the amount and the name of the agency that negotiated the offer. Jia Yi Lu 2009S2 10 select amount, agencyName from OfferTbl where amount > 30000 Creating SQL Queries 4. For each offer, list the name of the client who made the offer, the address of the house for which the offer was made. Jia Yi Lu 2009S2 11 select ClientTbl.name, OfferTbl.amount, HouseTbl.address from ClientTbl, OfferTbl, HouseTbl where ClientTbl.id = OfferTbl.clientId and HouseTbl.id = OfferTbl.houseId Exercises See tutorial 3 exercise sheet. Jia Yi Lu 2009S2 12 3 To do • Module 6 software exercises • Assignment (due 07/09/2009) • Practice tests (online) Jia Yi Lu 2009S2 13 Next tutorial is in Week 8 (After the study break) Please bring your text book with you!...
View Full Document

This note was uploaded on 06/01/2010 for the course PN 115.107 taught by Professor Ivan during the Spring '10 term at Massey Palmerston North.

Page1 / 3

Tutorial_3 - agency? select phoneNumber from AgencyTbl...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online