Questions tagged [entity-attribute-value]
A method of modelling and storing data by breaking it into three parts: the entities, their attributes and their values.
0
votes
0answers
24 views
Return null values in conditional join
I have a settings table and a settings_values table that cross matches the value for every user. It's important that I return a NULL value in cases where the setting has not been turned on for a user. ...
-1
votes
1answer
40 views
How to compare strings as int in EAV model
I have implemented an EAV db pattern as part of a poc in postgres. This is the following er illustration:
entity:
id, primary key
firstName, varchar
lastName, varchar
tenantId, int, b-tree indexed
...
-1
votes
0answers
21 views
How to convert a Entity Attribute Value table to a regular table in python?
I am reading two csv table to nested list. I need to compare these two tables for missing/extra data.
The problem is one of them in in Entity Attribute Value format like:
ID Attribute ID Value
1 ...
0
votes
0answers
20 views
Magento 2 - How to retrieve column values as custom attribute options?
I have a working module with CRUD in admin, now I want to add a custom attribute for products, but options of that attribute should be a values from existing DB table, but every tutorial on the web is ...
1
vote
1answer
29 views
Need some clarification on indexes (WHERE, JOIN)
We are facing some performance issues in some reports that work on millions of rows. I tried optimizing sql queries, but it only reduces the time of execution to half.
The next step is to analyse and ...
0
votes
0answers
30 views
Join different values in a row mysql [duplicate]
The response marked as duplicate does not answer the main question, just answer a question I myself answered during the description of the problem.
I have two tables:
TableInit
+----------+----------...
0
votes
0answers
18 views
How To Store EAV Data When It Has Nested Objects/Entities
I have json data that have both nested objects and attributes. Eg of one json object:
(After json_decode into an array:)
Array
(
[attributename1] => attributevalue1
[attributename2] => ...
1
vote
5answers
228 views
SQL - how to display products' options, whether or not they have them?
Assume a products can have 0 or more options -- implemented with the following tables:
products
- id
- name
options
- id
- name
product_options
- id
- product_id
- option_id
Further assume ...
0
votes
0answers
22 views
Adding dynamic fields to SQL SELECT based on data in relationship table [duplicate]
I have the following tables (simplified for brevity):
nodes
id | name
-----------
1 Node 1
2 Node 2
3 Node 3
node_attributes
node_id | key | value
--------------------------
1 foo ...
0
votes
0answers
8 views
Handling Attributes containing foreign key in EAV db modelling
I am trying to implement taxation feature for my e-commerce app.
The tax has some general configuration values like, tax_country, shipping_tax, label etc.
Since these values can change in future I ...
0
votes
2answers
44 views
Select JSON value from a EAV structure result set
Given a result set which is in the EAV structure such as :
id | attributeName | stringValue | intValue | BooleanValue
---------------------------------------------------------------
1 ...
0
votes
3answers
65 views
How can I make this MySQL query (with a sub query) faster?
I have the following query which gets order data, works fine but takes 13.63 seconds:
SELECT
( SELECT meta_value FROM `myprefix_postmeta` as postmeta WHERE postmeta.meta_key = '_sku' AND postmeta....
1
vote
3answers
34 views
MySQL + PHP: ~500kb JSON file - Loading data as tables and fields VS as a single serialized variable
I am making a website that interacts with an offline project through json files sent from the offline project to the site.
The site will need to load these files and manipulate the data.
Is it ...
0
votes
0answers
40 views
How to retrieve, values, names and group names in one SQL query
I used to have an EAV shema with 4 tables in MySQl 5.7:
articles
article attributes
attribute names
attribute group names
After running into huge complexity, I learned from another question that ...
-1
votes
1answer
22 views
E-commerce product database design: dropdown attributes + custom attributes (e.g. custom text)
So I want to design tables and relationships for the product module of an e-commerce solution. For clarification purposes, I will use an example of a highly customisable product that will have:
...
1
vote
1answer
35 views
How to retrieve values from a normalised MySQL 5.7 structure that match certain criterias
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 | ...
0
votes
3answers
59 views
How to optimize query on normalized database structure?
I am trying to optimize a query that currently takes 0.00x s on a MySQL 5.x DB in order to retrieve data on a system without load.
The query looks like this:
SELECT
a.article_id,
GROUP_CONCAT(...
0
votes
2answers
38 views
Spring batch tables creation fails in MariaDB
I used this schema to create Spring batch tables in MariaDB - https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/resources/org/springframework/batch/core/schema-...
0
votes
1answer
32 views
magento2 created custom product attribute but missing in mass update
I've created an attribute programmatically like this
$eavSetup->addAttribute(
Product::ENTITY,
self::mpn,
[
'...
2
votes
1answer
37 views
MySQL query to fetch product variants
I'm trying to fetch product variant attributes to display on a product page. I would like the following output:
color: red (size: S, M), green (size: S)
but I'm getting:
color: red, green
...
3
votes
1answer
43 views
Best Way to Store Contextual Attributes in Core Data?
I am using Core Data to store objects. What is the most efficient possibility for me (i.e. best execution efficiency, least code required, greatest simplicity and greatest compatibility with existing ...
3
votes
1answer
62 views
Filtering query with multiple and dynamic properties in Eav Model
I have 5 tables
Advertismenet > have some ads in my application
category
category Detail > for category's properties
category Detail Definitions > for category detail definitions
Category Detail ...
2
votes
3answers
62 views
Is this a good case to use EAV or no
I have different product types that have different attributes. They cannot be stored in a single table as the attributes are too distinct. There's a couple of options I'm currently looking at: EAV and ...
1
vote
2answers
84 views
Relational DB schema design - How to model 1-to-1 mapping right from an entity's set of fields
I am working on a MySQL (via Prisma datamodel) schema for a Customer entity in an e-commerce context. As the number of fields have exploded (on including say, engagement tracking) I have two possible ...
0
votes
1answer
44 views
MongoDB sort based on key/value of subdocument
So i have a dynamic collection called data with this kind of documents :
[
{
_id: 1,
module_id: 5,
dynamic_fields: [
{key: "title", value: "title 1"},
...
0
votes
1answer
70 views
Join rows if the same value in one column
There is a Postgres database and the table has three columns. The data structure is in external system so I can not modify it.
Every object is represented by three rows (identified by column ...
-4
votes
2answers
47 views
how to Database Design for product that have more price [closed]
I have product that have more attribute (for example color,size,material) that each attribute have value (for example color have 4 value or material have 1 value only) ,then each value of attribute of ...
0
votes
0answers
75 views
Use multiple models in laravel relation
I'm working on a Laravel app which will be using EAV data structure. The required structure should be working as follow:
entity_types
- id = 1
- name = "Contact"
fields
- id = 1
- entity_type_id ...
1
vote
2answers
25 views
reshape table in mariadb
How can I reshape a SQL table (mariadb ) of:
vehicle_id attr_id, attr_value
1 123 BMW
1 345 SERIES 3
1 678 manual
to:
vehicle_id, make, description, gearbox
1 , BMW , SERIES 3 , ...
0
votes
2answers
58 views
Selecting from EAV returns rows twice
I have the following tables
contacts
╔═══════════╦═══════════╦══════════╦═══════════╗
║ contactId ║ projectId ║ lastName ║ type ║
╠═══════════╬═══════════╬══════════╬═══════════╣
║ 1 ║ ...
0
votes
0answers
34 views
Workforce Management database design
Good evening,
I write you after days of "thinking": D
I'm working on a WFM system that allows you to manage activities from the field.
But now the request to manage several different activities ...
1
vote
1answer
52 views
Fetching products matching multiple attribute filters (entity attribute value)
I'm trying to add the possibility to add multiple filters when fetching products from a database that has a basic entity-attribute-value model. The filters are based on attribute values like:
Colors: ...
0
votes
0answers
18 views
Best Practices for Vaulting EAV
One of the source systems I am trying to vault holds a set of two tables that operate as entity attribute value tables. I am wondering what are the best methods people have used to move these tables ...
0
votes
1answer
40 views
Row to Column transformation without Aggregate function in SQL
Folks, Below is the sample table that I have..
Current Table
PropertyAttributeValueID PropertyTypeID PropertyAttributeName PropertyAttributeValue
1000 3216 Mileage ...
3
votes
1answer
28 views
summingDouble on AttributeValue java streams
I have a List of Map of String, AttributeValue and would like to use summingDouble in order to group the keys and find their sum for each keys respectively.
For example,
List<Map<...
0
votes
1answer
28 views
How to design when the type of a column in MySQL has changed its type? (used to be int, now needs to be int or string)
We are developing database schemas in MySQL with evolving requirements.
It starts with a simple design:
fact table:
|id|featureid|featurevalue|
|----|----|----|
|1|1000|42|
dimension table:
|...
0
votes
0answers
15 views
How to properly design the structure of these goods and attributes in Mongo
Good afternoon. I want to design a data scheme for storing products with different attributes in a mongodb, but I don’t know how to do it properly while maintaining flexibility and speed.
For example, ...
-1
votes
1answer
52 views
A PostgreSQL function with loose return data type
Here is the main table with data:
CREATE TABLE my_report
(
id serial NOT NULL primary key,
report_timestamp timestamp without time zone NOT NULL,
value_id ...
0
votes
1answer
35 views
magento how to get attributes associated with a single product using database query
We are trying to get all attributes associated with each product using a database.
We have been used following query but I think the table we are using is not the right one.
$sql = "SELECT ...
1
vote
1answer
36 views
How to classify this schema?
I have such schema:
The essence of this scheme is in organization of the entry point for all products of some company, that gives some flexibility.
How it works:
We create a list of tables in the ...
1
vote
6answers
134 views
Magento MySQL hanging
I have searched the internet in many places to find some answers to problems in the database of a Magento installation.
The website is not available at such a moment (lasting most of the time about ...
0
votes
2answers
55 views
Is a way to optimize big mysql query?
This is my query and it's to slow... I'm looking for the way to optimize it.
SELECT p.id,
Group_concat(pc.cat_id) AS groups,
p.code,
p.NAME,
p.price,
p....
0
votes
2answers
82 views
How to speed up sql query with multiple inner joins?
My query below works but it takes forever to return a result, i am not sure how this can be optimized to significantly reduce time. If anyone has any suggestions please advice me.
Thanks in advanced.
...
0
votes
0answers
44 views
An Attribute error when export products in Magento1
I am trying to use dataflow option export for exporting products in Magento ver. 1.9.0.1
but and error appears like below :
Source model "ves_brand/system_config_source_ListBrand" not found for ...
0
votes
0answers
37 views
Database Performance/Maximum Columns
Nowadays I developed a website for a science project which works like a documentation.
That means their is one person and 1200 possible informations (columns in my database, like age, job etc..) which ...
1
vote
1answer
28 views
Nested Case Statement Logic
I am working on a query to flatten some wp_postsmeta data in a WordPress database and need to set a specific value on various meta_values. I have a key of category and various category values, for ...
0
votes
1answer
22 views
querying aggregate EAV records by month and multiple other fields
I have entities set up in an Entity-Attribute-Value model. This is in Laravel. Now I need to run a report where these are grouped by the year and month of a user-defined custom field (that happens ...
7
votes
3answers
186 views
How select last user information from user and usermeta tables?
I'm use mysql and i have two tables in the form below:
User:
user_id - user_name - phone
UserMeta:
user_meta_id - user_id - meta_key - meta_value - meta_date
I have some records like ...
0
votes
1answer
23 views
MySQL key value schema, returning results that must match multiple keys
I am trying to utilise a simple key value innoDB table to construct a query that will return all applicable results
Schema:
CREATE TABLE `user_metadata` (
`id` int(10) unsigned NOT NULL ...
1
vote
1answer
39 views
Dynamic sql pivot values coming in seperate columns
HI I am trying to write dynamic pivot as I have over 100 columns
ID Question Answer
1 Name peter
1 DOB 11/12/2003
1 address …..
1 Issue1 d
1 Issue2 a
...