database-design

Designing a database with several different kinds of products? [closed]

随声附和 提交于 2019-12-24 03:46:07
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . As part of a recent project I have started planning out, I am required to build the structure of a database which will contain several products. As an example, think of the way Amazon is structured. It has several categories and within those categories, several sub-categories

EntityFramework enable-migrations ArgumentException

淺唱寂寞╮ 提交于 2019-12-24 03:43:05
问题 I am a newby in the beautiful world of Microsoft Azure and made my first hello world website. The next step is to create a database (entityframework) but I get an exception while creating the database from PackageManagerConsole (PMC). I read a few posts on the web that explained that I need to add the startupprojectname to the PS command, but unfortunatelly that doesn't resolve my problem. I have 2 projects in my solution. "partyonwebsite" which is the startup project and obviously my website

EntityFramework enable-migrations ArgumentException

早过忘川 提交于 2019-12-24 03:43:03
问题 I am a newby in the beautiful world of Microsoft Azure and made my first hello world website. The next step is to create a database (entityframework) but I get an exception while creating the database from PackageManagerConsole (PMC). I read a few posts on the web that explained that I need to add the startupprojectname to the PS command, but unfortunatelly that doesn't resolve my problem. I have 2 projects in my solution. "partyonwebsite" which is the startup project and obviously my website

E2L: How do you handle Foreign Keys that participate in multiple relationships?

↘锁芯ラ 提交于 2019-12-24 03:33:13
问题 I have a Database model like this FlowObject FlowObjectID (PK) Description Active ProcessObject FlowObjectID (PK, FK) HasSubmit DecisionObject FlowObjectID (PK, FK) YesFlowObjectID (FK) NoFlowObjectID (FK) YesCaption NoCaption When I try and use create my Entity model I get this warning in my project. Foreign Key constraint 'FK_ProcessObject_FlowObject1' has been omitted from the storage model. Column 'FlowObjectID' of table 'Investigations.Store.ProcessObject' is a Foreign Key participating

Storing Waveforms in Oracle

耗尽温柔 提交于 2019-12-24 03:27:54
问题 I am designing a new laboratory database. I want to store the raw results for all tests together. However, results can either be a single measurement or a raw waveform. (repost see footer) Which case below is ideal (and why)? ... or provide your own ideal option. TEST test_id* (other TEST fields) OPTION 1: Separate single values and waveform results TEST (1 -- many) MEASUREMENT ( \-- many) RAW_HEADER 1 -- many RAW_POINT MEASUREMENT RAW_HEADER measurement_id* raw_header_id* test_id (FK) test

Django: limiting model data

泄露秘密 提交于 2019-12-24 01:24:33
问题 I'm searching in a way to limit the queryset which I can get through a model. Suppose I have the following models (with dependencies): Company |- Section | |- Employee | |- Task | `- more models... |- Customer | |- Contract | |- Accounts | `- other great models ... `- some more models... It should be noted that my real models are much deeper and it's not really about business. With a context processor I have added a company instance to request: def magic_view(request): request.company # is a

Django: limiting model data

我的未来我决定 提交于 2019-12-24 01:22:11
问题 I'm searching in a way to limit the queryset which I can get through a model. Suppose I have the following models (with dependencies): Company |- Section | |- Employee | |- Task | `- more models... |- Customer | |- Contract | |- Accounts | `- other great models ... `- some more models... It should be noted that my real models are much deeper and it's not really about business. With a context processor I have added a company instance to request: def magic_view(request): request.company # is a

Storing Revisions of Relational Objects in an Efficient Way

一世执手 提交于 2019-12-24 01:19:20
问题 I'm not sure if this type of question has been answered before. In my database I have a product table and specifications table. Each product can have multiple specifications. Here I need to store the revisions of each product in database in order to query them later on for history purposes. So I need an efficient way to store the products' relations to specifications each time users make changes to these relations. Also the amount of data can become very big. For example, suppose there are

table design + SQL question

泄露秘密 提交于 2019-12-24 01:15:26
问题 I have a table foodbar, created with the following DDL. (I am using mySQL 5.1.x) CREATE TABLE foodbar ( id INT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, weight double not null, created_at date not null ); I have four questions: How may I write a query that returns a result set that gives me the following information: user_id, weight_gain where weight_gain is the difference between a weight and a weight that was recorded 7 days ago. How may I write a query that will return the top N users

Which table should be Parent table and which should be child table?

◇◆丶佛笑我妖孽 提交于 2019-12-24 01:08:01
问题 Hi have two tables Auther and Books. I am confused that to which table should i keep as parent table and which should be child table for making foreign key constraint. CREATE TABLE author ( author_id NUMBER(3) CONSTRAINT athr_aid_pk PRIMARY KEY, author_name VARCHAR2(30) ); CREATE TABLE books ( book_id NUMBER(3), book_title VARCHAR2(30), book_price NUMBER(3), ); Please explain me which table should be Parent table and why? 回答1: Answer: None. Reason: This is a many-to-many relationship. An