K
K
Kirill Batalin2014-08-04 16:51:25
PHP
Kirill Batalin, 2014-08-04 16:51:25

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

2 answer(s)
V
Vladlen Grachev, 2014-08-04
@gwer

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.

K
Konstantin Velichko, 2014-08-04
@Zoxon

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 question

Ask a Question

731 491 924 answers to any question