data-modeling

Visio 2003 ERM to SQL Server script

寵の児 提交于 2019-12-12 01:18:26
问题 my question is simple: Is there anyway to generate the database sql creaton script from a Visio 2003 model? I prefer Visio, however can be other program (freeware) that allows me to somehow agilize the process between the model and the sql code. Thanks in advance! 回答1: I could be wrong, but I think the commands to generate DDL disappeared with Visio 2003. Apparently you now need the "Enterprise Edition" or some such dreck. Also, this is a repeat of this question , and the original pointed to

modelling in google-datastore: use lists or separate entities?

混江龙づ霸主 提交于 2019-12-11 12:29:23
问题 I'm stuck trying to implement a data model for an app to be deployed on AppEngine. Here's an example of the model: EntityName id: 1 author: 'me' description: 'whatever' datetime: 2011 etc. events: [ {location: [1,2], phase: ['A', 'B']}, {location: [3,4], phase: ['C', 'B']}, ... more events ... ] Explanation: EntityName has a few attributes, and many events each event has a list of numbers (its location ) and a list of strings ( phase ) How can this model be implemented in AppEngine? The data

Database Schema for an almost tree

两盒软妹~` 提交于 2019-12-11 10:54:47
问题 I have the following structure: Block A Foo 1 Bar 1 Bar 2 Foo 2 Bar 1 Bar 3 Bar 4 Block B Foo 3 Every Foo belongs to exactly on Block. Every Bar belongs to exactly on Block. A Bar can belong to none, one or more Foo's of the same Block . The schema is currently like this: Block 1/ \1 n/ \n Foo-n---m-Bar The problem with this is that there can be Bar's which belong to Foo's of different Block's Is there a schema which has neither redundancy nor allows inconsistencies? 回答1: Yes, there is a way.

multiple value stored in single coloumn in MySQL database?

◇◆丶佛笑我妖孽 提交于 2019-12-11 10:28:08
问题 How can i store multiple values in one attribute. for example: column name: telephone i want to store 5,7 and 16 this three different values in one column (telephone) in one row. 回答1: You should not be doing that. It goes to show that the DB has not been designed properly. But if you have to do it without altering your DB design. You can join all the telephone numbers with a special glue, which is ensured not to be part of any telephone number, something like % . So 5, 7 and 16 will all be

Dynamically generated field in SqlAlchemy model with Postgres

江枫思渺然 提交于 2019-12-11 07:58:33
问题 I want to create a table with a column for each hour of the day of Float type. How do I get rid of this verbose syntax: from app import db class HourlySchedule(db.Model): id = db.Column( db.Integer, primary_key=True ) h0 = db.Column(db.Float, nullable=True) h1 = db.Column(db.Float, nullable=True) h2 = db.Column(db.Float, nullable=True) h3 = db.Column(db.Float, nullable=True) h4 = db.Column(db.Float, nullable=True) h5 = db.Column(db.Float, nullable=True) h6 = db.Column(db.Float, nullable=True)

Challenging data modeling problem

ぃ、小莉子 提交于 2019-12-11 07:44:21
问题 I have a table that stores customer items. The table needs to reflect the following activities: When a customer adds an item to his/her queue. When the item is marked for shipping to the customer. When the item actually ships. When the item is marked for return by the customer. When a return shipping label is created for the item. When the item is received back from the customer. The work flow will be as follows: User(s) add item(s) to list. Scheduled event marks items for shipping

Cassandra Time-Series data modelling

不打扰是莪最后的温柔 提交于 2019-12-11 07:44:21
问题 I've been working on a data model for an analytics system for a little while now, but I just can't seem to get the right setup for my primary keys. I've watched a bunch of videos (https://www.youtube.com/watch?v=UP74jC1kM3w&list=PLqcm6qE9lgKJoSWKYWHWhrVupRbS8mmDA&index=9) to gain some learnings about best practises, especially concerning time-series data. Regarding PRIMARY KEYS, I can't seem to get the right balance so that I can query the way I need to. Here is my data model so far: CREATE

DataModel use case for logging in Cassandra

余生颓废 提交于 2019-12-11 07:32:02
问题 I am trying to design the application log table in Cassandra, CREATE TABLE log( yyyymmdd varchar, created timeuuid, logMessage text, module text, PRIMARY KEY(yyyymmdd, created) ); Now when I try to perform the following queries it is working as expected, select * from log where yymmdd = '20182302' LIMIT 50; Above query is without grouping, kind of global. Currently I did an secondary index for 'module' so I am able to perform the following, select * from log where yymmdd = '20182302' WHERE

Database Design: use composite key as FK, flag data for sharing?

大憨熊 提交于 2019-12-11 07:06:19
问题 Assume multiple vendors selling identical products. Each product has a number of possible colors. Finally, assume that the initial state of the database is that it is not aware of these products or its corresponding colors. The vendors will be adding product and color information. The tables: TABLE: vendor ================================ | vendor_id | name | -------------------------------- | 1 | ABC Limited | -------------------------------- | 2 | Acme Corporation | ------------------------

how should I implement data access/rights management in Cassandra

南楼画角 提交于 2019-12-11 06:35:22
问题 I am making a SaaS application in which users will create advertisement listings. All advertisements should be visible to all users of my registered users as well as unregistered visitors Only registered users can create an advertisement A registered user can create several advertisements Only the user who creates the advertisement should be able to delete or edit it. I have never done user and data management w.r.t. a database so I need advice on how I should implement it (I acknowledge that