Study Guides (380,000)
CA (150,000)
Ryerson (10,000)
ITM (400)
ITM 500 (10)

ITM500 - LAB 2 SOLUTION.doc


Department
Information Technology Management
Course Code
ITM 500
Professor
Raymond Moss

This preview shows half of the first page. to view the full 2 pages of the document.
--Lab 2 --Use the GolfClub Database.
--Q1. --Q1. List the id , name and member type for all members
select MemberId, MemberName, MemberType from Member
--Q2. List the id , name and member type for all junior members
select MemberId, MemberName, MemberType from Member
where MemberType = 'Junior'
--Q3. List the id, name and bar bill for all members whose bar bill is at least $60 but is no more
than $90
select MemberId, MemberName, Barbill from Member
where Barbill >= 60 and Barbill <= 90
-- or
select MemberId, MemberName, Barbill from Member
where Barbill between 60 and 90
--Q4 List the details for all members who are junior and who also have a handicap under 25
select * from member
where membertype = 'Junior' and handicap < 25
--Q5. List the details for all members whose type is either social or junior
select * from Member
where MemberType = 'Social' or MemberType = 'Junior'
--or
select * from Member
where MemberType in ('Social', 'Junior' )
--Q6. List the details for all members whose type is either Junior or Senior and who also have a
handicap less than 25
select * from member
where (membertype = 'junior' or membertype = 'senior') and handicap < 25
--or
select * from Member
where MemberType in ('Junior','Senior' ) and Handicap < 25
--Q7. List details for all members except those whose type is either senior or junior (Dont just
test for type "social")
select * from Member
where not (MemberType = 'Senior' or MemberType = 'Junior' )
--or
select * from Member
where MemberType not in ('Senior', 'Junior' )
--or
select * from Member
where MemberType <> 'Senior' and MemberType <> 'Junior'
You're Reading a Preview

Unlock to view full version