Here is the code for assignment 12
Use CommunityAssist
create schema HumanResources
Create view HumanResources.vw_EmployeeInfo
As
Select
SSNumber,
LastName as [Last Name],
FirstName as [First Name],
Street,
Apartment,
ContactInfo,
HireDate,
Dependents
From Person p
inner Join PersonAddress pa
on p.PersonKey=pa.PersonKey
inner Join PersonContact pc
on p.PersonKey=pc.PersonKey
inner join Employee e
on p.PersonKey=e.PersonKey
select * from HumanResources.vw_EmployeeInfo
Create login Sue with password='p@ssw0rd1'
Create user SueUser for login Sue with default_schema=HumanResources
Grant Select on Schema::HumanResources to SueUser
Select * from vw_EmployeeInfo
No comments:
Post a Comment