database-design

Oracle 10g temp tables

I'm trying to convert the permanent tables used in a stored procedure to global temp tables. I've looked at the stats on these permanent tables and some have tens of millions of rows of data and are on the order if gigabytes in size (up to 10 GB). So, CREATE TABLE my_table ( column1 NUMBER, column2 NUMBER, etc... ) TABLESPAC...

A database question for storing and computing with historical data.

I have an application that polls different bins at different times and computes the number of widgets in each bin based on the weight. Polling is done every few minutes and the result is timestamped and added to a MySQL table. The table contains the 3 columns below. The example shows 3 bins (A,B and C) but there could be anywhere from 1 ...

ODBC iterate table without storing in memory

Hi, I need to have a way to iterate through a database table without actually storing it in memory anywhere. I want to essentially read through the rows like an input iterator. I've tried using cursors with a select statement (select * from table_name), but this retrieves the entire table and feeds it back to be one row at a time. So ...

Help designing small database.

I have a small database that I need help designing. I have a VB.NET program that gets data from a .csv file and enters the data into an Access database. The data is from a "Runway Friction Test". A machine measures the level of friction on a runway due to rubber build up from airplanes landing and puts the data into a .csv file. I n...

Design question asp.net c#

Hi Experts, I am working on a website where I have many lookup values like cities, states, countries car makes, models and many more. there are alwasy two fields for these values ID and Description. Now I have a question, should I keep them in one table and keep some TypeId kind of field which differentiate them or should they stay i...

One Table Or Three For Three Separate Objects That Have Identical Data Attributes?

I am building a site for a magazine that includes three different sections- articles, blog posts, and reviews. All three of these object types have the following columns in common: title, description, headline, subheadline, body, and author. Should I store them each in their own table, or should I just create one Posts table and add a ca...

Table Naming: Underscore vs Camelcase? namespaces? Singular vs Plural?

I've been reading a couple of questions/answers on StackOverflow trying to find the 'best', or should I say must accepted way, to name tables on a Database. Most of the developers tend to name the tables depending on the language that requires the database (JAVA, .NET, PHP, etc). However I just feel this isn't right. The way I've been ...

Facebook like notifications tracking (DB Design)

I am just trying to figure out how facebook's database is structured for tracking notifications. Wont go much into complexity like facebook is. If we imagine a simple table structure for notificaitons notifications (id, userid, update, time); We can get the notifications of friends using SELECT `userid`, `update`, `time` FROM `noti...

MySQL table design

Hi all, I have a table with products. Each product has a title and a price. The products come in huge XML files, on a daily basis. I store all of them in MySQL. But sometimes they have a wrong title. But i can't edit it, because they will be lost the next day (cronjob removes all products and inserts again). What would be the best wa...

Does SQLite support replication?

In an application which embeds SQLite3 and uses an in-memory database, is it possible to replicate the database between two running instances of the application? I could do this by hand with a homebrew protocol duplicating all my DB accesses, but it seems like something that should be done inside the DB layer. ...

the "deleted row" indicator in dbase?

hi everyone. As you know there is no x64 driver for dBase. "http://msdn.microsoft.com/en-us/vfoxpro/bb190289.aspx" I tried to make one. It is extremely faster than ODBC.but there is only one problem. I cannot determine if a row is deleted or not. ...

Storage of none default values

Hi, can some explain to me how the database design would look like for the following approach: let's say there are two tables 'toys' and 'wishlist'. Every wishlist has one toy, but 'toys' doesn't contain all the toys there are in the world. To prevent unhappy children lets add a row to toys called 'miscellaneous' so they can specify the ...

How to structure database for multilevel packing items

I want to make an inventory system where items have multilevel packings e.g A carton has medium boxes , medium boxes has small boxes and small boxes has 2 items. Please tell how to handle it by using sql server 2005 so that it can easily handle sale and purchase and it display exact inventory status of how much carton , medium, small box...

What will be best strategy for designing database for a magazine online?

Hello; I have design a magazine online and worry that is it the best approch or at least a good approch or no,the magazine contains articles+news in all subjects, i have one table for both articles+news ,but i would like to know that is this good or i must separate articles and news (it is clear that beside the main table there are seve...

.mdb - Access - database appending # on image file

I'm creating a website that interfaces with a .mdb database. I have a field that is using the data type "hyperlink" and pointing to a relative link for an image I want displayed. For some reason the link is appearing and not the image and there is a # that is being prepended and appended on each URL. I thought maybe the path was wrong ...

How to show that a database design is in 3rd Normal Form

How can I prove that my database schema actually is in 3rd normal form? ...

Asset Database Design issues

I'm setting up an asset tracking database. Assets vary among black berries, PCs, servers, monitors, speakers, keyboards, mice, chairs, desks, cubicals, cubical walls, printers, refrigerators, microwaves... the whole range of things. That range would be my Category table: create table AssetManagement.zCategory( zCategoryId int identit...

Problem with FluentNhbernate Mapping

Hi, I am new to all the OOP and ORM stuff, so i would appreciate your help... I have a Team Class: public class Team : IEntity<Team> { public virtual int ID { get; private set; } public virtual string Code{ get; private set; } public virtual TeamWorker TeamLeader { get; private set; } public virtual IEnumerable<TeamW...

SQL SUM() function field

I have a database which contains some numerical fields; now i want to create another field which displays the sum of one of these fields. How can I create that field? thanks ...

Choosing where to attach a foreign key between two tables?

I have a purchase order table and another table to contain the items within a particular purchase order for drugs. Example: PO_Table (POId, MainPharmacyID, SupplierID, PreparedBy) PO_Items_Table (POItemID, ...) I have two options of choosing which table to link to which and they seem both valid. i have done this a number of times and...