relational-database

What's needed to develop a database in the cloud?

What is needed (in general terms) to create a service like MongoHQ or SimpleDB? Thank you ...

How to model a database where one page can have different content types?

I have the database table page with the fields contenttype_id and content_id. I want to link a page to a contenttype via contenttype_id and refer to an actual content via content_id. The problem is contents depend on the contenttype_id and are modelled differently, therefore the content_id refers to different tables depending on the cont...

Storing inherited objects in a database

I'm trying to figure out the best way to map inheritance relationships in an object model into a relational database. For example consider the following class structure. public Class Item { public String Name{get; set;} public int Size {get; set} } public Class Widget:Item { public String Color{get; set;} } public Cla...

What would be the relational way to store a tournament bracket in MySQL?

Right now I have a table for matches where each match has a reference to 2 competing participants and a winner, but there isn't a way to store the order of the rounds. ...

Appropriate way to structure a database table? (empty columns vs. multiple tables)

Let's say we have a object called a Widget, for which we can construct a database table. Now, let's say we have two sets of additional detail to describe widgets. Each set of data is available at a separate time. So, let's say our widgets have three phases to their life-cycle... In phase 1, we simply have a widget with a name and a des...

When should I use an object database?

I have been using relational databases for some time now and recently came across a different type of database: object database. One of the products built around this idea had a description: A scalable, "post-relational" database with a multidimensional data and application server for distributed web applications. This makes me wonder,...

database design pattern: many to many relationship across tables?

I have the following tables: Section and Content And I want to relate them. My current approach is the following table: In which I would store Section to Section Section to Content Content to Section Content to Content Now, while I clearly can do that by adding a pair of fields that indicate whether the source is a section or...

Eloquera object database

Hello I saw Eloquera db and was quite impressed with it. Currently I'm thinking developing my next project on Eloquera and not Sql Server. So I have several questions with it. 1) How does Eloquera performs in enterprise and heavy loads? 2) How does it compare with other open source and commercial RDBMSes (I mean performance)? 3) Is it s...

What makes this database's cascading deletes cyclical?

Vendor (PK) - Id Name Stand (PK) - Id VendorId - fk - cascaded delete if Vendor is deleted) Name Item (PK) - Id VendorId - (fk - cascaded delete if Vendor is deleted) Name Price UnavailableItem (PK) - ItemId - (fk - cascaded delete if Item is deleted) (PK) - StandId - (fk - cascaded delete if Stand is deleted) The database above repr...

Adding foreign key constraints in archive tables

Say I have these tables and Oldbookings is an archive table containing rows from Bookings made a year ago. Also, assuming that such constraints were already defined in Bookings: FOREIGN KEY (cusNo) REFERENCES Customers(cusNo) FOREIGN KEY (flightNo) REFERENCES Flights(flightNo) Would it make sense to define these contraints (foreign ke...

How do I design a Localised Content table that can join to a number of different tables (the relationship needs to be generic...)

I know that this isn't exactly normalised, but bringing all of the localised data throughout my application into just a few tables will help me out a lot. I have to be able to link some generic table to a LocalisedContent table which will contain different rows for each of the localised key-value pairs of the generic table joined to it....

Relation Table Optimization SuperKey

I have an idea of how to fix this but I was wondering what the best way to go about this. So one Question can have multiple Answers Question and Answers can have points A user is only allowed to give points per question/answer Question: id title Answer: id question_id response Points: id user_id question_id answer_i...

How to create a Database for listing Buffet system of Restaurants ?

Restaurants have buffets. and Buffets have different spreads. i wanna enable photo and comments on each dish on the Buffet. not sure which is the best way to store them in Database What i have done ? I have a Restaurant Db that stores the general information of the REst. Dishes DB that stores Dishes of the Resturants. each dish is aga...

Help on designing a database for a school management system

Hello I'm about to create a school management system where it should assure the relashionship between teachers, courses, classes, parents, students, report card, enrollment, administration, attendence ... Some good ideas on the DB structure and the system will be appreciated. ...

Dynamic Tables?

Hello, I have a database that has different grades per course (i.e. three homeworks for Course 1, two homeworks for Course 2, ... ,Course N with M homeworks). How should I handle this as far as database design goes? CourseID HW1 HW2 HW3 1 100 99 100 2 100 75 NULL EDIT I guess I need to rephrase my question. As of r...

How do I help a person who wants relational database data in a CSV format?

The non-technical person who asks, "Can you just put the database in an Excel spreadsheet for me?" is so common it's almost a trope. (I could've sworn there was an xkcd about this, but I can't find it.) We regularly get customers asking for all their data in a CSV. To say this person is non-technical is redundant, so I need to explain t...

Efficient way to manage the relations between two database tables on the front-end using checkboxes ?

Quick background info: of the three database tables that are relevant for this question, one holds devices info (d.id, d.name), the second one holds accessories for the devices in the first table (a.id, a.name) and the third table handles relations between the first two (d.id, a.id). By selecting one of the available devices from a drop...

How to handle 'extending' tables

I'm designing an application involving "pages", which have many "blocks", of which there are several types of blocks. I'm struggling to find a good way to hold this data in the database however. I'd imagine there is a popular way of doing this, here are two I am considering: Approach One Pages table id user created, updated etc. Blo...

count number of tuples without COUNT. Is it possible?

Hi, I would like to know if there is any way of counting the number of tuples in a table without actually using the COUNT function? A B C XXXX YYYY IIII XXXX SSSS PPPP RRRR TTTT FFFF KKKK AAAA BBBB If I would like to know how many times XXXX has appeared with...

How to model a custom type in a relational database?

I'm fairly new to database design, but I understand the fundamentals. I'm creating a relational database and I'd like to do something similar to creating a reusable type or class. For example, let's say I have a Customer table and a Item table. Customer and Item are related by a standard 1-to-many relationship, so Item has a column calle...