Question

SQL: Assume the table below was identified during a normalization activity. What command would I type...

SQL: Assume the table below was identified during a normalization activity. What command would I type to create this table -- assuming the 'TypeDesc' column was required? (i.e: not allowed to having missing values).   Assume that the possible Type Codes are H, C, W, M, P, S. (Don't worry about inserting the data. Make reasonable assumptions about the datatypes.)

Table Name : Type

TypCode TypeDesc
H Home
C Cell
W Work
M Mobile
P Parent
S Spouse

Homework Answers

Answer #1

CREATE TABLE `Type`(
    `TypCode` char NOT NULL,
    `TypeDesc` char(50) NOT NULL,
    CONSTRAINT Type_pk PRIMARY KEY(`TypCode`),
    CONSTRAINT chk_TypCode CHECK(`TypCode` IN ('H', 'C', 'W', 'M', 'P', 'S'))
);

**************************************************

Thanks for your question. We try our best to help you with detailed answers, But in any case, if you need any modification or have a query/issue with respect to above answer, Please ask that in the comment section. We will surely try to address your query ASAP and resolve the issue.

Please consider providing a thumbs up to this question if it helps you. by Doing that, You will help other students, who are facing similar issue.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT