total non-disjoined relationship in MySQL Workbench - mysql

At school we are supposed to create a Model in MySQL Workbench from this ER diagram
The black arrow means total, non-disjoint relationship.
The definition of that relationship is the following:
super-entity is always part of one or more sub-entities
I am struggling with creating that model. I found somewhere that there is a way with triggers, but I did not figure out how. I am still a beginner.

Related

is it possible to display the relation between two tables in a MS-Access query design view

Hi there fellow SO users,
it´s time to ask a question.
I am using the design editor in MS-Access 2019 to create a query a lot the past few weeks.
I can't seem to find a way to show the kind of relation between two linked tables directly in the query design view without entering the relation properties or switching to the SQL-view.
Searched for my problem but couldn't find any solution.
Any help is gladly appreciated.
Thanks in advance.
Saja
Have you tried double-clicking the line between the related fields in each table in the Query Designer (QBE)? This should load the relationship viewer. Also, the direction of the arrow heads of the line visually indicate the type (INNER, LEFT, or RIGHT JOIN). When you want to visually create a relationship, drag and drop the joined fields to create the relationship. This will create an INNER JOIN by default and you will need to double-click the relationship line to change to LEFT or RIGHT.
Note in the picture the arrowhead points from PostOffices to Cities, indicating a LEFT JOIN between PostOffices and Cities.
The FK relationship of the tables in the actual DB (SQL Server for example for Linked Tables) can be visualized and automatically generated in the Relationship viewer (the ERD Diagram tool in Access, located under Database Tools > Relationships). A query built from those linked tables only shows the properties of the local query (in the local access DB).

SQLAlchemy - What is the right type of relationship?

I want to implement a database which contains shipments from a start to a target location. While most shipments are transported directly between start and target, there are also some shipments that are transported via a crossdock and I'm not sure how to implement this efficiently.
So far, I have three classes: Start, Destination, and Crossdock. So far, I implemented two many-to-many relationships between Start and Destination as well as Start and Crossdock.
This works but I always have to check if a Start ist related to a Crossdock or not. Is there a better way to map these relationships using SQLAlchemy?

How do I see part of EER diagram in mySQL workbench

I got a .mvb file from company, the relationship are complicated and Tables are a lot, I wonder how could I see the relationship between the tables piece by piece, to understand the relationship and database quickly.
Try this:
Model-diagram Properties
And then:
Arrange -autolayout

Can MySQL Workbench's EER Diagram editor represent tables with relationships that are partial/total disjoint/overlap specialization?

I'm studying from "Database Design and Development: A Visual Approach" by Frost, Day, and van Slyke.
It presents relationships in Chapter 5 that indicate partial or total and disjoint or overlap specialization.
Unfortunately, I cannot figure out how to diagram such a thing in MySQL Workbench. A Google search doesn't turn up much either. I found a result about a person asking about them only in SQL to be told that "he doesn't understand the relational database model', which was really annoying.
My book gives examples where this can save diskspace and states that it's a perfectly valid part of the relational model. But it appears to be missing from Workbench.
How can I exhibit specialization in Workbench? The book uses "Student" and "Athlete" and "Councilmember" tables as their example, where a student can be an athlete, student council member, both, or none.
EDIT: Found some links to people asking more or less the same question. Here's the link to a person in the mysql forums. He got an annoying reply that basically ignored his question. Here's a link to the question at DevShed. He got no reply. I now suspect that the functionality does not exist in workbench, despite the name EER suggesting it does.
Ok i think i have found the solution!
If you click a line between two entities you ll see 2 boxes for each side of the connection that says Mandatory. This is total participation. At least it worked for me. You ll notice that total participation has no O on the side that participates but if you uncheck it you ll get a partial participation with O on the side of the entity.
i'm also a beginner for SQL and I had similar problem before, but i think i've clearer mind now, so I'd like to share with you.
If I'm not taught wrong, specifications you mentioned (partial or total and disjoint or overlap specialization) can not be diagramed in ER diagram (ie, entity-relationship diagram), but mysql (and other well-known database softwares) does have this covered. Basically, you enforce this kind of constraints through trigger, check and assertation. And I'm also using mysql workbench, you can certainly create triggers.
If you want to know more about trigger, check and assertation, read jellomonkey's answer:
what is the difference between triggers, assertions and checks (in database)
I believe that when you double click the entity at the bottom you can create indexes and foreign keys between entities. Once created the diagram updated showing lines representing the relationships between entities.
If you provide further details on the structure and relationships of the the table I could try to represent it for you.
Is it something like this you are after http://grab.by/ank7

Create ERD for a mySQL DB by selecting only some of the main tables

I need to create an ERD for our DB system. As it happens, there are lots and lots of tables, and no one really understands much of it. What's more, the same DB has tables for different applications, so not all tables are relevant to my application. I need an ERD for only my application's tables.
I tried creating ERD from MySQL workbench. It allows me to select a subset of the tables to put on an ERD, but that's the problem: I don't know which tables to select ( One of the reasons to build the diagram in the first place :-) ).
What I do know are some of the 'main' tables involved. What I'm looking for is this: I tell the tool some 5-10 of these main tables I'm interested in, and the tool automatically picks up all the tables that are linked to these tables, and creates the ERD for them.
Any pointers?
Otherwise, I'll have to live with building my list of tables manaully, one by one...
http://www.fabforce.net/ has a nice tool called DBDesigner, I have used this in the past for some reverse engineering on a datamodel.