database-design

how to generate dbml file from Sybase database?

I think we may have trouble with our existing project. For some reasons we have to switch from SQL Server to Sybase SQL Anywhere 11. now we trying to find a way continue use our existing LINQ code. We wish we can still use L2S? If cannot, we wish we can use L2E, then we have to change to ADO. how to generate dbml file from Sybase Anyw...

Any simple approaches for managing customer data change requests for global reference files?

For the first time, I am developing in an environment in which there is a central repository for a number of different industry standard reference data tables and many different customers who need to select records from these industry standard reference data tables to fill in foreign key information for their customer specific records. ...

How to record different authentication types (username / password vs token based) in audit log

I have two types of users for my system, normal human users with a username / password, and delegation authorized accounts through OAuth (i.e. using a token identifier). The information that is stored for each is quite different, and are managed by different subsytems. They do however interact with the same tables / data within the syste...

Anything similar to Hibernate in PHP?

I am a Java programmer and was working on a project using Hibernate and Struts for some time. Now For my new project, I am working on PHP and Mysql (learning PHP). Is there any technology which is similar to Hibernate for PHP? If yes, can anyone give me the link where I can understand and use it? Is there a POJO concept in PHP? ...

Style guide for database metadata naming

We want to establish some database metadata naming rules in our new project. For example: tables are named as nouns in a plural form (courses, books, lessons) if present, an adjective goes before a noun in a table name and is separated by an underscore (red_books, new_lessons) table index column is always named id foreign key names are...

3rd party data - Store in Data Warehouse or Primary database?

This is mostly a data warehouse philosophy question. My project involves an Oracle forms application, and a Teradata Data Warehouse for reporting and ad-hoc purposes. In addition to the primary data created by the users of our application, we also require data from various other sources. Currently, this 3rd party data comes via FTPd fla...

mySQL and general database normalization question

I have question about normalization. Suppose I have an applications dealing with songs. First I thought about doing like this: Songs Table: id | song_title | album_id | publisher_id | artist_id Albums Table: id | album_title | etc... Publishers Table: id | publisher_name | etc... Artists Tale: id | artist_name | etc... Then as I t...

Sets of sets of sets? Or, implementing versioning for sets of sets.

I'm working on a web app for a quality control checklist. I already have a table set up, but I have a hunch that our model is sub-optimal and I could get some better performance. Please not that I'm using mysql, so I'm limited to its capabilities. Each checklist has dozens, sometimes hundreds of questions. Each question has between 2 an...

SQLAlchemy unsupported type error - and table design issues?

Hi there, back again with some more SQLAlchemy shenanigans. Let me step through this. My table is now set up as so: engine = create_engine('sqlite:///:memory:', echo=False) metadata = MetaData() students_table = Table('studs', metadata, Column('sid', Integer, primary_key=True), Column('name', String), Column('preferences...

Database design for very large amount of data

Hi, I am working on a project, involving large amount of data from the delicious website.The data available is at files are "Date,UserId,Url,Tags" (for each bookmark). I normalized my database to a 3NF, and because of the nature of the queries that we wanted to use In combination I came down to 6 tables....The design looks fine, however,...

Ternary (and n-ary) relationships in Hibernate

Q 1) How can we model a ternary relationship using Hibernate? For example, how can we model the ternary relationship presented here using Hibernate (or JPA)? NOTE: I know that JPA 2 has added some constructs for building ternary relationships using maps. However, this question assumes JPA 1 or Hibernate 3.3.x and I don't like to use map...

django models : How to have variable number of foreign keys in a model ?

For instance, Model Resume contains variable number of Model Project 's, What should be my models and relationships between them to achieve this ? Thanks in advance. ...

How would be data stored at database in case of social networking site?

In social networking site, a person has friends/followers. There is a chain of relation. How would be data stored at database in this scenario? This is a very huge information, still result of a query comes back very fast on these sites. Is it possible that someone explain the relations between various entities? What does make the searc...

delete where id in list

if i have a list of Ids (1, 4,6,7) and a db table that i want to delete all records where id is in this list, what is the fastest way of doing this? ...

should this database table be normalized?

i have taken over a database that stores fitness information and we were having a debate about a certain table and whether it should stay as one table or get broken up into three tables. Today, there is one table called: workouts that has the following fields id, exercise_id, reps, weight, date, person_id So if i did 2 sets of 3 diffe...

Does introducing foreign keys to MySQL reduce performance

I'm building Ruby on Rails 2.3.5 app. By default, Ruby on Rails doesn't provide foreign key contraints so I have to do it manually. I was wondering if introducing foreign keys reduces query performance on the database side enough to make it not worth doing. Performance in this case is my first priority as I can check for data consistency...

Database table relationships: Always also relate to specified value (Linq to SQL in .NET Framework)

I really can not describe my question better in the title. If anyone has suggestions: Please tell! I use the Linq to SQL framework in .NET. I ran into something which could be easily solved if the framework supported this, it would be a lot of extra coding otherwise: I have a n to n relation with a helper table in between. Those tables...

What is the most elegant C# .NET Data Access Layer design?

I would like to konw what is considered the most elegant C# .NET method to produce a Data Access Layer? I am using MyGeneration DooDads. Is this an elegant solution? Is it still acceptable to use the CRUD Stored Procedures + DAL Library for data access with .NET Entity Framework and NHibernate ORM tools? ...

For databases, does choosing the correct data type affect performance?

And if so, why? I mean, is a tinyint faster to search than int? If so, what are the practical differences in performance? ...

How to simplify the following tables and optimize?

Hi Now i have a table with the following fields id country hdate religions season description link rate and i store the data within this table , my sample data will be 1 Afghanistan 2008-01-19 Islamic Winter Ashura ashura 2 2 Afghanistan 2008-03-20 Islamic Winter Mouloud (Birth of the Prophet) mouloud 4 ...