15

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 would delineate —at the conceptual level— the business context under consideration, and (3) provide additional related material —e.g., the corresponding ...


10

Hard to suggest a more specific fix or suggest a cause given that we have no background on how your system got into this state, what you did prior to trying to create the first diagram, if you have successfully created diagrams in the past, or even what version of SQL Server you're using. It sounds like your sysdiagrams table somehow lost the IDENTITY ...


9

UPDATE: The database diagrams were added back into SSMS 18.1(link) UPDATE: the database diagram feature Deprecated and removed features in 18.0 (GA) ... Database Diagrams https://docs.microsoft.com/en-us/sql/ssms/release-notes-ssms The feature was also removed from Visual Studio 2019 SSDT. Original Answer The latest version of SSMS (as of v16) ...


8

ER Diagrams were originally used only to represent the ER model. The ER model does not use foreign keys to represent relationships. It uses lines between boxes. The lines have some kind of indicator for cardinality at either end or both ends. Sometimes, a relationship will be indicated separately by a diamond. Today, more than half of the ER diagrams ...


8

It is a very poor practice to expect to maintain the PK/FK relationships from the application. In any db that is nontrivial, data has close to a 100% chance of being changed from other sources including ad hoc queries, data imports, etc. It is irresponsible to think the data in the database is protected because the application has protections. Sure you think ...


7

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 interview (or a series of interviews) with the experts of a correspondence company might be very helpful (perhaps indispensable). In this way, since creating a full ...


6

The relationship between tables in any relational database is done using Foreign Keys. From the Wikipedia definition: Foreign keys play an essential role in database design. One important part of database design is making sure that relationships between real-world entities are reflected in the database by references, using foreign keys to refer from one ...


6

You don't need a diagram for it to work, you need one to train the future developers! However, if what you really have is a database with no actual formal PK/FK relationships set up (Which you can do when creating diagrams as well as through better ways such as SQL scripts), then that is a different story. That is something that will eventually cause your ...


6

The two solutions model different rules. With the ternary table you are saying that a company may only have certain products in a particular sector. In a different sector there will be a different set of products, though the two sets may overlap, of course. With the binary tables you are stating that sector has no influence over what products a company my ...


5

The EER diagram is correct. There should be no relationships because WordPress does not have any constraints. The EER diagram shown in the codex is only for reference (it's a dummy EER diagram). You must rely on other logical operations to make sure you have no orphaned data. Source: https://codex.wordpress.org/Database_Description Please note that ...


5

IMO, the balance sheet, income statement and cash flow tables can be the same. Here's my take on it: -- Companies CREATE TABLE company ( [id] int NOT NULL PRIMARY KEY, [name] varchar(255) NOT NULL ); -- "Balance sheet", "IFRS Income statement", etc CREATE TABLE statement ( [id] int NOT NULL PRIMARY KEY, [name] varchar(255) ...


5

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 between the subclasses of Food - GroceryStores and Shoes - ShoeStores. ┌───────────┐ ...


5

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 the following things are true about my originally posted diagram. A company has 1 to many addresses. (shipping, billing, etc). A company has 0 to many ...


5

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 generated with Graphviz (so don't expect Visio quality). You may want to go scavenger hunting through different graphviz viewers. This one using d3 seems to be pretty ...


5

The Database Diagram objects are indeed created using T-SQL. You can see what SSMS does when creating, editing, and saving diagrams by running a T-SQL trace against your development SQL Server while using the Database Diagram tools. A database that has the Database Diagram objects enabled will contain a dbo.sysdiagrams table. Many properties use by the ...


5

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 the relationships:


4

Although this question is a year old, if anyone stumble over this, I've posted a solution to make that possible here: http://www.codeproject.com/Messages/4914888/Search-through-the-binary-for-all-contained-texts.aspx The trick is to extract all ASCII characters in the diagram binary, you'll see that all table names are in there as simple text. That seems ...


4

I am not sure if this is the right place to pose such questions. But here some remarks and questions anyway. They are too long for a comment. I don't understand the word representant. I did not find it at http://dict.leo.org/. Dou you mean representative? With telephones you mean phone numbers and with emails you mean email adresses? Why is telephone a ...


4

SQL Azure databases do not support diagrams in the same way 'normal' on premise SQL Servers do, so you are looking at workarounds or third-party tools. For example, you could install SQL Server Data Tools (SSDT), pull your model down, deploy to a local 'normal' dev server, create the diagram there. This would not involve much data so would be lightweight. ...


4

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 solution. Perhaps I am cheating and not truly answering the Question… but here goes anyways. I was confused when reading and re-reading the Question. When seeing ...


4

You can change the look of the diagrams a bit, evn though not exactly as shown in your sshot. Under the model menu there are 2 submenus for object and relationship notations: The result looks then like this:


4

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 issues. The first is how do you want to draw the diagram, and the second is how do you want to design the tables. As far as drawing the diagram goes, I would ...


4

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 Course is registered at a CreatedDateTime So I reformulated the situation as follows: A Course is the dependent in zero-one-or-many CourseDependences A Course is ...


4

Update to the latest version of SSMS. The database diagrams feature was reinstated starting with version 18.1.


3

It's possible to write a query using the database DMVs, that dynamically tries to guess relations between tables by matching column names. Here's a very simple draft, although it will only work if your primary key column names are unique for each primary key table (i.e. if the primary keys are called "id" in all the tables, this won't fly). Also, you'll ...


3

There is no Foreign key relationship and so there is no relationship reflecting in the tables..


3

ENUM datatype was not supported in MySQL Workbench v5.x. I had the same problem with MWB v5.2. I just downloaded the latest 6.x (v6.1.4) and was able to create an ENUM which now appears in the Datatype dropdown menu of the table editor. One word of caution regarding ENUMs, as noted in the MWB docs: Caution: Care must be taken when entering a default ...


3

More Google searching did not help, but after fiddling around with SSMS I managed to figure it out. Thought I'd answer my own question for anyone else who might stumble across this. To script all of the changes at once, simply right-click a blank area of the diagram and click 'Select All' (or press Ctrl+A). Then right-click one of the selected tables and ...


3

It may be more trouble than its worth but there is a paper on reverse engineering relational database schemas: Clustering relations into abstract ER schemas for database reverse engineering This paper describes algorithms for inferring relations in the absence of foreign keys. I have implemented parts of this as part of a school assignment with some degree ...


3

You want to avoid any inconsistency in prices - and you have already identified this in your question. I'd say use a "Pricing" table which stores Supplier-Parts(PK) and Prices(Float or Decimal value etc). That way, each part from a different supplier has a different price. In other words, the price depends on what the Part is AND who the Supplier is (...


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