S
S
strelkovandreyv2020-12-30 08:35:57
SQL
strelkovandreyv, 2020-12-30 08:35:57

How to normalize a table in a reference?

Good afternoon, please tell me how to normalize a table into a lookup table when there is a table of the following type:
REPORT_ID ; IPAGE ; IFIELD ; IVALUE
1 ; Windows Video; Device Description ; Intel HD 2000
1 ; Windows Video; Type of video processor ; Intel Family
1; Windows Video; The amount of video memory; 1024 KB
2 ; Windows Video; Device Description ; Intel HD 2000
2 ; Windows Video; Type of video processor ; Intel Family
2; Windows Video; The amount of video memory; 1024 KB
2 ; Windows Video; Device Description ; NVIDIA GeForce 680
2 ; Windows Video; Type of video processor ; NVIDIA
2; Windows Video; The amount of video memory; 4 GB
3; Windows Video; Device Description ; Intel HD 2000
3 ; Windows Video; Type of video processor ; Intel Family
3; Windows Video; The amount of video memory; 2048 KB
At the output, you need to get a table of the following kind:
VIDEOCARD_TITLE ; VIDEOCARD_TYPE_PROCESSOR ; VIDECARD_MEMORY_SIZE
IntelHD 2000 ; Intel Family; 1024 KB
NVIDIA Geforce 680; NVIDIA; 4 GB
Intel HD 2000; Intel Family; 2048 KB
i.e. a normalized table with uniqueness in all fields (i.e., as in the example, if the RAMs are of different sizes, then it is assumed that this is already a different video card), and also without repetition (i.e., there are like 2 pieces of an IntelHD 2000 video card with operational 1024kb - but as a result there should be only one)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tsvetkov, 2020-12-30
@tsklab

Probably, this is not a normalization, but a request:SELECT DISTINCT

D
Dimon Martovsky, 2020-03-31
@Brezencat

Normalization is when you create parallel references to a table. And your table should look like:
1; 01; 001; blah blah blah
1; 01; 002; Intel or 0001
1; 01; 003; 1024
2; 01; 001; blah blah blah
2; 01; 002; Intel or 0001
2; 01; 003; 4 GB
3; 02; 001; blah blah blah
3; 02; 002; Radeon or 0002
3; 02; 003; 8 GB
And what you specify in the condition for receiving the output will give a view with joins for directories and a table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question