entity-attribute-value

MySql table with potentially *very* many columns

懵懂的女人 提交于 2019-12-11 15:14:47
问题 A friend who is a recruiter for software engineers wants me to create an app for him. He wants to be able to search candidates' CVs based on skills. As you can imagine, there are potentially hundreds, possibly thousands of skills. What's the best way to represent the candidate in a table? I am thinking skill_1 , skill_2 , skill_n , etc, but somewhere out there there is a candidate with more than n skills. Also, it is possible that more skills will be added to the database in future. So, what

DataBase design for store anketing data

邮差的信 提交于 2019-12-11 14:37:25
问题 my English is not well, so sorry for it. I want to write the web-app for anketing. I mean, that it must be a site, where user may give answers on different questions. For example, it can be question with text type of answer, or checkbox, or lookup (comboBox). And my problem is in data base architecture. I read a lot about Entity Attribute Value db pattern, One True Lookup Table I also read. But these patterns has problem (with ms sql) when building a sql-query for data selecting (report). I

Loop in MySql, or alternative?

邮差的信 提交于 2019-12-11 14:28:15
问题 I have a MySql db with innoDB tables. Very simplified this is how two tables are layed out: Table A: controlID(PK) controlText Table B: controlOptionID(pk) controlID(FK to table A) controlOptionType controlOptionValue So many controlOptions(table B) can reference one control(giving that control multiple options). But for each option two rows are made in table B: one row with controlOptionType = "linkToCreator" and controlOptionValue = (an ID to the template it was made from*). And the other

How to retrieve values from a normalised MySQL 5.7 structure that match certain criterias

限于喜欢 提交于 2019-12-11 06:29:53
问题 I am trying to normalise my MySQL 5.7 data shema and strugle with replacing the SQL queries: At the moment there is one table containing all attributes of each article: article_id | title | ref_id | dial_c_id The task is to retrieve all articles which match two given attributes (ref_id and dial_c_id) and also retrieve all their other attributes. With just one table, this is straightforward: SELECT * FROM test.articles_test WHERE ref_id = '127712' AND dial_c_id = 51 Now in my effort to

Can get an average of values in a json array using postgres?

浪子不回头ぞ 提交于 2019-12-11 03:23:14
问题 One of the great things about postgres is that it allows indexing into a json object. I have a column of data formatted a little bit like this: {"Items": [ {"RetailPrice":6.1,"EffectivePrice":0,"Multiplier":1,"ItemId":"53636"}, {"RetailPrice":0.47,"EffectivePrice":0,"Multiplier":1,"ItemId":"53404"} ] } What I'd like to do is find the average RetailPrice of each row with these data. Something like select avg(json_extract_path_text(item_json, 'RetailPrice')) but really I need to do this for

How to store data pairs in a mysql database?

南楼画角 提交于 2019-12-11 01:09:57
问题 I have to store a big amount of data pairs. Data pairs are in the form: parameter = value and are related to a container. It's similar to a INI file. For example, I have a container that have these values: p1 = 32 p2 = "hello world" p3 = -54 and another one that have: p1 = 32 p2 = 36 p5 = 42 p6 = "bye" There is an undefined number of parameters per container. The values are numbers or strings of any length (numbers can be converted to strings). Data retrieval is made by parameter name ( "all

is magento sales eav

谁都会走 提交于 2019-12-10 16:24:34
问题 By checking sales module's config, there is sales_entity section as below <models> <sales> <class>Mage_Sales_Model</class> <resourceModel>sales_resource</resourceModel> </sales> <sales_entity> <class>Mage_Sales_Model_Entity</class> <entities> <quote> and those class Mage_Sales_Model_Entity_xxx extends Mage_Eav_Model_Entity_Abstract , showing that sales/order is EAV style but not flat one. I can also find table "eav_entity_type" have a lot of records related with "order". But, I go through the

Entity Attribute Value (EAV) frameworks?

旧巷老猫 提交于 2019-12-10 15:57:33
问题 I'd seen Entity Attribute Value in lots of contexts before I actually learnt what its name was. Its that technique that often crops up when instead of storing data in database columns you 'flip it' and have a table with Entity, Attrbute, Value columns and each piece of data becomes a row in that table. Sometimes its also known as 'Open-Schema'. Its good for some things, bad for other things. This wikipedia article has a good discussion of the theory behind it. It seems like the sort of oft

SQL: Normalization of database while retaining constraints

江枫思渺然 提交于 2019-12-10 14:54:41
问题 Suppose I have the following tables: ____________________ ____________________ | Organisms | | Species | |--------------------| |--------------------| |OrganismId (int, PK)| |SpeciesId (int, PK) | |SpeciesId (int, FK) |∞---------1|Name (varchar) | |Name (varchar) | |____________________| |____________________| 1 1 | | | | | ∞ ∞ ______________________ ____________________ _______________ | OrganismPropsValues | | SpeciesProps | | Props | |----------------------| |--------------------| |-------

Magento - possible to have multiple tables for a single model?

淺唱寂寞╮ 提交于 2019-12-10 14:23:44
问题 trying to set up a config file for a custom module - do I need to have a unique model for each 'resourceModel', or is it possible to have multiple table entities per model? Is it possible to get something like this to work: <config>... <model> <namespace> <class>Namespace_Module_Model</class> <resourceModel>module_mysq4</resourceModel> </namespace> <module_mysql4> <class>Namespace_Module_Model_Mysql4</class> <entities> <table_1> <table>table_1</table> </table_1> <table_2> <table>table_2<