ANSWERS TO MODULE 1 PDF QUESTIONS

1.) Return a list of residences only from the person table.  Create an alias for the residence column called "First City Lived".

SELECT
residence AS [
First City Lived]
FROM person

2.) Return a list of account numbers from the account table?  Alias this column as "Bank Account Numbers".

SELECT
account_number_pk  AS [Bank Account Numbers]   
FROM account

3.) Write a query that return the account number and name from the account table.

SELECT
person_id,
account_number_pk  AS [Bank Account Numbers] 
FROM account


4.) Create an alias for the account and name columns of the account table then sort the account table by name then account number.

SELECT
person_id AS [Account Holder],
account_number_pk  AS [Bank Account Numbers] 
FROM account
ORDER BY
person_id, 
account_number_pk
 


5.) Write a query that return the account number and name from the account table. Sort this query by city only.

SELECT
person_id AS [Account Holder],
account_number_pk  AS [Bank Account Numbers],
residence AS City
FROM account
ORDER BY
residence