data-modeling

Best implementation for fully auditable data model?

别等时光非礼了梦想. 提交于 2019-12-20 14:41:57
问题 My requirement is for a data model where a full audit trail is retained for changes to every attribute of every object. Object definitions are also fluid: new attributes can appear or go away over time. This audit trail will live separately from the original databases, so a trigger-based auditing model won't work. In a relational database, I can implement this with a single large ATTRIBUTE_HISTORY table that records every individual change to each attribute, with appropriate timestamp and

How to model Student/Classes with DynamoDB (NoSQL)

社会主义新天地 提交于 2019-12-20 10:28:09
问题 I'm trying to get my way with DynamoDB and NoSQL. What is the best (right?) approach for modeling a student table and class tables with respect to the fact that I need to have a student-is-in-class relationship. I'm taking into account that there is no second-index available in DynamoDB. The model needs to answer the following questions: Which students are in a specific class? Which classes a student take? Thanks 回答1: A very simple suggestion (without range keys) would be to have two tables:

How to keep ordering of records in a database table

和自甴很熟 提交于 2019-12-20 10:08:09
问题 i am creating a database table that is going to store menu links that will ultimately show up on a web page. My issue is that i want to control the order of the menu items. I could have a field called order but everytime i have a new menu link i would have to insert the order and change all of the records with higher order to +1. For example, lets say i want the links ( in this order): Home About Products Shopping i could have a table called MenuLinks and have the columns: Name, Order my data

How to keep ordering of records in a database table

你。 提交于 2019-12-20 10:07:17
问题 i am creating a database table that is going to store menu links that will ultimately show up on a web page. My issue is that i want to control the order of the menu items. I could have a field called order but everytime i have a new menu link i would have to insert the order and change all of the records with higher order to +1. For example, lets say i want the links ( in this order): Home About Products Shopping i could have a table called MenuLinks and have the columns: Name, Order my data

Database design for general web form

↘锁芯ラ 提交于 2019-12-20 05:19:06
问题 I want to build a back end of a general web form which contains questions which the user can answer. There are multiple types of questions. "Normal" text question: the question is answered via a simple text field. Example : General personal info, like the name. Textarea question: the same, but with more space to write the answer. Example : A "More information that you want to add" box. Multiple choice question: a question with some predefined answers, from which a single one can be chosen.

Power BI - Find the % matching (Bounty 100) What-if analysis before and after

一个人想着一个人 提交于 2019-12-19 09:55:26
问题 I have a requirement where I have a table like this, Role Skills Developer C Developer SQL Developer C++ Data Analyst R Data Analyst Python Data Analyst SQL Business Analyst Excel Business Analyst SQL And I need to create something like this in Power BI, Explaining the first result for a Business Analyst in Power BI Visual Table, From Filter 1 - I have selected Data Analyst - whose actual skills are R, Python and SQL From Filter 2 - I have selected a new skill (Upskill) as Excel. So now, he

when a 1NF table has no composite candidate keys is it in 2NF?

白昼怎懂夜的黑 提交于 2019-12-19 09:05:44
问题 Is it safe to say, when a 1NF table has no composite candidate keys (primary keys consisting of more than one column), the table is automatically in 2NF? Can a table voilate 2NF, when it has only one column in its primary key? 回答1: A relvar R, is in 2NF as long as there is no non-trivial FD, A->B, satisfied by R where B is nonprime and where A is a proper subset of some candidate key of R. You first have to consider all the candidate keys. If it is the case that all the candidate keys happen

Firestore: Version history of documents

旧城冷巷雨未停 提交于 2019-12-19 03:11:30
问题 I'm looking for a proper way to structure Firestore database to handle multiple version histories of documents inside a single collection. For example: I have a collection named offers which have multiple documents which correspond to multiple offers. For each of these documents, I'd like to have history of changes, something like changes on Google Docs. Since documents support only adding fields directly or nesting another collection, here's a structure I had in mind: collections: offers -

Firestore: Version history of documents

情到浓时终转凉″ 提交于 2019-12-19 03:10:55
问题 I'm looking for a proper way to structure Firestore database to handle multiple version histories of documents inside a single collection. For example: I have a collection named offers which have multiple documents which correspond to multiple offers. For each of these documents, I'd like to have history of changes, something like changes on Google Docs. Since documents support only adding fields directly or nesting another collection, here's a structure I had in mind: collections: offers -

Entity Framework multitenant shared data architecture: single column, multiple foreign keys

寵の児 提交于 2019-12-18 15:50:57
问题 I have the following data structure: //property Notification abstract class BindableBase { } //base class for all tenant-scoped objects abstract class TenantModelBase : BindableBase { int TenantId; } abstract class Order : TenantModelBase { Customer Customer; //works: mapped using TenantId and CustomerId Product Product; //again, works with TenantId and ProductId string ProductId; string CustomerId; } class Customer: TenantModelBase { string CustomerId; } class Product : TenantModelBase {