Northwind Database (Document! X Sample)
AdventureWorks Database / Person Schema / Person.PersonPhone Table
In This Topic
    Person.PersonPhone Table
    In This Topic
    Description
    Telephone number and type of a person.
    Properties
    Creation Date27/10/2017 14:33
    File GroupPRIMARY
    Text File Group
    System Object
    Published for Replication
    Rows19972
    Data Space Used1,184.00 KB
    Index Space Used992.00 KB
    Columns
     Column NameDescriptionDatatypeLengthAllow NullsDefaultFormula
    Primary Key Business entity identification number. Foreign key to Person.BusinessEntityID.Integer4   
    Primary Key Telephone number identification number.dbo.Phone25   
    Primary Key Kind of phone number. Foreign key to PhoneNumberType.PhoneNumberTypeID.Integer4   
     Date and time the record was last updated.DBTimeStamp4 
    (getdate())
     
    Indexes
    IndexDescriptionPrimaryUnique
    Nonclustered index.  
    Primary key (clustered) constraint
    Relationships
    RelationshipDescription
    Foreign key constraint referencing Person.BusinessEntityID.
    Foreign key constraint referencing PhoneNumberType.PhoneNumberTypeID.
    Objects that depend on Person.PersonPhone
     Database ObjectObject TypeDescriptionDep Level
    HumanResources.vEmployee viewHumanResources.vEmployeeViewEmployee names and addresses.2
    Sales.vIndividualCustomer viewSales.vIndividualCustomerViewIndividual customers (names and addresses) that purchase Adventure Works Cycles products online.2
    Sales.vSalesPerson viewSales.vSalesPersonViewSales representiatives (names and addresses) and their sales-related information.1
    Sales.vStoreWithContacts viewSales.vStoreWithContactsViewStores (including store contacts) that sell Adventure Works Cycles products to consumers.1
    Purchasing.vVendorWithContacts viewPurchasing.vVendorWithContactsViewVendor (company) names and the names of vendor employees to contact.1
    Objects that Person.PersonPhone depends on
     Database ObjectObject TypeDescriptionDep Level
    Person.BusinessEntity tablePerson.BusinessEntityTableSource of the ID that connects vendors, customers, and employees with address and contact information.2
    dbo.Name datatypedbo.NameUser Defined Data Type 2
    dbo.NameStyle datatypedbo.NameStyleUser Defined Data Type 5
    Person.Person tablePerson.PersonTableHuman beings involved with AdventureWorks: employees, customer contacts, and vendor contacts.4
    dbo.Phone datatypedbo.PhoneUser Defined Data Type 2
    Person.PhoneNumberType tablePerson.PhoneNumberTypeTableType of phone number of a person.1
    SQL
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    CREATE TABLE [Person].[PersonPhone](
        [BusinessEntityID] [int] NOT NULL,
        [PhoneNumber] [dbo].[Phone] NOT NULL,
        [PhoneNumberTypeID] [int] NOT NULL,
        [ModifiedDate] [datetime] NOT NULL,
     CONSTRAINT [PK_PersonPhone_BusinessEntityID_PhoneNumber_PhoneNumberTypeID] PRIMARY KEY CLUSTERED 
    (
        [BusinessEntityID] ASC,
        [PhoneNumber] ASC,
        [PhoneNumberTypeID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    
    ALTER TABLE [Person].[PersonPhone] ADD  CONSTRAINT [DF_PersonPhone_ModifiedDate]  DEFAULT (getdate()) FOR [ModifiedDate]
    ALTER TABLE [Person].[PersonPhone]  WITH CHECK ADD  CONSTRAINT [FK_PersonPhone_Person_BusinessEntityID] FOREIGN KEY([BusinessEntityID])
    REFERENCES [Person].[Person] ([BusinessEntityID])
    ALTER TABLE [Person].[PersonPhone] CHECK CONSTRAINT [FK_PersonPhone_Person_BusinessEntityID]
    ALTER TABLE [Person].[PersonPhone]  WITH CHECK ADD  CONSTRAINT [FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID] FOREIGN KEY([PhoneNumberTypeID])
    REFERENCES [Person].[PhoneNumberType] ([PhoneNumberTypeID])
    ALTER TABLE [Person].[PersonPhone] CHECK CONSTRAINT [FK_PersonPhone_PhoneNumberType_PhoneNumberTypeID]
    See Also