relational-database

Splitting mysql database per client

I am working on a database that is relatively small. It has a total of 67 tables, with a little over a million records. It is about 254 MB. The application that works with it has been running for about 5 years and the amount of usage has doubled each year. This year we are projected to triple which will just almost double the database in...

how much data can a 5MB SQL database store?

Hi, I'm interested in using Heroku for my project. I'm not interested in paying for it at the moment but the free plan only offers a 5MB database. Is there any measure I can use to know how many columns/rows of simple text data can be stored in a 5MB database? Thanks ...

MySQL: Query all records that have a given set of relations to another table

Yeah, kinda dumb title, but I found it hard to describe my problem. I have the following tables: properties id | name 1 | color 2 | material options id | property_id | name 1 | 1 | yellow 2 | 1 | blue 3 | 2 | wood 4 | 2 | stone substances id | name 1 | orange juice 2 | cheese rela...

What are the common issues surrounding storage of XML data in a relational databases?

In relation to a discussion started at this question, I've decided to put this up as a community wiki question. The root of the question is, therefore, is it appropriate to store XML data in a relational database? Are there generally better ways to implement the same goal? What database engines provide good support for XML data types (s...

Relational DB Concept

I am trying to lay out the concept for a Relational DB and I ran into some conceptual Problems: If I have multiple discrete Entities that are "nested" in each other/have a hierarchy e.g.: Bosses can have multiple Employees. These employees have different Projects they do and One Project has again multiple sections. So B1-Bn: ...

changing left join to basic join

Hi there, I currently have some SQL that should return 3 rows of data but returns 6 (3 rows repeated twice). I believe this is down to my syntax and want to try and build the query using basic joins, currently the SQL looks like this, `function getMultiContentById($id) { $query = "SELECT FROM `mailers` LEFT JOIN `mailer_co...

Does this exists as a cloud service?

Database Redis Casandra MySQL (RDS, while nice, isn't quite agile enough) (other besides RDS) PostgreSQL Queueing RabbitMQ Beanstalkd Gearman Full text search Thinking Sphinx ...

getting data from 3 tables via a recurring id

I have a database with 3 tables in this structure, CREATE TABLE `mailers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mailer_title` varchar(150) NOT NULL, `mailer_header` varchar(60) NOT NULL, `mailer_type` enum('single','multi') NOT NULL, `introduction` varchar(80) NOT NULL, `status` enum('live','dead','draft') NOT NULL, ...

Could you grade my relational algebra answers?

I have a Databases exam tomorrow and I have been running over some past papers to check whether my relational algebra knowledge is up to a decent standard or not. If it isn't I'm going to stop working on it now and focus on other possible question types (DDL, Normalization) that may also arise. If it needs just a little bit of work the...

Database design too repetitive?

I'm working on a database schema that's driving me a little mad at the moment because I seem to be repeating the same tables to reproduce behaviour for different types. Basically the system consists of live sensors that are monitored over a network, and loggers that are collected via a handset. The sensors and loggers are divided up in...

How does a bitmap index work?

Is there anyone can help me to get the logical represntation of a bitmap index and reverse key index? ...

Referential Data Integrity: Necessity, nice-to-have, or old hat?

Frameworks like Rails have encouraged moving a lot of the logic, even stuff like constraints and foreign keys, off the database - in my opinion. for the better, as it's more manageable and easy to change. Even so, some operations are easier faster, or just plain only possible in SQL. The recent explosion in popularity of noSQL databa...

Database design - Similar Contact Information for multiple entities

Hello. I realise that the answer to these types of questions are often "it depends" but still I wondering what the general consensus might be. I am dealing with multiple entities such as Company Charity Auditor Stocktaker etc etc... Which all have contact information such as e-mail, telephone and address. The two design metho...

Is an extent used to add new data?

Is an extent used to add new data?what is segment and how is it releted to an extent? ...

On the relationship of database tables to a pivot/junction table

In a database, one may create a many-to-many relationship between tables by creating a third table which maps the two together using foreign keys. What is the relationship between the third table and the two original tables? For example, if table A and table B have a many-to-many relationship and table AB is the pivot table, is the A->...

What are the pros and cons of the following database design?

I am looking to for suggestions and commments about the following design. All the tables are expected to be large tables (millions of records) and are updated and queried often and any kind of update is allowed (update, insert, delete). -- product create table Product( productID int not null identity(1,1), name varchar(100) not null, ...

In RDBMS, when a relation is one-to-one, does it help if both records point to each other, or is one pointing already enough (no need both pointing)?

I was reading a book and it talks about a User has some more UserDetail, and so the UserDetail will have a user_id pointing back to the Users table. I kind of forgot that, does it help at all to has a field in Users table to have a user_detail_id to point at the UserDetail record? This is so in Ruby on Rails too, that the Users table d...

What will be the candidate key and why? Please refer question

Consider a relation R(ABCDEG) The functional dependencies are given below: AB->C AC->B AD->E B->D C->A E->G Determine the candidate key(s) for the relation R. Options: A. AB, AC and C B. AB and AC C. AB and C D. C only ...

mysql query help, getting values from table using relational id's from another table

THE SQL THAT BUILDS THE TABLES, -- -- Table structure for table `careers` -- CREATE TABLE IF NOT EXISTS `careers` ( `career_id` int(11) NOT NULL auto_increment, `career_name` varchar(75) NOT NULL, `career_desc` text NOT NULL, `degree_needed` enum('Yes','No') NOT NULL, `useful_info` text, `useful_links` text, PRIMARY K...

SQL query help, conditional join

Hi guys, SQL newbie here :) Here are my tables if anyone's interested. AHH, cant post image yet http://img832.imageshack.us/img832/442/72098588.jpg What I'm trying to do is query the tblPatientStats table within a date interval (@StartDate, @EndDate) and group them accordingly in a data grid on winforms. So each row in tblPatientSta...