Загрузил скрипты лаб 1-7
This commit is contained in:
43
Lab7/Task1and2.sql
Normal file
43
Lab7/Task1and2.sql
Normal file
@@ -0,0 +1,43 @@
|
||||
USE AdventureWorks;
|
||||
|
||||
-- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1
|
||||
GO
|
||||
CREATE VIEW HumanResources.vEmployeeDetails
|
||||
WITH SCHEMABINDING AS
|
||||
SELECT
|
||||
e.EmployeeID
|
||||
,c.Title
|
||||
,c.FirstName
|
||||
,c.MiddleName
|
||||
,c.LastName
|
||||
,c.Suffix
|
||||
,e.Title AS JobTitle
|
||||
,c.Phone
|
||||
,c.EmailAddress
|
||||
,c.EmailPromotion
|
||||
,a.AddressLine1
|
||||
,a.AddressLine2
|
||||
,a.City
|
||||
,sp.Name AS StateProvinceName
|
||||
,a.PostalCode
|
||||
,cr.Name AS CountryRegionName
|
||||
,c.AdditionalContactInfo
|
||||
FROM HumanResources.Employee e
|
||||
INNER JOIN Person.Contact c
|
||||
ON c.ContactID = e.ContactID
|
||||
INNER JOIN HumanResources.EmployeeAddress ea
|
||||
ON e.EmployeeID = ea.EmployeeID
|
||||
INNER JOIN Person.Address a
|
||||
ON ea.AddressID = a.AddressID
|
||||
INNER JOIN Person.StateProvince sp
|
||||
ON sp.StateProvinceID = a.StateProvinceID
|
||||
INNER JOIN Person.CountryRegion cr
|
||||
ON cr.CountryRegionCode = sp.CountryRegionCode;
|
||||
GO
|
||||
|
||||
SELECT * FROM HumanResources.vEmployeeDetails;
|
||||
|
||||
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2
|
||||
GO
|
||||
CREATE UNIQUE CLUSTERED INDEX IX_vEmployeeDetails
|
||||
ON HumanResources.vEmployeeDetails (EmployeeID);
|
||||
6
Lab7/Task3.sql
Normal file
6
Lab7/Task3.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
USE AdventureWorks;
|
||||
|
||||
GO
|
||||
EXEC sp_depends @objname="HumanResources.vEmployeeDetails";
|
||||
GO
|
||||
EXEC sp_helptext @objname="HumanResources.vEmployeeDetails";
|
||||
Reference in New Issue
Block a user