database

Help me for creating huge database in Mysql

We are building a website for business on global wise, for every country major cities are covered in this concept. I need some suggestions from PHP Mysql People. Can i create single databse for all cities or multiple databases. Because in this system contains some relations between cities ,every chamber need nearly 50 tables for networ...

Version Controlled Database with efficient use of diff

I have a project involving a web voting system. The current values and related data is stored in several tables. Historical data will be an important aspect of this project so I've also created Audit Tables to which current data will be moved to on a regular basis. I find this strategy highly inefficient. Even if I only archive d...

Best practices for using and persisting enums

I've seen several questions/discussions here about the best way to handle and persist enum-like values (e.g. http://stackoverflow.com/questions/492096/persisting-data-suited-for-enums , http://stackoverflow.com/questions/256978/how-to-persist-an-enum-using-nhibernate ), and I'd like to ask what the general consenus is. I've tried to sum...

Database schema for a site like SO?

Since I took the basic undergrad course in databases design and SQL I haven't really touched anything like this. So my question is - how would the database schema for a site like this one would usually look like? What are you generally expected to find? For instance, how are questions and answers stored? Are there some tools which allow ...

A messy SQL statement

I have a case where I wanna choose any database entry that have an invalid Country, Region, or Area ID, by invalid, I mean an ID for a country or region or area that no longer exists in my tables, I have four tables: Properties, Countries, Regions, Areas. I was thinking to do it like this: SELECT * FROM Properties WHERE Country_ID NOT ...

Database for a limited VPS

Hello! Which database is more suitable for a limited VPS: MySQL or PostgreSQL ? I am developing a small hobby project which I plan to host in a limited XEN based VPS. At work we use PostgreSQL but we also use dedicated servers for DB and our hardware are very good. I've never had an extensive experience with MySQL but wouldn't it be mo...

Integer vs String in database

When defining datatypes in a database, I have always had a problem with choosing whether to use integers or strings to store certain 'numerical' data. Say I am building Yet Another Address Book and there is a post code field. Provided that post codes are always a 4 digit number, which data type do I store it as? Integer or string? Techn...

Oracle Lite - Cannot connect to newly created DB. [POL-3013]

I get an error when I try to connect to my newly created Oracle Lite database. But I can connect to the orabpel DB that was created with the Oracle SOA install. Here are the steps I took to create it: Ran: createdb polite db1 manager Result: Oracle Lite CREATEDB Version 10.2.0.2.0. Copyright (c) 1997, 2005, Oracle. All rights reserv...

Preventing Sql column overflows

If I have a parametrized stored procedure which takes a varchar(10) value and converts it to an int, I currently have to ensure that the value is not greater than the varchar equivalent of the maximum int value. IF @Criteria <= '2147483647' SET @Id = CONVERT(int, @Criteria) My question: Is there a better way to prevent overflowing an...

Database agnostic table/view export software?

Trying to search for a more elegant/overall solution to our common/basic data export tasks I am convinced that there must be software out there that allows me to: Define and persist a "setup" (definition of file format, delimiters, encoding, column names etc) from a GUI Run on a schedule/from command line Work on both Oracle and MSSql...

How can I associate images with entities in Google App Engine

I'm working on a Google App Engine application, and have come to the point where I want to associate images on the filesystem to entities in the database. I'm using the bulkupload_client.py script to upload entities to the database, but am stuck trying to figure out how to associate filesystem files to the entities. If an entity has th...

Best way to gather, then import data into drupal?

I am building my first database driven website with Drupal and I have a few questions. I am currently populating a google docs excel spreadsheet with all of the data I want to eventually be able to query from the website (after it's imported). Is this the best way to start? If this is not the best way to start what would you recommend?...

Merb & DataMapper - accessing database connection info?

I'm using Merb and DataMapper with a MySQL db. I want to access the database name, user, and password from a Rake task for my Merb app. I guess I could YAML.load() the the database.yml, but that seems ugly. Any ideas? ...

ORM - Saving/Restoring default values for a DB object with C#

In order to assist users with repetitve data entry, I am trying to implement a system where many of the previous properties are remembered when adding new data. Is it possible to use the Properties.Settings.Default.MySetting functionality or is there a better method for doing this kind of thing? ...

SQL Server 2005, Maintenance Plan suggestion

Hi there, I need some advice on SQL Server 2005 maintenance plan, okay here some question: What task(s) is/are suitable for daily maintenance and what for weekly/monthly maintenance Do database need to be offline while in some task, example : reorganize/rebuild index, Shrinking database, etc... (since we need to keep 90% uptime) How l...

Database design for text revisions

This question contains some excellent coverage of how to design a database history/revision scheme for data like numbers or multiple choice fields. However, there is not much discussion of large text fields, as often found in blog/Q&A/wiki/document type systems. So, what would be considered good practice for storing the history of a te...

Relational databases - there has to be more right?

I really enjoy database design and the whole concept of managing data semantically and all the logic that comes with it. My knowledge level when it comes to databases is however (I would guess) quite basic - I can model data relationships correctly with ER diagrams, connection tables, handling many-to-many, one-to-many etc etc. I'm expe...

Create an index on SQL view with UNION operators? Will it really improve performance?

I am trying to create an index on the following view: SELECT 'Candidate' AS Source, CandidateID AS SourceId, LastName + ', ' + FirstName AS SourceName FROM dbo.Candidates UNION SELECT 'Resource' AS Source, ResourceID AS SourceId, LastName + ', ' + FirstName AS SourceName FROM dbo.Resources UNION SELECT 'Deal'...

Compress data from Database

Quick q, could be a silly one given my (lack of) findings on Google so far. I have a Database. In this database is a Table with some Data. The Data is a large BLOB but can't be compressed (for reasons out of my control). I have an Application that talks to this Database. I would really like to be able to ensure that the Data is comp...

Techniques for storing/retrieving historical data in Rails.

Hello, I'm looking for some ideas about saving a snapshot of some (different) records at the time of an event, for example user getting a document from my application, so that this document can be regenerated later. What strategies do you reccomend? Should I use the same table as the table with current values or use a historical table? ...