开发者

Does this table violate database normalization? [closed]

开发者 https://www.devze.com 2022-12-07 17:14 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 5 mins ago.

Improve this question

I am learning about database normalization and came up with a table for a car configurator.

The idea is that the table holds the part numbers for the car and their dependencies along with rule type and what country the rules applies to. Can you tell me if the table violates normalization.

Here is a sqlFiddleLink and the code below.

CREATE TABLE [CarConfiguratorRule]
(
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [CarId] [int] NOT NULL,
    [AppliesToPart] [nvarchar](50) NOT NULL,
    [RuleType] [nvarchar](12) NOT NULL,
    [DependsOnPart1] [nvarchar](60) NULL,
    [DependsOnPart2] [nvarchar](60) NULL,
    [DependsOnPart3] [nvarchar](60) NULL,
    [DependsOnPart4] [nvarchar](60) NULL,
    [DependsOnPart5] [nvarchar](60) NULL,
    [DependsOnPart6] [nvarchar](60) NULL,
    [DependsOnPart7] [nvarchar](60) NULL,
    [Type] [nvarchar](10) NOT NULL,
    [Country] [nvarchar](50) NULL,
    [RecordCreated开发者_高级运维] [datetime] NOT NULL,
    [ToggleRule] [bit] NOT NULL
);

 INSERT INTO CarConfiguratorRule(id, CarId, AppliesToPart, RuleType, DependsOnPart1, DependsOnPart2, DependsOnPart3, DependsOnPart4, DependsOnPart5, DependsOnPart6, DependsOnPart7, Type, Country, RecordCreated, ToggleRule)
VALUES
(1, 50, 'brake101','Force','wheel40',' ',' ',' ',' ',' ',' ','All','Ireland','2022-12-07 
13:00:11.683',1);

INSERT INTO CarConfiguratorRule(id, CarId, AppliesToPart,RuleType,DependsOnPart1,DependsOnPart2,DependsOnPart3,DependsOnPart4,DependsOnPart5,DependsOnPart6,DependsOnPart7,Type,Country,RecordCreated,ToggleRule)
VALUES(1, 50, 'wheel12','Force','axel32',' ',' ',' ',' ',' ',' ','All','Ireland','2022-12-06 
13:00:11.683',1);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号