database-design

when to prefer pessimistic model of transaction isolation over optimistic one?

微笑、不失礼 提交于 2019-12-24 10:58:25
问题 Do I understand correctly that table/row lock hints are being used for pessimistic transaction (TX) isolation models of concurrency ONLY ? In other words, when can table/row lock hints be used during engagement of optimistic TX isolation provided by SQL Server (2005 and higher)? When one would need pessimistic TX isolation levels/hints in SQL Server2005+ if the later provides built-in optimistic (aka snapshot aka versioning) concurrency isolation? I did read that pessimistic options are

SQL DB schema best practice for List item table

断了今生、忘了曾经 提交于 2019-12-24 10:57:05
问题 I have a table say Table1 which has following columns 1. Id 2. Name 3. TransportModeId 4. ParkingId 5. ActivityId Column 3,4,5 are the foreign keys and all three are simple list tables which has following columns 1. Id 2. Item For simplicity I have shown 3 tables otherwise my actual schema contains almost 25 List table. What should be the best Practice Option 1. Keep all list table separate which will create 25 tables but on the other hand i will have a clean modular schema Option 2. Make a

relational database design scenario

北城余情 提交于 2019-12-24 10:35:51
问题 Consider we have 2 tables like the following: products: id, name (PK = id) product_group1: product_id (PK = a1_id) (FK = a1_id REFRENCES a1) product_group2: product_id (PK = a1_id) (FK = a1_id REFRENCES a1) product_group3: product_id (PK = a1_id) (FK = a1_id REFRENCES a1) the question is , I want to design a table called approved_products that only accepts products from group1 and group2(not group3). how can I design such table ? (I'm using mysql BTW) 回答1: You cannot solve this problem with

Many-to-many relation ship with form-based multi selection

北城以北 提交于 2019-12-24 10:09:21
问题 I am creating a database and I need to construct a form-based entry method of adding data into my tables, whilst maintaining what I believe is a many-to-many relationship. Say Project X can have Parts X, Y and Z - and Parts X, Y and Z can be used on more than one project. What is the best way of allocating a list of 'parts' to a project through a form, without have a huge array of tickboxes, and how do I construct my tables to accommodate this? Much appreciated. 回答1: Many-to-Many relationship

SQL Server Architecture

余生长醉 提交于 2019-12-24 09:13:41
问题 This is kind of a tough one to explain. I'm going to try to correlate our issue into a general spec. I've got a table of questions that needed to be asked based on certain circumstances. For instance, let's say that I have 2 apples. 1 apple is blue and the other apple is red . Now, I need to be able to assign a question if we have 1 red apple. However, I also need to be able to assign a question for the combination of 1 red apple and 1 blue apple. What's the best way to architect this? I feel

the “deleted row” indicator in dbase?

拟墨画扇 提交于 2019-12-24 09:11:54
问题 As you know there is no x64 driver for dBase. "http://msdn.microsoft.com/en-us/vfoxpro/bb190289.aspx" I tried to make one. It is extremely faster than ODBC.but there is only one problem. I cannot determine if a row is deleted or not. 回答1: The first byte of each record (not header or field description, but actual record data) will contain an asterisk ("*") if the record is deleted, or a blank space (" ") if not. Here's something I found a while back on Wotsit.org that may help: ---------------

Can you Delete in a replication based Distributed Database?

ⅰ亾dé卋堺 提交于 2019-12-24 08:55:04
问题 I have thus far been living under the impression that you can not truly delete a row in a replication based Distributed Database. It all works well in a Copy based one. But in Replication you mark them as "consider this delete" and filter them out in every last query. But you do not ever actually delte something from teh DB. I think it is time to verify if that asumption is true. My udnerstanding is that you would run into a Race Condtion with the Replicaiton if there was ever a key colission

smallest mysql type that accommodates single decimal

℡╲_俬逩灬. 提交于 2019-12-24 08:17:31
问题 Database newbie here. I'm setting up a mysql table. One of the fields will accept a value in increment of a 0.5. e.g. 0.5, 1.0, 1.5, 2.0, .... 200.5, etc. I've tried int but it doesn't capture the decimals. `value` int(10), What would be the smallest type that can accommodate this value, considering it's only a single decimal. I also was considering that because the decimal will always be 0.5 if at all, I could store it in a separate boolean field? So I would have 2 fields instead. Is this a

How to model a MySQL structure to deal with authentication? With users information separated

纵然是瞬间 提交于 2019-12-24 08:13:12
问题 I need help to model a table structure for my database. I have two tables: teacher and student. And to deal with authentication, I have another table called: user. I want to maintain the information about teacher and student separated of the information about login (user table). For example: teacher ----------------- | id | name | ----------------- | 10 | lorem | | 20 | ipsum | | 30 | dolor | ----------------- student ----------------- | id | name | ----------------- | 5 | amet | | 6 | sitt |

1NF: Repeating Groups, what are they? [duplicate]

半世苍凉 提交于 2019-12-24 07:25:15
问题 This question already has answers here : Normalization: What does “repeating groups” mean? (2 answers) Closed 5 years ago . There seems to be a misconception on what is a 'repeating group', in terms of its removal in 1st Normal Form (1NF), could any one clearly clarify what it actually is and how to identify one? The misconception, I found, is discussed further here: https://stackoverflow.com/a/23202535/4011506. However, that has further confused me. In regards to the following video (4:30