database-design

Invoice from multiple orders?

帅比萌擦擦* 提交于 2019-12-24 07:23:01
问题 I need a way to create an invoice from multiple orders every month? In the tbl_order table, I have a list of orders from the customer. tbl_order table OrderID (PK) ShopID (FK) CustomerID (FK) Statu Total OrderDate Let say I want to create an invoice for period: 1 to 31 May from tbl_order.ShopID = 2 (From there, I can an invoice report to a Shop/Company of Commission they owe me, etc. When I do recieved commission from them - I need a way to update invoice status) The invoice should have

Invoice from multiple orders?

我的梦境 提交于 2019-12-24 07:22:10
问题 I need a way to create an invoice from multiple orders every month? In the tbl_order table, I have a list of orders from the customer. tbl_order table OrderID (PK) ShopID (FK) CustomerID (FK) Statu Total OrderDate Let say I want to create an invoice for period: 1 to 31 May from tbl_order.ShopID = 2 (From there, I can an invoice report to a Shop/Company of Commission they owe me, etc. When I do recieved commission from them - I need a way to update invoice status) The invoice should have

Invoice from multiple orders?

◇◆丶佛笑我妖孽 提交于 2019-12-24 07:21:48
问题 I need a way to create an invoice from multiple orders every month? In the tbl_order table, I have a list of orders from the customer. tbl_order table OrderID (PK) ShopID (FK) CustomerID (FK) Statu Total OrderDate Let say I want to create an invoice for period: 1 to 31 May from tbl_order.ShopID = 2 (From there, I can an invoice report to a Shop/Company of Commission they owe me, etc. When I do recieved commission from them - I need a way to update invoice status) The invoice should have

how to store 2 billion users?

痴心易碎 提交于 2019-12-24 06:31:13
问题 There is a portal with two billion users registered. If you store all the 2 billion users in a conventional databases it will take more time to retrieve the data about a particular user when that user tries to login. How do you handle this situation to make sure that the user gets the response quickly. 回答1: I don't see any particular reason why a conventional database on decent modern hardware couldn't retrieve log-on information pretty quickly, even if you have 2 billion records. It's just a

MySQL Table Design for a Questionnaire

China☆狼群 提交于 2019-12-24 05:57:49
问题 I am fairly new to MySQL and have a project in which I need to design a database that will store responses from an online questionnaire. Reports will need to be written from the data. Does anyone have any tips on what type of fields to use? The questions will either have a Yes No answer, a choice of 4 options from very satisfied to very dis-satisfied or multipul choice. It's mainly the choice questions that I'm unsure on, as I will need to be able to product a report to show the percentage of

Design : Relation Vs. Node

拟墨画扇 提交于 2019-12-24 05:49:22
问题 I am new to graph database, and overwhelmed with its promised scope and power. When designing app, it is very important that we align our emotional design patterns with practical performance designs. One of the question that is bothering me is whether to make certain piece of information as relation attribute or node attribute. Here's the use case. We have entities that are related by incoming relation "service_provider". The starting node becomes a provider to end node. Now each of the

A 2-way relationship (a database design flaw)

跟風遠走 提交于 2019-12-24 05:17:08
问题 I've two tables which are connected to each other through a one to many relation. the problem is that the referenced table also has a foreign key of the second table! I know it's confusing, So I'll show you a simple design of my database: Authors AuthorId Name DefaultBookId (FK) -------- ------- ------------- 1 John 1 2 Mike 3 3 Mig 5 Books BookId Title AuthorId (FK) -------- ------- ------------- 1 TitleInfo1 1 2 TitleInfo2 3 3 TitleInfo3 2 4 TitleInfo4 1 5 TitleInfo5 3 6 TitleInfo6 3 7

Column Nullability/Optionality: NULL vs NOT NULL

一曲冷凌霜 提交于 2019-12-24 04:33:07
问题 Is there a reason for or against setting some fields as NULL or NOT NULL in a mysql table, apart from primary/foreign key fields? 回答1: That completely depends on your domain to be honest. Functionally it makes little difference to the database engine, but if you're looking to have a well defined domain it is often best to have both the database and application layer mirror the requirements you are placing on the user. If it's moot to you whether or not the user enters their "Display Name",

Database design - should two projects share the same table?

雨燕双飞 提交于 2019-12-24 04:03:10
问题 Background: Two projects (A & B) under design at the same time both needs a new table(called DocumentStore ) to store document/file under postgres. But business logic around the document storage are different between project A & B, this means relationship around DocumentStore are different between A & B. Let's make this a bit more concrete, see example below: The Document storage table structure looks the same without constraints/ foreign Keys: Table DocumentStore DocUUID //unique Id for this

Database Design

情到浓时终转凉″ 提交于 2019-12-24 03:55:16
问题 This is a general database question, not related to any particular database or programming language. I've done some database work before, but it's generally just been whatever works. This time I want to plan for the future. I have one table that stores a list of spare parts. Name, Part Number, Location etc. I also need to store which device(s) they are applicable too. One way to do is to create a column for each device in my spare parts table. This is how it's being done in the current