database-design

What are locking issues in OLAP?

本秂侑毒 提交于 2019-12-21 17:49:18
问题 In one local financial institution I was rebuked by their programmers for expressing them my opinion that (their programmers' obsession with) (b)locking issues in their MS SQL Server 2005 OLAP (SSAS) database(s) did not make much sense to me. (The OLTP databases are SQL Server, Oracle and non-RDBMS ERP). What are locking issues in OLAP processing if OLAP (SSAS) databases are used only for reading (read-only after deployment)? In which context do such (an whic?) issues arise - during SSIS

How to properly relate items to pricing data, taking price change history into account

久未见 提交于 2019-12-21 17:49:04
问题 Virtually all POS systems record the price of an item directly to the transactions table at the time of the sale since that price may change at a later date, but the price it sold at should remain the same. I'm wondering how you would setup pricing table(s) that keep a history of price changes, so that you can relate the transactions to that table based on the item and the time it was sold in order to get the correct price? I think anyone who's ever worked with POS systems will understand

Subtyping database tables

夙愿已清 提交于 2019-12-21 17:30:00
问题 I hear a lot about subtyping tables when designing a database, and I'm fully aware of the theory behind them. However, I have never actually seen table subtyping in action. How can you create subtypes of tables? I am using MS Access, and I'm looking for a way of doing it in SQL as well as through the GUI (Access 2003). Cheers! 回答1: An easy example would be to have a Person table with a primary key and some columns in that table. Now you can create another table called Student that has a

How to handle price fluctuations in an invoice application?

女生的网名这么多〃 提交于 2019-12-21 17:24:16
问题 In an invoicing application, consider following: I have a products table that also contains the price of the product. And then I have an invoice and invoice_lines table and in each invoice line, I refer to the product id along with quantity. In this case, I am not storing the price of the product with the invoice line. Now few months later, if the price of the product changes, any report would show the volume of the sales based on current price instead of the price on which the product was

Re-indexing large table - how screwed am I?

我只是一个虾纸丫 提交于 2019-12-21 15:00:04
问题 I have a 1 TB, 600m row, table which has a misguided choice of indexed columns, specifically a clustered index on the primary key column which is never used in a select query. I want to remove the clustered index from this row and create it on a number of other rows. Table is currently like this: colA (PK, nvarchar(3)) [clustered index pt b] colB (PK, bigint) [clustered index pt a] colC (DateTime) [non-clustered index] colD (Money) [non-clustered index] colE (bit) [no index] colF (bit) [no

Storing multiple values for a single field in a database

我们两清 提交于 2019-12-21 14:55:00
问题 Suppose i have a table with 3 fields Person_id, Name and address. Now the problem is that a person can have multiple addresses. and the principle of atomic values says that data should be atomic. So then how am i suppose to store multiple addresses for a single person ? 回答1: You're supposed to create an ADDRESS table that has a foreign key linking it to a PERSON record, i.e. PERSON_ID . This is the "relational" component of a relational database, and it's why it's more flexible than a flat

Query-based rules with auth.uid not working

↘锁芯ラ 提交于 2019-12-21 12:31:22
问题 I have the following structure: events -LEe7X118dkcH2JhJRe description: "Testdescr" eventTasks participants 0zlwpSlCazNGjOyMi95h8awshrG2 lastLogin: 1528641494535 userKey: "0zlwpSlCazNGjOyMi95h8awshrG2" username: "User1" 6LnYKxRu2SWUrxwIzId8dDpOrl02 lastLogin: 152856590172 userKey: "6LnYKxRu2SWUrxwIzId8dDpOrl02" username: "User2" I want to query all events, to which an user participants (like a filter). My Java-Code is: mDatabaseReference = FirebaseDatabase.getInstance().getReference("event");

Flat File Database Example

和自甴很熟 提交于 2019-12-21 12:23:36
问题 I would like to see some examples of simple flat file databases and how they are accessed through a data layer. I've written to and read from a flat file before, but I have not ever created a data layer that accessed the data for an application using text files. If possible, it would be nice to see a tutorial that had a data layer that utilized a simple, custom flat file database. An example that saves custom business objects in XML and then uploads them would be nice because XML is so

SQL Server Fragmentation Problems

谁说我不能喝 提交于 2019-12-21 12:05:41
问题 I have a couple of tables (User & UserRecord) in my database that get extremely fragmented (like 99%) and cause the whole database and therefore the website to grind to a halt. UserRecord is kind of like a snapshot of that user at a point in time. User is like the master record for that user. User has 0 to many UserRecords. User has around a million rows, UserRecord has around 2.5 million. These tables get written to a lot. They're also being searched a lot. They're both going to get a lot

SQL Server Fragmentation Problems

会有一股神秘感。 提交于 2019-12-21 12:05:11
问题 I have a couple of tables (User & UserRecord) in my database that get extremely fragmented (like 99%) and cause the whole database and therefore the website to grind to a halt. UserRecord is kind of like a snapshot of that user at a point in time. User is like the master record for that user. User has 0 to many UserRecords. User has around a million rows, UserRecord has around 2.5 million. These tables get written to a lot. They're also being searched a lot. They're both going to get a lot