Answer the question
In order to leave comments, you need to log in
How to store test results in a database?
Hello.
You need to design a database for the analyzer script. The script analyzes the site provided to it and displays the result of the analysis in the form of a table. It will also be necessary to search for sites in the database that meet certain conditions (evaluation criterion No. 1 = value 1, criterion No. 2 > value 2, etc.).
There are about 50 criteria, and their number increases from time to time (new ones are added, old ones are changed). What is the best way to store test results in a database?
Answer the question
In order to leave comments, you need to log in
To begin with, I would suggest the following option. A table with sites, a table with a list of criteria, and a connecting table with fields: site id, criterion id, criterion value. The usual many-to-many relationship.
The option is the most flexible, requiring the least further intervention in the structure of the tables. If, for example, one table is made with the number of fields corresponding to the number of criteria, then when changing the number of criteria, extra steps will be required.
sites
-----------
id
date
site
url
...
benchmarks
---------------
id
benchmark1
benchmarkN
...
relations
-------- -----
id
benchmark_id ← benchmarks.id
site_id ← sites.id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question