Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USE SQL Query THAT WORKS WITH ACCESS.(please test it out before posting the answ

ID: 3836165 • Letter: U

Question

USE SQL Query THAT WORKS WITH ACCESS.(please test it out before posting the answers up)

1) List every member's name in the form last name comma first name (for example: Smith, Bob) and their telephone number sorted alphabetically by name
2) List the first name, last name, and birthday of everyone whose birthday is after July 4, 2005
3) List the first name, last name, and birthday of everyone who was born in the month of November
4) List the first name, last name, and how old they were on January 1, 2000 of everyone who was born before that date
5) List everyone's first name, last name, and area code
6) Give everyone's last name in all uppercase
7) List everyone's first name, last name, and how old they are right now (this query should give the current age whenever it is run, not just on the day of the lab)

Members FirstName LastName PhoneNumber Birthday Anna Maria Castanza 828-555-8731 3/3/1996 Astoria Barton 336-555-9301 11/11/2001 Fern Azzam 704-555-3910 3/19/2000 Jamal Freedman 336-555-4529 12/4/1982 Joey Dinardo 336-555-9902 5/12/1975 John Smith 336-555-1212 5/21/1982 Jonas Brothers 828-555-3492 3/21/1974 Juanita Cohen 980-555-0802 4/1/1957 Judson Parker 704-555-9020 2/23/2001 Marina Smith 202-555-9431 5/6/2007 Mary Lamb 336-555-0188 1/24/1999 N'Ketcha Williams 919-555-0011 7/4/1980 Quintin Frieze 910-555-2454 3/9/1998 Terrance Ali 919-555-2924 11/4/2003

Explanation / Answer

1) SELECT LastName+','+FirstName as Name, PhoneNumber from MEMBERS ORDER BY Name

2) SELECT FirstName, LastName,Birthday from MEMBERS where Birthday > #07/04/2005#

3) SELECT FirstName, LastName,Birthday from MEMBERS WHERE MONTH(Birthday) = 11

4) SELECT FirstName, LastName,DateDiff("yyyy",[Birthdate],(01/01/2000))+(Format([Birthdate],"mmdd")>Format((01/01/2000),"mmdd")) as Age from MEMBERS where Birthday > #01/01/2000#

5) SELECT FirstName, LastName, left(PhoneNumber, 3) as AreaCode from MEMBERS

6) SELECT UCASE([LastName]) from MEMBERS

7) SELECT FirstName, LastName,DateDiff("yyyy",[Birthdate],Date())+(Format([Birthdate],"mmdd")>Format(Date(),"mmdd")) as Age from MEMBERS where Birthday > #01/01/2000#