Hot answers tagged

19 votes

Modeling a scenario in which each Music Artist is either a Group or a Solo Performer

The part of the scenario that you are confused with can be modeled with a classic construct called supertype-subtype1 structure. I will (1) introduce some pertinent preliminary ideas, (2) detail how I ...
  • 8,250
16 votes
Accepted

Implementation of a many-to-many relationship with total participation constraints in SQL

It's not easy to do in SQL but it is not impossible. If you want this enforced through DDL alone, the DBMS has to have implemented DEFERRABLE constraints. This could be done (and can be checked to ...
14 votes
Accepted

Conceptual ERD Multi-table many to many, or possibly recursive?

It is great that you are taking the time to understand, classify and model the data you are dealing with since, from my personal experiencie, all this makes the whole development process easier and ...
  • 8,250
13 votes

Visualizing Database Schema

In SSMS you can easily create diagrams showing the relationships between tables. The basic steps are: Connect to the database server Expand the Databases folder Expand the folder for the database you'...
  • 4,722
12 votes
Accepted

Best data modelling approach to handle redundant foreign keys in a database about Surveys, Questions and Responses

As per my understanding of your specifications, your business environment involves a conceptual-level ternary relationship. In this regard, you need to define: the relationship (or association) type ...
  • 8,250
11 votes
Accepted

What do the entity-relationship diagram (ERD) symbols used in DBeaver mean?

I found something while putting together this question. It seems the current standard used is IDEF1x, according to this github issue. I found a PDF cheat sheet with the following content showing all ...
  • 448
10 votes

Need help on my first ER diagram

For your first database class and first attempt at an ER Diagram (ERD) I think you have done a great job! I'd like to give you some feedback in the context of the process I use to break down a set of ...
  • 3,528
10 votes
Accepted

Which one is an ER diagram?

One can say that a proper entity-relationship diagram is that which was created using the constructs introduced by Dr. P. P. Chen (e.g., rectangular and diamond-shaped boxes) in his famous 1976 paper ...
  • 8,250
9 votes
Accepted

Entity-relationship diagrams and application program functionalities

You touch several subjects, therefore it is important to establish their scopes and the links that exist among them. Firstly, if the specific business domain you are working with implies (a) multiple ...
  • 8,250
8 votes

How to model Parent -> Child -> Grandchild if the Child can be removed

This answer is based upon your question as it stood before the clarification about each level being a different type. Since you have identified the need for different types, I agree with my answer ...
  • 67.6k
7 votes

Which one is an ER diagram?

The first one is traditional Chen's notation. The second one is modern Crow Foot or Baker's notation, used today by majority of tools and people. It is perferred because it is more readable and uses ...
  • 274
7 votes
Accepted

How to model a Letter Transportation business context in a database diagram?

Although you stated that the structure depicted in your diagram is part of a university project, the objective should be to make it as realistic as possible, so I consider that carrying out an ...
  • 8,250
7 votes
Accepted

Can a weak entity have a primary key?

The primary key is a way to distinguish one row in a single table from all other rows in that same table. It is not a way to distinguish one row in the context of its associated rows from other tables....
7 votes

How to model Parent -> Child -> Grandchild if the Child can be removed

PostgreSQL and ltree If you're using PostgreSQL, you can check out ltree which does this and keeps things sane and indexable. CREATE EXTENSION ltree; -- required if you don't have it. CREATE TABLE ...
  • 57.2k
6 votes
Accepted

How to enforce a constraint over multiple tables?

This can easily be done by using cascading keys that overlap. Here is an example using the Oracle Data Modeler (note there is a bug in this tool or a configuration issue as the Provider_Feature table ...
  • 3,528
6 votes
Accepted

Modeling Subclass (or Subtype) Constraints in an Entity-Relationship Diagram

I think you can make an Orders entity that is a relationship between Products and Customers. The Orders would have subclasses FoodOrders and ShoeOrders, which respectively would be the relationships ...
6 votes
Accepted

What is a database mission-statement?

I thought that Jeffrey Yao did a fantastic job answering this question here. I've edited it a little bit and sometimes include my own mission statement on my resume, but here's my "slightly" modified ...
  • 3,022
6 votes

One and only one relationship - ER diagram to relational schema

You have several possibilities, each of them with advantages and disadvantages. Solution 1 Define a single table: AB(a b c d e f) with two candidate keys, b and e. You chose one of them as primary ...
  • 3,965
5 votes

What is the best way to represent an album and song entity in an e-commerce schema?

There really is not a One True Answer, but there are plenty of samples available on the web. One site is: http://www.databaseanswers.org/data_models/ This is actually a site with many simple data ...
  • 13.8k
5 votes
Accepted

Is this table in my ERD redundant? (Image)

The purpose of the Author's_University table seems to be to allow one author on an article to be associated with more than one university. There are a couple of potential reasons why that would be ...
  • 4,722
5 votes
Accepted

How do I read ERD Notation (crow's feet) to convert to Natural Language?

I'd like to answer this more definitively now using the following image (from https://www.lucidchart.com/pages/ER-diagram-symbols-and-meaning) Using the definitions of these symbols you can see that ...
  • 201
5 votes

Postgres 9.6 export the database structure as pdf

You need a Entity Relation Diagram (ERD) generator. The most popular and advanced one that I know of that is FOSS is SchemaCrawler. It does everything you want anyway. Though the diagrams are ...
  • 57.2k
5 votes
Accepted

Settle debate between Professor and Myself on interpreting Crow's Foot Notation in an ERD

Your professor is wrong. The cardinality in almost all versions of crows foot notation is read such that the cardinality next to the entity is the cardinality of that entity. You can also see by the ...
  • 12.3k
5 votes

Can a weak entity have a primary key?

They are both correct definitions. Orders is a strong entity. It exists on its own. OrderItems, however, would be weak. It has an order number (foreign key) and a line number (partial key). It is ...
  • 2,201
5 votes

"Diamond Shaped Relationship" What's the formal term?

You'd have to add the crows feet (or whatever notation you prefer) for us to properly understand the diagram. I choose to interpret it as directed top-to-bottom. top table | | ^ ...
4 votes

Modeling a scenario in which each Music Artist is either a Group or a Solo Performer

The Answer by MDCCL is fascinating, educational, and presumably correct (though above my pay-grade). In contrast, I re-interpreted the Question and went back to basics for the simplest possible ...
4 votes

Conceptual ERD Multi-table many to many, or possibly recursive?

I think you are trying to blend together concepts from object modeling and concepts from data modeling in a way that isn't helping you to clarify your own understanding of the problem. I hope I can ...
  • 4,118
4 votes
Accepted

Representing a Superclass/Subclass (or Supertype-Subtype) relationship in a MySQL Workbench diagram

This is a case of what's called "generalization/specialization" in ER lingo. It's really the same thing as what object models call "superclass/subclass" as you have done. There are two separable ...
  • 4,118
4 votes
Accepted

How can I represent the entity types depicted in an ERD as relations with attribute names?

Considering the Course entity type that you describe, I have made the following assumptions: A Course is primarily identified by its CourseNumber A Course is alternately identified by its Name A ...
  • 8,250
4 votes
Accepted

Entity set that has a relationship with itself

There's nothing in the ERD to constrain the model either way. Without suitable constraints, a child could be recorded as being born before his/her parent, a person could be their own child or parent, ...
  • 383

Only top scored, non community-wiki answers of a minimum length are eligible