SQL - How to limit data entry of one attribute depending on another attribute?

Viewed 707

Below is the DDL for the table I want to create. However, I want the attribute 'Expertise_breed' to be derived from 'Expertise_animal'. For example, if 'Dog' is entered into 'Expertise_animal' I don't want to be able to enter in a breed of cat. How would I go about achieving this? I'm working with SQL Server Management Studio 2012

CREATE TABLE tExpertise
(
Expertise_ID        int         NOT NULL  PRIMARY KEY, --E.G Data '001'
Expertise_type      varchar(8)  NOT NULL,              --E.G Data 'Domestic'
Expertise_animal    varchar(30) NOT NULL,              --E.G Data 'Dog'
Expertise_breed     varchar(30) NOT NULL               --E.G Data 'Poodle'
)
3 Answers
Related