database-design

Tag driven database for asynchron BI

两盒软妹~` 提交于 2019-12-25 01:52:43
问题 I'm having a little problem coming up with an architecture for tag driven software I'm designing. What I want to do is store plain text in database, which is liked to an owner and other entities. The plain text is filled with tags just like Twitters hashtags and should be searchable/indexable. That can be done application side and as a result I'm gonna have tons of small chunks of data that need to be processed for business intelligens. No one is gonna ready the plain text it's only about the

How to support restoring complex dependencies in a rdb

回眸只為那壹抹淺笑 提交于 2019-12-25 01:44:07
问题 I am having some trouble formulating a solution for this foreseen situation. TableA has a FK to TableB. TableC has a FK to TableA. TableC has a FK to TableD. TableA ------ taId tbId TableB ------ tbId TableC ------ tcId taId tdId TableD ------ tdId A brief series of events: 1) A cascade soft-delete is issued to a record in TableB. This causes all related records in TableA to be soft-deleted, cascading to all related records in TableC being soft-deleted. 2) At a later time, a record in TableD

How to support restoring complex dependencies in a rdb

不羁的心 提交于 2019-12-25 01:29:19
问题 I am having some trouble formulating a solution for this foreseen situation. TableA has a FK to TableB. TableC has a FK to TableA. TableC has a FK to TableD. TableA ------ taId tbId TableB ------ tbId TableC ------ tcId taId tdId TableD ------ tdId A brief series of events: 1) A cascade soft-delete is issued to a record in TableB. This causes all related records in TableA to be soft-deleted, cascading to all related records in TableC being soft-deleted. 2) At a later time, a record in TableD

How to design the database tables and relationships

爱⌒轻易说出口 提交于 2019-12-25 01:24:36
问题 I was creating a system for its purchases and transactions and initially thought the db would needed to be look like this. https://imgur.com/0Agl7PZ But after getting into the system The products from the suppliers are needed to be bought time to time The same product can be get from different suppliers. So I changed the db to this way. I'm still figuring out is this the best approach. And also is the product_purchase and order_products tables are many to many tables? https://imgur.com

What table structure to use (hibernate)

孤街浪徒 提交于 2019-12-24 22:06:28
问题 I hava two entities: PhisicalPerson (PP), JuredicalPerson (JP). And I want to create Phone object. JP has many phones and PP has many phones (one to many relation). So in Phone object I have to create 2 columns for this relations: class Phone { @JoinColumn(name="ppId",nullable=true) @ManyToOne public PhisicalPerson getPhisicalPerson() {...} @JoinColumn(name="jpId",nullable=true) @ManyToOne public JuredicalPerson getJuredicalPerson() {...} // number, city code, additional number and other

Structure to handle changes to records that require approval

寵の児 提交于 2019-12-24 19:39:43
问题 Working on a data-entry web application, that requires changes to be authorised. The back-end database is PostgreSQL 9.6. There is no requirement for a change history (audit trail) to be kept, only a dirty copy of the record and an authorised clean copy. Checking other questions the suggested solutions seem rather overkill. link1, link2, link3 And using a temporal database solution like link, definatly seems overkill. One option would be to have two columns for each field, one holding the

Hotel Room Booking Statement

女生的网名这么多〃 提交于 2019-12-24 19:28:34
问题 Essentially i'm making a basic hotel booking system for my computing a-level coursework, and have hit a stumbling block (doesn't help having a migraine either!) I'm in the process of checking if a room is available for then the user to book (the application is all run and used by staff by the way) but trying to get my head around how to do it. At the moment I was thinking I could just search the current booking database for the room number and dates I want to book for and if a match came back

Is there anything wrong with having a table with one column? (MSSQL Server)

浪子不回头ぞ 提交于 2019-12-24 19:19:46
问题 Consider the following scenario: Tables: Employee (EmpId(PK), Name) TeamMembers(TeamId(PK), EmpId(PK)) Project(ProjId(PK), TeamId) I really want to avoid using composite PK, but the only way I see out of the problem is creating a Team table with only 1 column TeamId(PK) (i do not want to store any info associated with the team other than its members) ( EDIT : if I create a team table, i'll add TeamMeberId to TeamMembers table and make it a PK) Another problem with current setup is that I can

Do Azure Elastic Database Pools allow Cross Database transactions?

本秂侑毒 提交于 2019-12-24 19:14:36
问题 We have Stage database, which contains stored procedures, and transfers data into an OLTP Database. Do Elastic SQL Databases reside on same server, and give ability to conduct cross-db stored procedure transactions? Would Elastic databasepool allow this? https://docs.microsoft.com/en-us/azure/sql-database/sql-database-elastic-pool 回答1: You can achieve elastic transactions spanning across databases using .NET client applications. This is currently under preview. Elastic transactions at server

Structuring database relationships for tracking different variations of app settings

放肆的年华 提交于 2019-12-24 19:03:44
问题 An app I'm currently designing allows users to create custom competitive leagues (think of it kind of like fantasy sports) and each user can join different leagues and each league consists of multiple rounds where the users (hereafter referred to as Players) will compete and can earn points for different criteria/accomplishments established for each league. Here's some key info to note: Points are accrued across all the rounds during a league/season The custom point criteria/weight settings