database-design

MySQL datetime index is not working

Table structure: +-------------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | total | int(11) | YES | | NULL | ...

Cascading Choices in FileMaker 11 Pro Advance

Working with cascading choices in the new(er) FMP seems to be a little weird. My intention is to create a bunch of drop-down lists / pop ups that rely on the previous choice. If a user clicks on a Customer drop-down, the next drop-down (address field) will ONLY have related data for that customer street address. Once you click the cert...

Nested Model Forms in Rails For a "Quiz"

Hi, I am trying to build a quiz of sorts. I would like my form to be able to build one question with 4 or more answers. 4 answers are inputted by default with the ability to add more answers dynamically with javascript. I have modeled it off the code in Ryan Bate's railscasts "Nested Model Forms". My dilemma comes with setting the ...

All Candidate keys are Superkeys whereas all Superkeys are not Candidate keys. Why?

Possible Duplicates: What's the point of a candidate key? Superkey vs. Candidate key Thanks in advance. ...

Database constraint to check against specific constraints dependent on an input value?

I'm running maintenance on a database program with no foreign key constraints, even though it really should have... There is a Logging table which has a ParentID column, and a ParentType column. The entry in the ParentType column determines which table ParentID references. What I'm looking for is for ideas on the best way to add this i...

MySQL storing view data over time, how to reference

Tables: videoID (vidID, vidName, vidURL) etc. viewCount (vidID, views, timestamp) The main goal of this database is to calculate the slope between the most recent view and the previous one. Lets say I automatically store the view data in the database once everyday. This means all the view data for all videos is in one big table call...

Users table - one table or two ?

i wanna have a Users details stored in the database.. with columns like firstname, last name, username, password, email, cellphone number, activation codes, gender, birthday, occupation, and a few other more. is it good to store all of these on the same table or should i split it between two users and profile ? ...

How to mapping that tables using NHibernate (Fluent or XML)

Hello guys... Can you help-me with that database : I´m using Fluent NHibernate, but XML helps too... My problem is with ProductPrice table... Thanks Paul ...

2 XML Imports - Database design

SQL Server 2008. Morning, If someone could offer their advice it would be very much appreciated. Currently I’m looking to import two XML files, Donation amount and Donation Maker. The Donation Amount file would comprise of an Amount field and a DonationMakerID, and the Donation Maker file would comprise of a Name field and Donation...

Database design question

I have a table DEFINITIONS where I store my xml definitions form my components (form,layout,grid...) Then I have detail table PROFILES (1:M relationship) where I store my user profiles if there are any. This user profiles are only allowed if a component is of type grid. So far I've created just table DEFINITIONS and a table PROFILES in...

A Good Database Design for E-Mail or Private Message

Hi, everyone. For now, I'm working with message system for my site. The message is used to send messages between member of the site. It can also be used to send a friendship invitation, etc. However, I haven't found a good database design for it. I want the message system to use a thread style, just like e-mail. But since I'm not an exp...

Database performance: filtering on column vs. seperate table

I was wondering what the best approach would be for the following situation: I have an Orders table in a database that obviously contains all orders. But these are literally ALL orders, so including the complete/finished ones that are just flagged as 'complete'. From all the open orders I want to calculate some stuff (like open amount, ...

Insert 100k rows in database from website

Hi all, I have a website where the user can upload an excel spreadsheet to load data in a table. There can be a few 100k rows in the excel spreadsheet. When he uploads the file the website needs to insert an equal amount of rows in a database table. What strategy should i take to do this? I was thinking of displaying a "Please wait pa...

How should I structure my MySQL database?

Hi all! First of all, sorry if this might be a stupid question. I'm very new to the world of MySQL, so... Anyway, my question is this: I'm planning on having a database that deals with (for now) two types of users, let's say Admins and Users. My aim is to have ONE table containing all users, aptly named "users". Below is a rough outlin...

How much do you let Sitecore (or other CMSs) manage?

I have been wondering how much content you should typically allow a CMS to manage, in particular reference to user-generated content. I am thinking specifically of Sitecore, since I have an upcoming project that will be written with it, but this could apply to any CMS really. Say you had a typical e-commerce site, with products for sale...

Aggregates on large databases: best platform?

Hello, I have a postgres database with several million rows, which drives a web app. The data is static: users don't write to it. I would like to be able to offer users query-able aggregates (e.g. the sum of all rows with a certain foreign key value), but the size of the database now means it takes 10-15 minutes to calculate such agg...

Many-to-many relations in database design

Hi Everyone. I'm building a database that makes use of lots of many-to-many relations. For example, I have part items and machine items where each part goes into many machines and each machine has many parts. The purpose of this database is to be able to input a list of parts and get back a list of machines composed of only parts in t...

Suggestions for my database design (Networking Users on the website)

Imagine a scenario where - All the users on the website can be affiliated to each other, i.e. something like be "friends" with each other and all. The Database i want to design should be able to handle connections like these - Suppose A is a friend of B (also implies B is a friend of A) wants to connect with D who is a friend of C who is...

Twitter-like app using MongoDB

I'm making an app that uses the classic "follow" mechanism (the one used by Twitter and a lot of other apps around the web). I'm using MongoDB. My system has a difference, though: an user can follow groups of users. That means that if you follow a group, you'll automatically follow all the users who are members of that group. Of course ...

Email cache database design

Hello! Can you advice how to store email MessagePart hierarchy into database (SQLite)? Parts can be of different MIME type (text, image, etc). Also they can be multipart. The only way I see is to store all parts in single MessageParts table with content_bytes field and mime_type field + parent_id for multipart Is it ok? Is there some...