Questions tagged [relational-database]

A relational database is a database consisting of relation variables (which are also called *relvars*, *R-tables* or just *tables*). The definition, manipulation and integrity rules of relational databases are based on relational operations equivalent to or similar to the Relational Algebra and Calculus. Relational database principles are the basis of a substantial part of data management theory and practice.

A relational database is a database consisting of relation variables (which are also called relvars, R-tables or just tables). The definition, manipulation and integrity rules of relational databases are based on relational operations equivalent to or similar to the Relational Algebra and Calculus. Relational database principles are the basis of a substantial part of data management theory and practice.

Targeted Questions

This tag is appropriate for questions concerning the relational model, relational and relational database implementation.

The SQL language is commonly used to specify relational database-designs and to define and solve relational database problems. However, DBMSs based on SQL are by definition not s and therefore not all SQL questions are relevant to the relational database tag. Questions specific to or its implementations should be tagged accordingly.

6790 questions
9
votes
1 answer

BCNF Decomposition

I am trying to figure out the correct steps in performing a BCNF decomposition. I found this example, but I do not understand how to perform the correct steps. Schema = (A,B,C,D,E,F,G,H) FD's + {A -> CGH, AD->C, DE->F, G->G} Could someone show the…
Mike
  • 99
  • 1
  • 1
  • 3
9
votes
3 answers

Laravel one to one relationship without foreign key

I have two tables the posts table and the categories table. Each post has one category only. What I am trying to do Connect each post with one category ID without a foreign key. Why I am trying to do this Because I don't want to duplicate in…
user7431257
  • 141
  • 1
  • 2
  • 6
9
votes
2 answers

AttributeError: 'ManyToManyDescriptor' object has no attribute 'all' - django

I have a staff model which can be assigned to many other groups model I tried calling to get a response of what groups does this staff belong to but I keep on getting errors. Can someone please give me a hand? User model class Staff(Model): …
Dora
  • 6,776
  • 14
  • 51
  • 99
9
votes
4 answers

Indexing & alternatives for low-selectivity columns

What are the range of tactics available for selecting records on low selectivity columns? An example might be an orders table where, over many years, you build up a large number of completed orders but often need to select active orders. An order…
RedGrittyBrick
  • 3,827
  • 1
  • 30
  • 51
9
votes
10 answers

Database Design: replace a boolean column with a timestamp column?

Earlier I have created tables this way: create table workflow ( id number primary key, name varchar2(100 char) not null, is_finished number(1) default 0 not null, date_finished date ); Column is_finished indicates whether the…
Igor Mukhin
  • 15,014
  • 18
  • 52
  • 61
9
votes
7 answers

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,…
9
votes
1 answer

What is the idiomatic, performant way to resolve related objects?

How do you write query resolvers in GraphQL that perform well against a relational database? Using the example schema from this tutorial, let's say I have a simple database with users and stories. Users can author multiple stories but stories only…
ean5533
  • 8,884
  • 3
  • 40
  • 64
9
votes
7 answers

Are all modern RDBMS row oriented? Why?

If one of relational databases paradigms is to be tuple oriented we have the biggest limitation here. If one could design column oriented db, that would improve performance a lot. Vector operations would perform out of the box, indexing, hashing for…
bua
  • 4,761
  • 1
  • 26
  • 32
9
votes
3 answers

Get last message from each conversation

I know similar questions had been asked before, but none of them had this same conditions and their answers didn't work for this case. The table containing the messages looks like this: id | owner_id | recipient_id | content | created 1 | …
Camilo
  • 6,504
  • 4
  • 39
  • 60
9
votes
2 answers

Set Timeout for All Select queries in MySQL running on RDS

I want to set a timeout for all the select queries hitting on MySQL Server. So that if the read query is taking a long time then i can throw a timeout exception. I know this feature is provided in MySQL 5.7 by: SET GLOBAL…
vjangra
  • 173
  • 1
  • 5
  • 14
9
votes
2 answers

Rails: violates foreign key constraint

I have three models: Book, genre, BookGenre, and here are relationships: class BookGenre < ActiveRecord::Base belongs_to :book belongs_to :genre end class Book < ActiveRecord::Base has_many :book_genres has_many :genres, through:…
rj487
  • 4,476
  • 6
  • 47
  • 88
9
votes
2 answers

what is the better way to index data from Oracle/relational tables into elastic search?

What are the options to index large data from Oracle DB to elastic search cluster? Requirement is to index 300Million records one time into multiple indexes and also incremental updates having around approximate 1 Million changes every day. I have…
user4362590
9
votes
4 answers

Database that consumes less disk space

I'm looking at solutions to store a massive quantity of information consuming the less possible disk space. The information structure is very simple and the queries will also be very simple. I've looked at solutions like Apache Cassandra and…
Hugo Palma
  • 3,376
  • 3
  • 21
  • 22
9
votes
8 answers

What kind of normalization rule does this violate?

Suppose I have two tables on a database, T10 and T11, having 10 and 11 columns, respectively, where 10 of the columns are exactly the same on both. What (if any) normalization rule am I violating?
9
votes
2 answers

Entity Framework - Updating relationship by changing foreign key

I have the two following models and DbContext: public class TestDbContext : DbContext { public IDbSet People { get; set; } public IDbSet Cars { get; set; } } public class Person { public…