Beruflich Dokumente
Kultur Dokumente
List of articles
Q1 What kind of problems or disadvantages may occur in the handling/maintenance of this list (imag
Q2 Create a better data model for these pieces of information.
Q3 Explain, why your data model is better than the original list.
Q4 Once your better data model has been established, create an SQL query that generates the orig
nce of this list (imagine, that a real world list like this would contain thousands of entries)?
Redundancy in table may lead to more disk storage consumption and very fast growing of the table,
to look over records in big-sized table takes great time
Unnormilized table also may have negative effect for writing records into the database
Using strings as key for indexing and access may lead to slow perfomance
he handling/maintenance of this list (imagine, that a real world list like this would
Orders
PK+index FK
id article_key price_€
1 1 159.00
2 1 161.00
3 1 158.50
4 2 105.00
5 2 99.00
6 2 102.00
7 3 19.00
8 3 21.00
Articles
PK+index
id article_no
1 4711
2 4712
3 4713
ese pieces of information.
FK PK+index
provider_key id
1 1
2 2
3 3
1
2
3
2
3
article
Radkappe "Alu"
Radfelge "Stahl"
Scheibenwischer "M-Benz"
Providers
provider_no provider
0001 Kemper GmbH
0002 Franz M. AG
0003 Dieter G. GmbH & Co. KG
Explain, why your data model is better than the original list.
Normalizing DB schema gives better perfomance (as far as writing or inserting new values in DB are co
Also this schema reduces storage space on the disk (exclude redundancy)
Indexing also should be created on the keys. All keys should be numeric (not string!) BIGINT unsigned
This can give better access time results, when looking over billions records.
This schema also can be easily partitioned for example by date, also sharding can be used.
For further steps it can be integrated to replicate into Clickhouse archive (for example)
As far as billions records are concerned it is not only design schema table is under consideration, but m
mysql server should be configured in a rigth way, using special tools and technics and solutions
oncerned)
d for example
Once your better data model has been established, create an SQL query
SELECT c.article_no, c.article, b.provider_no, b.provider, a.price_€
FROM usersdb.orders AS a, usersdb.providers AS b, usersdb.articles AS c
WHERE a.provider_key = b.id AND a.article_key = c.id;
ate an SQL query that generates the original list again.