database

Many-to-many database design question

Say you have the following many-to-many table relation: user ----- id first_name last_name user_prefs ---------------- id preference_name user2user_prefs ------------- id user_id user_pref_id But say you have the user preference of "homepage" and need somewhere to store the actual homepage url. Where would that go? I can't put a va...

Simplest way to implement a database for a Song list type program (Using Visual C++)

Working on a school project, the program is supposed to read from a text file that has a record about a song in every line, fields separated by ";". Anyways I have no knowledge of databases, and I just want the quickest way to create a database from that text file, and also i will need to change some of the fields of the records once in...

cake php use of table relations

Whats the usage of creation relations like var $belongsTo = array( 'UserType' => array( 'className' => 'UserType', 'foreignKey' => 'user_type_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); //The Associations below have been created with al...

Matrices and databases

I went through the topic and found out this link quite useful and simple at the same time. http://stackoverflow.com/questions/2142566/storing-matrices-in-a-relational-database But can you please let me know if the way mentioned as A B C D E F G H I J K L [A B C D E F G H I J K L] is the best and simple or even reliable way of storing...

Security implications of session strings that are not stored in a server database?

This time I am going to be brief :-) Instead of issuing randomly generated session strings to a user and inserting them into database, mapping these to user identifiers, for subsequent lookup on every authentication, why not do the following, with the intention to avoid database access on every request and distribute the session store i...

Firebird Data Access Designer (DDEX) installation

hi i want to use firebird library , and i followed its instruction as below , but i get "The referenced component 'FirebirdSql.Data.Firebird' could not be found." error. instruction : Prerequisites Make sure that you have Visual Studio .NET 2005 Standard or higher edition. Express editions are not supported. Registry update Reme...

How to store python classes into a database with Django ?

Hi, I have two files: choices.py class SomeChoice: name = u"lorem" class AnotherChoice: name = u"ipsum" # etc... models.py from django.db import models import choices class SomeModel(models.Model): CHOICES = ( (1, choices.SomeChoice.name), (2, choices.AnotherChoice.name), # etc... ) so...

Can't get all values from mysql table

I have this table: option_values table: option_id (FK) value_id (PK) classified_id (FK) value example: option_id (FK) value_id (PK) classified_id (FK) value 1 1 22 'Petrol' 2 2 22 'Manual' 3 ...

iPhone: How to implement a Persian Calendar?

I'm in the process of making a Persian Calendar app for Persian users. I was wondering if I have to make a database to store all the days or is there an algorithm to generate the calendar? thanx ...

How to get english language word database?

I need a database of every single valid word in English. I checked the /usr/share/dict/words file, it contains less than 100k words. wikipedia says English has 475k words. Where do I get the complete list (American spelling)? Also, is there a single website that gives out words for other languages too? Including Asian and European? E...

What do I need to know about databases?

In general, I think I do alright when it comes to coding in programming languages, but I think I'm missing something huge when it comes to databases. I see job ads requesting knowledge of MySQL, MSSQL, Oracle, etc. but I'm at a loss to determine what the differences would be. You see, like so many new programmers, I tend to treat my da...

What is your favorite ORM for .NET?

Possible Duplicates: What ORM frameworks for .NET Do You Like Best? Which ORM for .net would you recommend? What is your favorite ORM for .NET? Which features/tools/facilities made it special for you? ...

Functional Programming better to manipulate lists of database data?

Hi, I'm watching some lecture's on Functional Programming and the main 'data structure' so to say, but there really isn't one in FP, is lists, so my question is: when one deals a lot with database's and 'lists' of data, then is Functional Programming not superior to OOP? ...

Django: Can the value of ForeignKey be None?

I have a model called SimplePage in which I have this line: category = models.ForeignKey('Category', related_name='items', blank=True, null=True) I assumed this will allow me to have SimplePage instances that do not have a Category. But for some reason, when I try to create a SimplePage in the Admin with ...

Delivering activity feed items in a moderately scalable way

The application I'm working on has an activity feed where each user can see their friends' activity (much like Facebook). I'm looking for a moderately scalable way to show a given users' activity stream on the fly. I say 'moderately' because I'm looking to do this with just a database (Postgresql) and maybe memcached. For instance, I wan...

How far can I take this database design?

I am interested in knowing the pros and cons of creating a custom system supported by a database like the one described below: It has 6 tables that support it. Entity: Lets say, anything "physical" that can exist and have detail stored against it (Hilton Hotel, Tony Taxi, One Bar) Entity Type: A grouping/type of entity (Bar, Hotel, Re...

Advanced SQL query. Top 12 from each category (MYSQL)

I have a MYSQL5 database and PHP 5. I need a query for a games websites index page that only selects the first 12 from each category of games. Here is what I have so far. $db->query("SELECT * FROM `games` WHERE status = 'game_published' AND `featured` = '1' ORDER BY `category`"); The php code then groups games of the same category ...

Java Application to show a lot of charts and stats, storing the data?

I'm working on a Java application, one of its functions is to show detailed information in graph form with the odd statistic and "top 10" list here and there. The data is being generated live by the application, consider it an internet "honeypot", data is the result of external attacks, the graphs will need to be of varying forms such a...

How do PHP/MySQL database queries work exactly?

I have used mysql a lot but I always wondered exactly how does it work - when I get a positive result, where is the data stored exactly? For example, I write like this: $sql = "SELECT * FROM TABLE"; $result = mysql_query($sql); while ($row = mysql_fetch_object($result)) { echo $row->column_name; } When a result is returned, I am as...

Django - two projects using same database?

Hi, I'm working on my honor society's website, and I'm wondering if (1.) can two websites (Django projects) point to the same database, and (2.) if that's good practice. Background info: Currently there's only one website, and the users for it are for only for members. For our industry relations part (which we are developing now), we w...