entity-attribute-value

Should I place EAV values in a datatype table?

只愿长相守 提交于 2019-12-02 17:33:23
问题 I am designing a database for entities like stores, products, customers, suppliers and warehouses. The database will be used as an online transactional system in different physical stores. In my case all the attributes of stores, customers, suppliers and warehouses can be defined as columns because they won't change much over time. However the products have an unlimited amount of attributes so I would like to put this data in an EAV model. Can anybody point out if the values should be put in

How would you design your database to allow user-defined schema

谁说胖子不能爱 提交于 2019-12-02 15:58:36
If you have to create an application like - let's say a blog application, creating the database schema is relatively simple. You have to create some tables, tblPosts, tblAttachments, tblCommets, tblBlaBla… and that's it (ok, i know, that's a bit simplified but you understand what i mean). What if you have an application where you want to allow users to define parts of the schema at runtime . Let's say you want to build an application where users can log any kind of data. One user wants to log his working hours (startTime, endTime, project Id, description), the next wants to collect cooking

SQL : Create a full record from 2 tables

末鹿安然 提交于 2019-12-02 10:00:30
问题 I've got a DB structure as is (simplified to maximum for understanding concern): Table "entry" ("id" integer primary key) Table "fields" ("name" varchar primary key, and others) Table "entry_fields" ("entryid" integer primary key, "name" varchar primary key, "value") I would like to get, for a given "entry.id", the detail of this entry, ie. all the "entry_fields" linked to this entry, in a single SQL query. An example would be better perhaps: "fields": "result" "output" "code" "command"

input unknown number of fields into mysql - best structure for this?

和自甴很熟 提交于 2019-12-02 07:29:14
问题 I need to store data that has been sent from multiple forms - the fun bit is, as these forms will be created by a form builder I am planning on giving users access to, I have no idea how many fields will be in the form, or how many fields the user will be submitting. I have thought about a table structure similar to the following (the form itself is saved as php for include): | FormId | FormType | InputID | InputType | LongText | Text | Date | FormId is relevant to another table storing

Adding a linebreak in some attribute string(like src or href ) in HTML / XML source

断了今生、忘了曾经 提交于 2019-12-02 06:27:56
问题 I like to improve readability and managing some HTML source code like this <iframe src= "https://www.google.com/recaptcha/api2/anchor?k=6LeaOiITAAAAAF_A-e9qjM6TCgdt4-rqixnkkatL &co=aHR0cDovL3BsYXkuc3BvdGlmeS5jb20 &hl=de&v=r20160802154045&theme=dark&size=normal&cb=ap65yyq41qhy" title="reCAPTCHA-Widget" ... I mean line breaking attribut names is the first step: <iframe src= "https://www.google.com/recaptcha/api2/anchor?k=6LeaOiITAAAAAF_A-e9qjM6TCgdt4-rqixnkkatL &co

Proper way to store user defined data in SQL

為{幸葍}努か 提交于 2019-12-02 05:07:56
I want to build an online form builder much like wufoo that allows the users to create and publish their own web forms. Each submission should be saved to a data base where the user can later retrieve the submissions. As these forms will be dynamic, ie. the user has complete control over the amount and type of form fields I am trying to think of a solid database design to store this information. I would have one table fieldtype which contains every type of field available to the users, ie. textfield, emailfield etc. One baseform table which will hold each forms id, url etc. I would then have a

input unknown number of fields into mysql - best structure for this?

别等时光非礼了梦想. 提交于 2019-12-02 04:43:58
I need to store data that has been sent from multiple forms - the fun bit is, as these forms will be created by a form builder I am planning on giving users access to, I have no idea how many fields will be in the form, or how many fields the user will be submitting. I have thought about a table structure similar to the following (the form itself is saved as php for include): | FormId | FormType | InputID | InputType | LongText | Text | Date | FormId is relevant to another table storing location of the form file etc for include (e.g below), Input ID is relevant to the input on the page. |

Data Modeling for EAV

佐手、 提交于 2019-12-02 04:03:20
问题 How are others using relational modeling tools to map a logical model or one in third normal form to a database that uses EAV? 回答1: EAV is a non-relational design. You can't achieve any normal forms with EAV, because it fails to be a relation. EAV is an example of the Inner-Platform Effect antipattern. If you need many attributes, you could consider serializing to a blob of XML and storing that XML in a CLOB column. 回答2: In relational it is possible to have an EAV (also called an attribute

Approach to generic database design

泄露秘密 提交于 2019-12-02 03:22:22
问题 An application that I'm facing at a customer, looks like this: it allows end users to enter "materials". To those materials, they can append any number of "properties". Properties can have a any value of type: decimal, int, dateTime and varchar (length varying from 5 characters to large chunks of text), Essentially, the Schema looks like this: Materials MaterialID int not null PK MaterialName varchar(100) not null Properties PropertyID PropertyName varchar(100) MaterialsProperties MaterialID

Adding a linebreak in some attribute string(like src or href ) in HTML / XML source

╄→尐↘猪︶ㄣ 提交于 2019-12-02 01:29:39
I like to improve readability and managing some HTML source code like this <iframe src= "https://www.google.com/recaptcha/api2/anchor?k=6LeaOiITAAAAAF_A-e9qjM6TCgdt4-rqixnkkatL &co=aHR0cDovL3BsYXkuc3BvdGlmeS5jb20 &hl=de&v=r20160802154045&theme=dark&size=normal&cb=ap65yyq41qhy" title="reCAPTCHA-Widget" ... I mean line breaking attribut names is the first step: <iframe src= "https://www.google.com/recaptcha/api2/anchor?k=6LeaOiITAAAAAF_A-e9qjM6TCgdt4-rqixnkkatL &co=aHR0cDovL3BsYXkuc3BvdGlmeS5jb20 &hl=de&v=r20160802154045&theme=dark&size=normal&cb=ap65yyq41qhy" title="reCAPTCHA-Widget" However is