Reference no: EM133368751
Question 1. In T-SQL, "create a" new VIEW called PersonsByCountry that displays a list of all Persons' names and the country they live in.
Question 2. "Write a" SELECT query to display all the data from the PersonsByCountry view, sorted by country name, person's last name, then first name.
Question 3. In the SSMS GUI Editor, "create a" second VIEW, called PersonAndEmailsByCountry, based on the view from part 1, that displays all data and includes each person's email address. Note: This isn't a copy-paste-SQL job! Reference the other view in the new view, which may require you to make some changes to the original PersonsByCountry view.
Question 4. Script your GUI-created VIEW and add the CREATE VIEW part to the T-SQL script you're writing for the other steps. (Right-click the PersonAndEmailsByCountry view, choose Script View AS... Create...)
Question 5. "Write a" SELECT query to display data from the PersonAndEmailsByCountry view, for persons residing in the USA, and whose email addresses start with 'P', sorted by person's last name, then first name, and hiding any non-user-friendly columns of data.
Question 6. In T-SQL, "create a" new view called PersonEmployees, based on the view from part 3, that displays all the person data for anyone who is an employee of the AdventureWorks company, and includes their job title and hire date.
Question 7. "Write a" SELECT query to display data from the PersonEmployees view, showing the employee's full name (in a single field), their job title, hire date, email address and country, for any employee hired in 2012 or later. Sort the data from most recent hire date, then by job title, then employee name. (Note: Remember that in AdventureWorks, you have to include the schema in the table name. The Employee table is in a schema called HumanResources).