database

MySQL: how to ensure integrity in multiple read only architecture

Scenario is simple to describe, but might have a complex answer: Imagine a case where you have one write only mysql database. Then you have about 5 or 6 read only databases. The write database has a count for a particular inventory. You have hundreds of thousands of users banging away at this particular inventory item, but only limited ...

How To Store Arbitrarily Wide Tree Of Set Depth

Hello Everyone. I need to store data that looks like this: <root> <child-one> value 1 value 2 ... value n </child-one> ... </root> By this I mean, a very shallow tree with a variable number of leaves. I would have liked to store this data in a relational database, but I cannot find of w...

Generate XML file from database by XSD schema

I have database tables (SQL Server 2005/2008) and XSD schema which describes XML document. How can I generate XML document from database tables by this xsd schema? Thanks ...

Customer-customizable ORM in .NET

I have a need for allowing business rules to be defined in a commercial, shipping product with respect to data authorization rules. The rules need to be customizable in the field, and the customizations need to survive updates of the application. The system is C#/ASP.NET. I've considered using a DSL for this, but it seemed like a lot ...

Creating a custom forum, help with building a query that counts posts in a categories etc.

So my database setup is fairly simple. I have a forum_cat table (a forum category) and forum_post table. The forum_post has a field fk_forum_cat_id which ties each forum post to a category. Each forum_post also has a field fk_parent_forum_post_id which basically says it belongs to an original post. Further more, there is a date_added...

Can I edit AutoNumber Column in Access?

I've lost my data in Access base, and I've manage to bring them back but when I copy the values in the table with the AutoNumber Column it increments the numbers. Is there Any way to change it to int and then bring it back to AutoNumber? ...

Where I can access Databases in Eclipse for Android development?

I apologize if this is a stupid question, nevertheless I need to ask. I am new to Android development and have gone through every single tutorial and reference provided. I have been doing great, with the exception of one stupid problem; I cannot find where the databases for some apps are stored. For example I would like to build my ow...

Avatar image: store in database or on CDN?

Avatar image: store in database or on CDN? Ps( avatar is the users profile photo) ...

Correct way to model relational database

Hi, to explain my problem, I'll give a simple example: My database has three tables: [positions] - position_id INT - position VARCHAR [employees] - employee_id INT - position_id INT - FK - name VARCHAR - birth_date DATE [vehicles] - vehicle_id INT - model VARCHAR - year VARCHAR - color VARCHAR The problem is that I must ...

Instead of joining tables, merging objects: Is this bad practice?

Is this bad practice and should I be shot for coming up with this code? function get_business_addresses($business_id) { $query = $this->db->get_where('contact_business_addr_rel', array('business_id'=> $business_id)); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $address_id = $row->addr...

Whats wrong with this Data Explorer SQL query?

I am trying to write a How much did I type? query on Stack* Data Explorer. Modifying an existing query got me this far: -- How much did I type? DECLARE @UserId int = ##UserId## select sum(len(Body)) AS 'Posts' from posts where owneruserid = @UserId, select sum(len(Text)) AS 'Comments' from comments where userid = @UserId, (sele...

How do you decide what process to kill in SQL Server Activity Monitor?

Hi, I am not a Db guy. But sometimes I am asked to check Db and see if there are some processes blocking the Db and if yes, KILL! Can you explain me what is the best way of reading the Activity Monitor in terms of finding the right process candidates to be killed? What columns to be checked first and against what values? thank you, ...

Django Db Images video

Hi How can I store Images, Videos and Audio via Django in a Mysql db? I know I can either store the link to the image, video, audio, or the image, video, audio itself. But how does this exactly work. I know about the models and how they create tables via the manage.py. But is there a good tutorial on how to create an image (e.g. jp...

ISQL app migration option, Progress - "OpenEdge" Personal RDBMS with 4GL(ABL) development system?

Back in 1985, when I was a Product Planner for AT&T-IS Labs (Unix Product Management), one of my primary duties was to evaluate emerging 4GL/RDBMS products, submit product plans and recommend whether AT&T should pursue a co-marketing or co-labeling agreement with the vendor or just test/certify it as compatible on our 3B-series systems. ...

Iphone SDK Help me for a request to show only one category from data plist !

Hi ! I look for a friends who can help me for long time ! I'm beginner and I try to understand... HOW I can make a request to show all data (from plist) in SAME category (NOT ALL !) for exemple : show only the movie have : genre = Action Please help me ... Thanks a lot ! Excuse my bad english ! Is it in this code I must make it or an ...

Preventing SQL injection in C++ OTL, DTL, or SOCI libraries.

I've been looking at all three of these database libraries, and I'm wondering if they do anything to prevent SQL injection. I'm most likely going to be building a lib on top of one of them, and injection is a top concern I have in picking one. Anybody know? ...

How do I save data created in a form in Access 2003 when I reference other tables?

I'm not sure how to fix this issue, but when I utilize combo boxes on my form which selects data from multiple tables I'm not able to save any of the data selected. I tried to use the Bound form utility but it only asked me to "Enter Parameter Value". I took out the "Bound" portion of the code and the combo box works fine. I have ...

what is extensive and intensive in DBMS

what is extensive and intensive in DBMS ...

Recursive calls to database in perl

I know there's an easy way of doing this, but my recursion abilities are out of practice. Given a database table that has three fields: id label child_id I should be able to put together a recursive function that will give output like this: child (input of program) parent1 parent2 grandparent1 great-grandparent1 gr...

PostgreSQL: Which SQL pattern is faster to avoid inserting duplicate rows?

I know of two ways to insert without duplication. The first is using a WHERE NOT EXISTS clause: INSERT INTO table_name (col1, col2, col3) SELECT %s, %s, %s WHERE NOT EXISTS ( SELECT * FROM table_name AS T WHERE T.col1 = %s AND T.col2 = %s) the other is doing a LEFT JOIN: INSERT INTO table_name (col1, col2, col3) SELECT ...