rdbms

quickest sparse matrix access, when disk is involved

强颜欢笑 提交于 2019-12-13 03:59:06
问题 Imagine you have a table 'users' with 10 Mio records and a table 'groups' with 1 mio records. In average you have 50 users per group which I would store at least in an rdbms in a table called users2groups. users2groups is in fact a sparse matrix. Only 80% of the full dataset of users and groups fit into available memory. The data for the group membership (users2groups) comes on top, so that if memory is needed to cache group memberships this has to be deallocated from either the users or the

add two different queries result into one table

泄露秘密 提交于 2019-12-13 03:38:52
问题 I have two different query (having same no. of columns in result). I want to put both in one table. for example i have following table: id country salary 1 us 10000 2 uk 25000 3 us 35000 4 uk 31000 5 uk 26000 now I have following queries: Query 1 : select * from table where country='us'; and Query 2 : select * from table where country='uk'; i have one final table having six columns like: id1 |country1 | salary 1 | id2 | country2 | salary2 Now, i want to put both queries result in this table

how to make sure that product specs is for the category entity?

余生颓废 提交于 2019-12-13 03:27:13
问题 I have the following table: products (id, name, price, category_id) categories (id, name, description) now because each category's products may have different attributes than other category's product I want to use EVA but here is my problem: I want to make sure that any product attribute's value is being added belong to the category of that product and not allowing the addition of arrtibutes that does not belong to it. would you please tell me how to do this? 回答1: I want to make sure that any

inventory system: transaction-based or store quantity, update with trigger?

白昼怎懂夜的黑 提交于 2019-12-12 10:07:32
问题 How would you design the data model for an inventory management system in RDBMS? Would you: store each purchase & usage, and uses SUM() and GROUP BY to calculate the warehouse quantity on-the-fly? same as 1, but consolidate the quantity daily, and use the value of the previous day? quantity as an Int field, update through application layer? same as 3, but make use of DB trigger? Transaction-based inventory system seems to be superior in terms of level of details it captures, but it is harder

How does the HEXTORAW() function work? What is the algorithm?

筅森魡賤 提交于 2019-12-12 09:55:31
问题 HEXTORAW is a function found in several RDBMS's like Oracle, and DB2 on LUW. It takes a character, or integer input, and basically casts it to a HEX value. HEXTORAW(1234) = x'1234' What is the algorithm for this type conversion? What is happening in the code behind the scenes? (This is motivated by wanting to create this function in an RDBMS that does not have the HEXTORAW function.) 回答1: From this page: http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements001.htm#i46018 When

Table-agnostic Foreign Keys?

怎甘沉沦 提交于 2019-12-12 09:47:27
问题 First, I did read this StackOverflow question, so no need to point me towards it. I'm working on a similar problem right now. Specifically, I have a database with an Auditing table that is used to store auditing info about other tables within the db. The basic form of this table is: ID, EntityID, EntityTypeID, ActionTypeID, DateTime Now, as you can guess, the generic nature of EntityID means that foreign key relationships to and from this table are tricky to manage, especially with you

Calling an Oracle PL/SQL procedure with Custom Object return types from 0jdbc6 JDBCthin drivers

柔情痞子 提交于 2019-12-12 07:17:04
问题 I'm writing some JDBC code which calls a Oracle 11g PL/SQL procdedure which has a Custom Object return type. Whenever I try an register my return types, I get either ORA-03115 or PLS-00306 as an error when the statement is executed depending on the type I set. An example is below: PLSQL Code: Procedure GetDataSummary (p_my_key IN KEYS.MY_KEY%TYPE, p_recordset OUT data_summary_tab, p_status OUT VARCHAR2); More PLSQL Code (Custom Object Details): CREATE OR REPLACE TYPE data_summary_obj AS

How to think in SQL?

北城以北 提交于 2019-12-12 07:09:01
问题 How do I stop thinking every query in terms of cursors, procedures and functions and start using SQL as it should be? Do we make the transition to thinking in SQL just by practise or is there any magic to learning the set based query language? What did you do to make the transition? 回答1: A few examples of what should come to your mind first if you're real SQL geek: Bible concordance is a FULLTEXT index to the Bible Luca Pacioli's Summa de arithmetica which describes double-entry bookkeeping

Oracle instant client status

六眼飞鱼酱① 提交于 2019-12-12 04:24:46
问题 I saw some presentations about a very promising product "Oracle Instant Client". Could you tell me what is the status of this product? Is it really used? How is the support from Oracle? It seems to be kind of equivalent to the thin driver for Java. Is it really something as simple as unzip, modify 1 or 2 environment variables and run your client application? http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html http://www.dbatoolz.com/t/installing-oracle

Transform between relational database and graph-based database

北慕城南 提交于 2019-12-12 04:00:50
问题 I am aware that there are algorithms (and even tools) to transform relational databases (RDBMS) to Graph databases, and the other way around. I do have several questions that are a bit larger than that: Is there a common-practice working algorithm out there for such transformation, for example RDBMS => graph (or several)? Is this algorithm bijective? To be more precise: 2.1. Given said algorithm, is the transformation RDBMS => graph injective (one-to-one)? More plainly, can there be any two