database

Good design for persisting a JPA domain object

I have a domain object that stores some metadata and some raw bytes. This is used for storing binary objects such as PDF documents and images. I would like to persist the metadata in a database so it can be easily queried but I want to store the raw bytes in the file system for performance reasons. What is a good design for achieving th...

Why won't this simple SQL statement work?

dateposted is a MySQL TIMESTAMP column: SELECT * FROM posts WHERE dateposted > NOW() - 604800 ...*SHOULD*, if I am not mistaken, return rows where dateposted was in the last week. But it returns only posts less than roughly one day old. I was under the impression that TIMESTAMP used seconds? IE: 7 * 3600 * 24 = 604800 ...

Data visualization tool for database-query results

Hi, i looking for a tool, that can visualize the result of database query (MySQL, SQLite3 etc.) For example, i would like to have results of following query (it is SQLite3 syntax) ... SELECT count(*) FROM visits v GROUP BY date(v.visit_time) ... to be plotted graphically. (number of visits for each day) Is there any tool for it ? ...

Best to use * when calling a lot of fields in mysql?

I know generally it is always better performance to build mysql queries to name every item you need but for example on a profile page I might need every item except a few. SELECT user_name,f_name,l_name,country,usa_state,other_state,zip_code,city,gender,birth_date,date_created,date_last_visit, user_role,photo_url,user_status,frie...

Ruby on Rails migrations are very slow

I have SQLite3 database, which is populated with some large set of data. I use migration for that. 3 tables will have following count of records: Table_1 will have about 10 records each record of Table_1 will be associated with ~100 records in Table_2 each record of Table_2 will be associated with ~2000 records in Table_3 The...

Custom persistent-storage?

Hello! I need to make a desktop application that stores data, I want this data to protected, and besides, the user shouldn't have to install any data-servers (i.e. SQL-Server, office etc.). I thought XML would be the best idea, the question is how can I protect the data whilst enjoying the other cool features of it which is XML literal...

Are there any tools for schema migration for NoSQL databases?

I'm looking a way to automate schema migration for such databases like MongoDB or CouchDB. Preferably, this instument should be written in python, but any other language is ok. ...

What's better? Having 100 Tables with each 1,000 rows, or 10 Tables with each 10,000 rows?

With 10 Tables, I would have no joins. With 100 Tables, I would have one join per query. Which would show better performance? ...

Extract all the data from a database

Hey, I am wondering how to extract the data from a table in a database onto a table in a page (users.php), For example: I want to be able to get all of the usernames and all the id's from my database onto a table. So if I have in my database: 1 - Fred 2 - Frank 3 - Margret It will see that I have them user's and id's in the database...

How to create an xml database?

How can I create an XML database? Please tell me any DBMS help me to create database stored XML document. I will use an existing server for querying but first create the XML database itself. I realy confused between xml db and db that support xml plz explain the difference between them and how to create both? ...

Is it a good practice to put the tables of different versions of a website(no data sharing among these versions) in one database?

I am developing a website. There is an English version, Japanese version and Chinese version. Different version is for different language speakers. If you are a registered user of the English version, and you want to use the Japanese version, you still need to register on the Japanese version. So should I create one database and put all ...

How to automatically backup ALL mysql databases into sql statement?

MySQL Administrator> Backup Project. It is a great tool to allow you to select databases, and schedule it. However my issue is: Today got a few new websites (new database created) Tomorrow got a few more new websites (new databases created) In this case, I have to always go into Backup Project> Select those remaining schema not in the...

How to best store a large JSON document (2+ MB) in database?

What's the best way to store large JSON files in a database? I know about CouchDB, but I'm pretty sure that won't support files of the size I'll be using. I'm reluctant to just read them off of disk, because of the time required to read and then update them. The file is an array of ~30,000 elements, so I think storing each element separ...

Is Google Spreadsheets a viable database for applications?

Is Google Spreadsheets / Docs a viable database option for real-world applications? ...

Finding ODBC connection name

Situation: I have a program written in VB6 The source code of the program is not available It connects to a database using ODBC connection string. The vendor setup a connection name to the database when the program was first installed 6 years ago My machine crashed, all the settings are gone! The program vendor is out of business. Even...

mysql duplicates with LOAD DATA INFILE

Hi... When using LOAD DATA INFILE, is there a way to either flag a duplicate row, or dump any/all duplicates into a separate table? ...

Limit user participation to a server regulated competition? (iphone sdk)

Hi, I am new to programming for the iPhone. I want to allow my users to participate in a competition, to a maximum of n times a day. Is there anyway of going about that programmatically and/or through a server for optimal security (i have done NSUserDefaults). ? Is it possible to get the database server to check the number of entries ma...

Offline tool to work with MySQL databases like phpMyAdmin?

Like phpMyAdmin has to be installed as a web application to work with MySQL databases, is there a downloadable program that can connect to a remote MySQL server to create, read, update and delete databases, tables, columns and rows? ...

Can MySQL VARCHAR's store any chars?

Can MySQL VARCHAR's store any char like nulls and newlines? ...

My rails migrations won't run, and I can't deploy my rails app. How can I start over?

At some point in my rails development I started making database changes (e.g. dropping or altering columns/tables) without using rails migrations. So now I get errors when I try to deploy my rails app from scratch. blaine@blaine-laptop ~/tmp/rbjacolyte $ rake db:migrate (in /home/blaine/tmp/rbjacolyte) == AddHashToTrack: migrating ====...