database

datasets: xml or mysql faster ?

hi, I'm using the stackoverflow dataset, I would like to know if I should convert the dataset from xml to mysql to improve the retrieval performances and work more efficiently. If it is better to convert to mysql, can you suggest conversion tools (I'm on a mac) thanks ...

How to automatically parse an RSS feed for storage in MySQL database?

I need to somehow automatically update/parse a couple of RSS feeds and place them into a MySQL database almost as soon as the feed is updated, or as close as possible. However, I can't work out the best way to do this automatically - I've found tutorials for doing it when a user runs a script - but in this case it all needs to be done in...

.NET data-based application architecture suggestions, opinions, good practices

Hello, I'd like ask a question about building applications in .NET that use data from a database. There are many technologies and patterns and I'm trying to connect it all. I'm building a desktop application with local database, so I choose SQLServer CE + WinForms, but I'd like to keep this as general as possible. I'm not into other tec...

conditional statements in derby

It looks like derby doesn't support conditional statements [IF]. How do we write if exists (select 1 from customers where name='somename') update customers ... else insert into customers ... in derby? Derby doesn't have 'replace into' of mysql either. Note: I am using derby as unit-testing replacement for mysql [that is pr...

PostgreSQL bytea Primary Key

I have a table in my database which stores logs. The log files are timestamped with second accuracy and store the values of various sensors and their source: log_id, log_date, primary_system_source, sub_system_source, values Where log_id, primary_source and sub_source are integers and values is a variable length byte array (datatype: ...

Cakephp HABTM relation

i have theses tables article , article_currency, currency in database and i made HABTM between article and currency like this var $hasAndBelongsToMany = array('currency'=>array('className' => 'currency','joinTable'=>'article_currency','foreignKey' => 'articleid','associationForeignKey' => 'CurrencyID')); var $hasAndBelongsToMany = a...

SQL: Get latest record

Hi all, this is my relational model: Request ------------------------------ RequestId ------------------------------ 1 2 RequestState ------------------------------ RequestStateId | Name ------------------------------ 10 | Received 20 | Processing 30 | Finsihed Request...

Best strategy to initially populate a Grails database backend

Hi, I'd like to know your approach/experiences when it's time to initially populate the Grails DB that will hold your app data. Assuming you have CSVs with data, is is "safer" to create a script (with whatever tool fits you) that: 1.-Generates the Bootstrap commands with the domain classes, run it in test or dev environment and then use...

A Linq to Sql - Multiple .DBML files or one .DBML File

I am working on a web application using ASP.NET 3.5. The application has hundreds of tables. I was told in a seminar that I should use one .DBML file for the entire application instead of using multiple .DBML files (there was also a post in stackoverflow that said the same thing). Given that I have so many tables does using one .DBML f...

How to update table in database1 from function in database2 in PostgreSQL?

Hi, Is there a way to update a table in database1 from a function in database2 (both databases are on the same server)? Basically cross database update in PostgreSQL. Function is executed by a trigger but it shouldn't matter. -= edit =- I know I can make it using DBLink but I would like to modify the source database as little as possi...

SQL recursive query on self refrencing table (Oracle)

Hello Lets assume I have this sample data: | Name | ID | PARENT_ID | ----------------------------- | a1 | 1 | null | | b2 | 2 | null | | c3 | 3 | null | | a1.d4 | 4 | 1 | | a1.e5 | 5 | 1 | | a1.d4.f6 | 6 | 4 | | a1.d4.g7 | 7 | 4 | | a1.e5.h8 | 8 | 5 ...

load xls file into SQL 2000 db into two tables, iterate through each row

Hi all, I have an XLS file with the following rows: store name - idtype1 - idtype2 - idtype3 store 1 - 1a - 1b - 1c store 2 - 2a - 2b - 2c There are actually 5 ID types and over two hundred stores, there are also columns such as address, email etc. What I need to do is load this data into two tables,one bei...

OR query performance and strategies with Postgresql

In my application I have a table of application events that are used to generate a user-specific feed of application events. Because it is generated using an OR query, I'm concerned about performance of this heavily used query and am wondering if I'm approaching this wrong. In the application, users can follow both other users and group...

PHP/MySQL: Preventing duplicate actions quickly in succession

For a browser game, I have a database table fights: fightID fromID toID simulated (1=true, 0=false) Whenever a user requests a page, I select all fights which still have to be simulated: SELECT fightID, fromID, toID FROM fights WHERE simulated = 0 These outstanding fights are then simulated in the PHP script and, finally, the figh...

MySQL query help

Hi I cant figure out any good way to get a list of tag.names and lang which isn't already inserted in combination inside images_urls. My database looks something like this. tags name user_id +-------+---------+ |hi | 1 | |friend | 1 | |friend | 2 | |people | 2 | +-------+---------+ users id lang...

mysql select query help -- ORDER BY

I'm trying to construct a select query where it will take all the columns of 4 tables and then order and display the results by the column 'name' (the same in all tables). I'm still learning the ropes of MySQL. I'm finding that because the columns share the name 'name', only the results from the last table are displayed. Is there a wa...

First-time database design: am I overengineering?

Background I'm a first year CS student and I work part time for my dad's small business. I don't have any experience in real world application development. I have written scripts in Python, some coursework in C, but nothing like this. My dad has a small training business and currently all classes are scheduled, recorded and followed up...

Concurrent access problem in mysql database

Hi i'm coding a python script that will create a number child processes that fetch and execute tasks from the database. The tasks are inserted on the database by a php website running on the same machine. What's the good (need this to be fast) way to select and update those tasks as "in progress" to avoid to be selected by multiple tim...

SQL: Having a table twice in the FROM clause

I am using MySQL. Here is my schema: Suppliers(sid: integer, sname: string, address string) Parts(pid: integer, pname: string, color: string) Catalog(sid: integer, pid: integer, cost: real) (primary keys are bolded) I am trying to write a query that selects pairs of sids that supply the same part: -- Find pairs of SIDs that both su...

database for scientific calculation

I need to include a database in a C# project with a lot of data. This database should be free even in a commercial use. What database should I use? [EDIT] I would like to know what database are to be avoided. When I say "a lot", it's for scientific calculation so it will be huge data. ...