Questions tagged [relational]

526 questions
2
votes
2 answers

Creating relational matrices with R

My dataframe consists of projects with the different individuals that took part in it, as well as the year in which projects were carried out. How can I create, for each year, a nxn relational matrix (n being the number of individuals) that counts…
goclem
  • 904
  • 1
  • 10
  • 21
2
votes
1 answer

MySQL: Why is my index length 0.0 bytes?

I have a simple table containing 4 columns. Column A (int), Column B (int), Column C (int), Column D (int) I have constructed an index on (Column B, Column A, Column C), which works well performance wise. My table contains 5 million rows, and using…
Jimmie Berg
  • 2,212
  • 1
  • 13
  • 7
2
votes
2 answers

Real world MySQL/Postgres database schema examples and analysis tools

I am doing analysis on schema evolution and have really fallen short of real world database schemas that have evolved a bit and stored in version control. Mediawiki (http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/maintenance/tables.sql)…
Venkatesh Mandalapa
2
votes
1 answer

index 'enabled' fields good idea?

Content of a website is stored in a MySQL database. 99% of the content will be enabled, but some (users, posts etc.) will be disabled. Most of the queries end as WHERE (...) AND enabled Is it a good idea to create an index on the field 'enabled'?
sibidiba
  • 6,270
  • 7
  • 40
  • 50
2
votes
1 answer

Dynamic Query on Relational tables

This is my code: $query = Book::query(); if (isset($input['alphabet'])) $query->where('name', 'LIKE', $input['alphabet'] . '%'); if (isset($input['status'])) $query->where('status', $input['status']); if (isset($input['genre'])) …
Joshua Hansen
  • 405
  • 1
  • 8
  • 21
2
votes
2 answers

How can I copy a SQL record which has related records in other tables to the same database?

I created a function in C# which allows me to copy a record and its related children to a new record and new related children in the same database. (This is for an application that allows the use of previous work as a template for new…
DerekVS
  • 23
  • 4
2
votes
1 answer

Using a set to store a custom class, only the first insert works

Base question Please read this question, even if you don't have time to look at all the other details. :) - I need to store multiple objects of my custom class (Tuple) into a set. That class contains only a vector of string. (As required by the…
M_J
  • 316
  • 5
  • 20
2
votes
1 answer

Trying to understand Tuple Relational Calculus

In what situations would you use domain relational calculus over tuple relational calculus? For example this problem I solved using tuple relational: List the co-authors of John Smith (authors who co-authored an article with John Smith) with these…
AvLerner
  • 27
  • 4
2
votes
1 answer

JSON in relational format?

Does it make sense to serialize JSON in relational format? E.g. suppose I have a many-to-many between Order and OrderItem, with many items being shared between orders. Then in the JSON I could put just the OrderItem id's in the Order object, then…
James McCabe
  • 1,879
  • 2
  • 15
  • 22
2
votes
2 answers

Exclude rows with Doctrine ORM DQL (NOT IN)

I'm building a chat application with codeigniter and doctrine. Tables: - User - User_roles - User_available Relations: ONE user have MANY roles. ONE user_available have ONE user. Users available for chatting will be in the user_available…
gust1n
  • 133
  • 2
  • 7
2
votes
2 answers

Implementation of object-oriented analysis patterns in a relational database

I have recently started reading Martin Fowler's "Analysis Patterns" in an attempt to improve my data modelling skills and I find the book really interesting and enlightening as far as object-oriented approaches are concerned. However, although I…
2
votes
1 answer

Design question for highly extensible project - Bearing in mind best practises

Development environment is C# 3.5 with a SQL Server 2008 database and Entity Framework. Imagine you have a class and a table called Sign which represents a physical electronic sign created by a third party which your software needs to control. You…
andrej351
  • 904
  • 3
  • 18
  • 38
2
votes
1 answer

Hierarchical Relational Database Design in MySQL

I'm fairly new to SQL and MySQL. I am designing a relational database within MySQL to store the contact information for various people that I meet at networking events. I would like to make the database as normalized as possible but I am running…
2
votes
2 answers

What will be the best way to keep track of modified tuples in a database?

I am currently working on a project in which I have to keep track of the tuples that are modified in a relational database. This should include updated tuples, but also inserted and deleted tuples. My question is what will be the best way to…
Jan-Henk
  • 4,864
  • 1
  • 24
  • 38
2
votes
2 answers

How to store complex product/order data in MySQL?

I'm working on an order system for my online shop. I have 2 tables: products, storing info about products orders, storing general id's & infos of customer orders. Now I want to have a way to store complex customer orders in the database. I need…
user3066521