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
11
votes
4 answers

Hierarchical Data - Nested Set Model: MySql

I am just learning how to implement the Nested Set Model but still have confusion with a certain aspect of it involving items that may be part of multiple categories. Given the example below that was pulled from HERE and mirrors many other examples…
11
votes
3 answers

Does GraphQL negate the need for Graph Databases

Most of the reasons for using a graph database seem to be that relational databases are slow when making graph like queries. However, if I am using GraphQL with a data loader, all my queries are flattened and combined using the data loader, so you…
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
11
votes
2 answers

Data Modeling: Logical Modeling Exercise

In trying to learn the art of data storage I have been trying to take in as much solid information as possible. PerformanceDBA posted some really helpful tutorials/examples in the following posts among others: is my data normalized? and Relational…
11
votes
5 answers

Database schema which can support specialized properties

I need to store a set of entities, of which there are several specialized versions. They have some common properties, but the specialized ones contain properties specific for that entity. Solutions The data store is a relational DBMS, and this is…
Anders
  • 856
  • 1
  • 7
  • 14
11
votes
3 answers

How do I model (GitHub-like) permissions relationally?

tl;dr: how do i implement a permissions model like (e.g.) github's Updated to try to address some of @philipxy's comments: I am planning to implement a permissions model similar to github's: users users can be in groups users can be in…
11
votes
1 answer

Why is Core Data so difficult to prepopulate?

This is a more a philosophical question about Apple's design decisions than a question about Core Data. Why in the world is it useful to have a model system that is so difficult to prepopulate? What are the advantages? I know you can have your…
Evan Cordell
  • 4,108
  • 2
  • 31
  • 47
11
votes
4 answers

best way to store 1:1 user relationships in relational database

What is the best way to store user relationships, e.g. friendships, that must be bidirectional (you're my friend, thus I'm your friend) in a rel. database, e.g. MYSql? I can think of two ways: Everytime a user friends another user, I'd add two…
Aaron Yodaiken
  • 19,163
  • 32
  • 103
  • 184
11
votes
2 answers

Does Google BigQuery/ Amazon Redshift use column-based relational database or NoSQL database?

I'm still not very clear about the difference between a column-based relational database vs. column-based NoSQL database. Google BigQuery enables SQL-like query so how can it be NoSQL? Column-based relational database I know of are InfoBright,…
ericn
  • 12,476
  • 16
  • 84
  • 127
11
votes
4 answers

Difference between super key and composite key

I need to understand the difference between super key and composite key. The examples I found made more confused. Can you please simply clarify what is the difference? Thanks
Bob
  • 564
  • 2
  • 10
  • 25
11
votes
2 answers

How to get foreign key values with getattr from models

I have a model Project and i am getting the attributes of that with the following instr attr = getattr(project, 'id', None) project is the instance, id is the field and None is the default return type. My question is: what if I want to get the…
A.J.
  • 8,557
  • 11
  • 61
  • 89
11
votes
3 answers

Database design - Multiple "Contact information" for different tables

I have a database with tables "person", "company", "shop", etc. Many of these tables must have "contact information". The possibility to design this was asked in Database design - Similar Contact Information for multiple entities Now, in my database…
nb.ag
  • 137
  • 1
  • 1
  • 9
11
votes
1 answer

SQL two tables and creating a link table

I have two tables: Employee (ID, Name, Address) and Store(ID,Address) and I would like to record information about people who work in each store. I thought of making a new table called Employee_List table. My questions: 1- Employee_List and Employee…
hamid
  • 2,033
  • 4
  • 22
  • 42
11
votes
6 answers

Difference between END transaction and COMMIT transaction

I am trying to simulate a database recovery subsystem using java. However, I have the following questions. Whenever begin transaction is issued, is it always necessary that there should be an end transaction? (Like the below example) b1 --- Begin…
Ramesh
  • 765
  • 7
  • 24
  • 52
11
votes
3 answers

Relational database design multiple user types

I have a 4 types of users and each have specific data, but they also share commun data, like username, password .. My first thought is to create a main users table with user_type column. Then when querying user data i can just first select their…
silkAdmin
  • 4,640
  • 10
  • 52
  • 83
11
votes
6 answers

Mysql join query on three tables with multiple columns

I have three tables like this: Specialisation sid | s_name -------------- 1 | test 1 2 | test 2 Person pid | name | sid ------------------ 1 | ABC | 1 2 | XYZ | 2 Timing tid | time_from | time_to |…
Murtaza Malek
  • 303
  • 2
  • 3
  • 11