database

Binary vs Integer - as primary key?

I was wondering if there are any obvious pros and cons one should be aware about, while choosing to use a Binary type as a primary key, while being RANDOMIZED. Which means, new inserts will have random 4 bytes as their PK - versus having a sequence of type Integer? I'm using MySQL/MyISAM. Thanks, Doori Bar ...

SQL Server: Importing database from .mdf?

I have an .mdf file on my local box. I have SQL Server 2008 Express and SQL Management Studio 2008 Express installed on my local box. How in the world do I import this .mdf file as a new database into my SQL Server? This seems like a ridiculously common task that must be performed thousands of times a day across the globe, and I canno...

Alternative to .iterdump for sqlite in python?

Hi, I found a function that will help me load a disk sqlite database to a memory database, but have found that the module I need, apsw, doesn't support it, while pysqlite does. I need apsw because it has most of the functions I need that pysqlite does not. Is there any work around To completely copying to a database? ...

SQLAlchemy JSON as blob/text

I'm storing JSON down as blob/text in a column using MySQL. Is there a simple way to convert this into a dict using python/SQLAlchemy? ...

Basic MySQL Table Join?

I have these 2 tables: ASSOCIATION_TABLE: [id, key, name, manager, office, bank, customer] and OFFICE_TABLE: [id, name, address, phone] I am currently running this query to get a data set that I need: SELECT `name`, `key`, `office`, `manager`, `id` FROM `database`.`ASSOCIATION_TABLE` WHERE `association`.`customer`=4; How can I m...

Database suggestion for processing/reporting on large amount of log file type data

We have an app that creates text log files of requests to it. Pretty typical stuff in the log file and it is space delimited (date, time, url, http code, ip, user agent, etc). Currently, we are generating around 500k entries in the text log files per day. We're currently doing a lot of analysis via sed/awk/grep of the text files. Ho...

SQL database queries basic question

Relational Schema: Employee (Enum, Ename) VentingMac (Enum, Cokename, day) The attribute Enum in VentingMac relation is a foreign key referencing the relation Employee. I want to list out all the employee names (Ename), who drink more than 3 (distinct) coke on the same day (assuming they wont drink the same coke each day) ...

c# and databasing: in theory, how to create a training list

I'm obviously not looking for any actual code necessarily, but more of someone to point me in the right direction. I'm trying to convert our training lists from paper to a digital format but the manager wants to keep roughly the same format intact. This would be a great project for a database type setup but im wondering how to approach i...

how to represent one-to-one relationship in db design?

Say I have two classes Laptop and Lcd. Let's now assume each Laptop can have only one Lcd and an Lcd can only be installed on one Laptop at any time. Let's also assume an Lcd can be removed from one Laptop and installed on another. So this is a one-to-one association from Laptop to Lcd. Now the question is, how to design the db schema ...

How do I insert data into object tables that have refs to others?

I'm new in Oracle and I really don't have a clear idea how to do this. The database is this one... CREATE OR REPLACE TYPE personUdt4 AS OBJECT( pid varchar(11), firstName varchar(20), lastName varchar(20), dob date) NOT FINAL; / CREATE OR REPLACE TYPE locationUdt4 AS OBJECT( street varchar(30), bldg varchar(5), room varchar(5)...

how to scale databases

Can someone give me a quick rundown on the old and latest research on scaling databases or storage? I have heard of master/slave. What else are there? Thanks! ...

What is database pooling?

Hi , I just wanted to know the concept of database pooling.How it is achieved. ...

Redundant Dictionaries, Simulated Database or Physical Database?

Good morning, At the moment I am needing some help from someone more experienced with database issues than me. I need to work with two sets of (String, Int32) pairs. The first one has about 160,000 pairs, and the second one has about 1,620,000 pairs. The question is that every part of this last collection's strings is contained on the f...

Where can I get manuals for windows phone application that are based on a database?

What is the native database the windows phone use like (coredata and sql-light in the iphone) Do you know a manual that explain how to use those DB's... preferably with code samples. I don't like to use DBs no matter how good they are if they are not considered main stream such that I can trust future microsoft versions support (I kno...

Generate a complex database model with MS Entity Framework

I have a database with about 160 tables (it's a shock ! I thought it had about 50...). We use a codebase with no DAL, and we want to start using MS Entity Framework (that's the latest, hottest thing in .net DAL, right ?) so we can use Linq and other state-of-the-art-3-years-ago stuff. I tried to automatically generate the whole DB model...

db design questions (how to deal with groups of products, to make 2+2=3)

I would be grateful if somebody could help me to find an elegant solution to this database design problem. There is a company with a lot of different products (P1,P2,P3,P4) and a lot of customers (C1, C2, C3, C4). Now they have a simple database table to deal with orders, something like 20101027 C2 P1 qty status 20101028 C1 P2 qty status...

Accessing a database from CakePHP when behind a proxy server

I'm working on a web application that's using CakePHP and MySQL. Depending on the circumstances, I may be using one of two computers and I may be behind a proxy server that won't allow me to directly modify any code on my web server. Because of this, I've installed XAMPP on my machines to act as a local web server, and I keep my code i...

How Do I Convert an Excel XLS to an Access MDB using Excel VBA

I need to use VBA from Excel to load an Excel workbook in access and transfer it out to a database. Dim acc As New Access.Application acc.OpenCurrentDatabase "C:\Test.xls" I got that far and Excel crashes and has to restart. My plan was to use the following but I can't get that far. acc.DoCmd.TransferDatabase Any ideas? I've googl...

Environmental database design

Hi everyone, I've never designed a database before, but I've had experience programming in a few languages and assembler throughout college, as well as some web design, so I'm able to at least pick up what I need to know if I can be pointed in the right direction. One of the tasks of my job is to sort through some data that we've been c...

What is a relation in database terminology?

When someone refers to a relation in a database course, what does that mean? ...