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

Soft Delete vs. DB Archive

Suggested Reading Similar: Are soft deletes a good idea? Good Article: http://weblogs.asp.net/fbouma/archive/2009/02/19/soft-deletes-are-bad-m-kay.aspx How I ended up here I strongly belive that when making software, anything done up front to…
Travis J
  • 81,153
  • 41
  • 202
  • 273
9
votes
8 answers

How to implement uniqueness where the order of the fields does not matter

I think the following example will explain the situation best. Let's say we have the following table structure: ------------------------------------- Member1 int NOT NULL (FK)(PK) Member2 int NOT NULL…
9
votes
3 answers

What's the best way to store/query multiple types within a RavenDB collection?

I am designing a logging system that will store its log entries in RavenDB, and for this particular system I want to store (and later query) documents that have varying data structures based on the type of event being logged. Consider the following…
Mike
  • 7,500
  • 8
  • 44
  • 62
9
votes
3 answers

How binary search is used in database indexing

I know how binary search works but I wanted to know practical uses for binary search... I searched through the internet and I found that the main use is data base indexing, but I couldn't understand how binary search could help in data base…
9
votes
3 answers

MySQL Double Entry Accounting System Database Design?

i am going to create a database for double-entry accounting system in MySQL. i recently read the article: http://homepages.tcp.co.uk/~m-wigley/gc_wp_ded.html i found in this article that it would be convenient to have three tables ACCOUNT, JOURNAL…
user617447
9
votes
2 answers

Why would I want to use a non-relational database?

The latest craze in databases seems to be centered around non-relational databases. Why? It seems kind of counterproductive. For example, it makes much more sense to me to express my data in a relational way (example code in Django + SQL for…
Naftuli Kay
  • 87,710
  • 93
  • 269
  • 411
9
votes
8 answers

SQLServer - How to find dependent tables on my table?

Using SQLServer : I have a table user : id name email There are some other tables (about 200 more tables), some of which use user.id as foreign key on cascade delete. So, I want to find out - Which tables use this foreign key (user.id) ? I am…
Yugal Jindle
  • 44,057
  • 43
  • 129
  • 197
9
votes
1 answer

MySQL relational tables and Primary Keys data types

I'm working on building a MySQL database that will have many related tables. I know I can create a primary key that is unique and auto increments, then reference that Primary Key as a Foreign Key in the related table. My question is what are best…
ItsPronounced
  • 5,475
  • 13
  • 47
  • 86
9
votes
2 answers

Tracking User activity log - SQL vs NoSQL?

I have a mysql database containing tables like User, playlist, videos, tags. Based on this I would like to collect the user activity on the application. the example use cases may be : a.) (user) joined (app) on (date) b.) (user) created…
daydreamer
  • 87,243
  • 191
  • 450
  • 722
9
votes
6 answers

Relational Database schema design for metric storage

Considering a system that has the following characteristics: Stores time series data/metrics collected from multiple sensors/inputs. Data points (metrics) are collected from many different systems at different times. Each of these metrics is…
Sam Shiles
  • 10,529
  • 9
  • 60
  • 72
9
votes
4 answers

Is it possible to transform an class diagram to an relational database diagram?

I have created an class diagram of my application, I wonder if it's possible to create an relational database diagram based on the class diagram. If it's possible, can it also be done the other way arround?
onepseudoxy
  • 580
  • 2
  • 8
  • 24
9
votes
3 answers

has_many :through multiple has_one relationships?

I'm writing a mentorship program for our church in rails (im still farily new to rails).. And i need to model this.. contact has_one :father, :class_name => "Contact" has_one :mother, :class_name => "Contact" has_many :children, :class_name =>…
9
votes
2 answers

How to Implement Referential Integrity in Subtypes

I have the following tables in a relational database: [Sensor] LocationId [PK / FK -> Location] SensorNo [PK] [AnalogSensor] LocationId [PK/FK -> Sensor] SensorNo [PK/FK -> Sensor] UpperLimit LowerLimit [SwitchSensor] LocationId [PK/FK ->…
Mark
  • 1,296
  • 13
  • 28
9
votes
2 answers

Search implementation: ElasticSearch vs MongoDB vs Relational Database

I am designing a big travel market agency, where I have 170000 hotels and 3000 room types. A simple representation of my entities is: Hotel: destination: Paris rooms: room_a: type: single room_b: type:…
iiirxs
  • 4,493
  • 2
  • 20
  • 35
9
votes
2 answers

implementing Posts, comments, and likes in DB

I am trying to model a DB in Postgresql after a social media platform such as twitter and Instagram. I have the following requirements: A user can create a Post A User can Like a Post A user can comment on a Post A user can comment on another users…