database

The difficulty of choosing right database for analytics

Hi. I need some help deciding which database we should choose for our project. We are developing a web application that collects data about user's behavior and analyses that (bad explanation, but I can't provide much more detail; web analytics data is one of our core datasets). We have estimated that we will insert approx 200 million ro...

Monitor usage of a certain database field

Hi guys, I have a nasty problem. I want to get rid of a certain database field, but I'm not sure in which bits of code it's called. Is there a way to find out where this field is used/called from (except for text searching the code; this is fairly useless seeing as how the field is named 'email')? Cheers ...

pgSQL date field Conparison?

Hi all, I have a pgsql database , i want to compare two fields with there timestamp values. basic query select t1.valu1, t1.value2 from table1 as t1 where t1.valu1 == t1.valu2 With TimeStamp comparison select t1.valu1, t1.value2 from table1 as t1 where EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE t1.valu1 ) == EXTRACT(EPOCH FROM...

C# database example project

Hi, so far I've never dealed with serious DB programming in "native" languages (I'm using the "native" word here as opposition to web-based languages like PHP, thus I assume C# is one of those "native" languages. Probably I should use different word, but I don't know any). Thus I'm looking for a good example of DB application in C#. Thi...

SQL query executing slowly (for some parameter values)

I have a SQL Server 2005 database with several tables. One of the tables is used to store timestamps and message counters for several devices, and has the following columns: CREATE TABLE [dbo].[Timestamps] ( [Id] [uniqueidentifier] NOT NULL, [MessageCounter] [bigint] NULL, [TimeReceived] [bigint] NULL, [DeviceTime] [bigint] NULL, [Devic...

How to implement a super class, sub class relationship in the database?

If I have a class called animal, dog and fish is the subclass. The animal have attribute called "color". Dog have the attribute called "tail length", and the fish don't have this attribute. Fish have the attribute called "weight", the dog don't have this attribute. So, I want to design a database to store this information. What shoul...

Database Modification or start over?

So I'm currently working on rebuilding an existing website that is used internally at my company for project management, at heart it is a bug tracking utility that has some customer support and accounting operations linked into it. Currently the database model is very repetitive, a good example of this is, currently a UserId is linked i...

Zend Framework: count() returns 1 on empty result with findManyToManyRowset(...)

Hi :) While working on a small shop application i fetch all colors of an article using Zend Framework's "findManyToManyRowset" functionality. Example: $colors = $article->findManyToManyRowset('Shop_Colors', 'Shop_ArticlesToColors'); Some of the articles don't have and colors assigned. I test it using count($colors) on the ...

How to remove hex characters from DB?

Hi, i have a MySQL DB where the rows have characters like %20, %2C, etc... how can i remove them from the DB without editing the file on notepad? The .sql file is about 300mb in size... thanks ...

Player to class database relationship in a game

I'm attempting to figure out how to model a normalized database where a player may have multiple classes. What is the relationship between the player and the class objects? Each player will be able to have multiple classes and each class will then grant a player multiple skills as well. I'm familiar with normalized database and workin...

What's the best way to organize data on my tiny embedded system?

I haven't done much programming for Embedded Systems before, and now I have to create some scripts for something relatively tiny (<60MB RAM, almost all of which is already used by other more critical processes, the processor is less ~ 500MHz). I can't run something that is on all the time, so Firebird is out. I suggested sqllite, but peo...

GWT RPC: Use same DB connection across multiple requests

I'm working on a web front-end to a database. The purpose is to create a tool that students can use to learn SQL, issue queries, and see the results. Prior to now I've been using the CLI. Its primary disadvantages are a) students these days are more used to GUIs; and b) when the query returns a very wide table, it's hard to read because ...

Best Practice for Foreign Key column position in table

This might be a silly question, but here goes: Is there a standard or best practice, which specifies in what order the foreign key columns in a table should? I for one like the idea of the PK being the very first column in the table, followed by all the foreign keys, and then the columns thats relevant to that table.. Other way of do...

How does drupal connect to the database

I am really new to drupal and new to php. I have some questions. Suppose I have a drupal and a server running on my local machine, how does drupal interact with database? (database is mysql) it doesn't matter which version of drupal it is, I just want to know how drupal interacts with database. Thank you! ...

Database Design Question

I have the following situation and would like to know your opinion and inputs. My applications has a company. Each company has a lot of departments, which in turn has a lot of users. I have a calendar at all the levels. So there is a central calendar for the company, and separate calendar for each departments, and separate calendar for e...

Database encryption

I have a database that contains user details including sensitive data. They're not as sensitive as financial, but they are sensitive nonetheless. The passwords to the accounts are hashed and salted but the rest can only be encrypted not hashed to allow editing. How far would you go encrypting the fields? Would you go as far as encrypti...

Find by association (Datamapper)

I've got two models that look like this class Stage include DataMapper::Resource property :id, Serial belongs_to :staff end class Staff include DataMapper::Resource property :id, String, :key => true property :full_name, String property :email, String has n, :stages end I'm trying to find all Stages that hav...

Entity Framework timestamp Generate Database problem

Hi. I got a problem with EF 4.0 I creating entity with "timestamp" column. After that, I try to generate database. In SQL script column looks like 'binary(8)' instead of timestamp. How to solve it ? ...

which dbms is suitable for a mmorpg game server?

which dbms is suitable for a mmo rpg game server? ...

How many columns is too many columns?

I've noticed that a lot of folks here cite tables with 20+ (I've seen as much as 55) columns in one table. Now I don't pretend to be a database design expert, but I've always heard that this is a horrible practice. When I see this, I usually suggest splitting into two tables with a one to one relationship: one containing the most frequ...