I am following database first approach. Please help me out how can I make models out of my database.
In sql server management studio, you can expand the database node under [server] => Databases => [database_name], and the first item should be "database diagrams". Right click, hit New Diagram, and you'll be taken to a dialog where you can import the tables you want into the diagram.
The other option is, if you're using a third party data modeling tool, go to [database_name] => Tasks => Generate Scripts, and generate a db creation script. The tools I've used, ERWin and ER Studio, can import those scripts as a model.
ErWin is a common tool, almost an industry standard. You do not HAVE to learn it but it's a nice to know.
Their community edition is free and good to learn about data modeling, both from physical to logical (what you are trying to do here, I guess) and the other way around.
http://erwin.com/downloads/
I would recommend the crow's foot notation, which is now seemingly the industry standard (better than the infinity-key notation which SSMS offers). Hate to link to Wikipedia but this below article is A-OK:
http://en.wikipedia.org/wiki/Entity-relationship_diagram#Crow.27s_Foot_Notation
Related
Is there a tool which I can use to inspect and visualize my SQL database?
I'm using MySQL and MySQL Workbench. MySQL Workbench is fine, but I would like to be able to see my db as a graph of objects.
For example, if I have schools, professors and students, the tool would have to figure out the relations and to give me a tree structure (or a forest) of schools that have professors as children and students would be the leafs of the tree.
In general case it would be a graph.
It looks to me as a common problem, but I could not find any good tool for this.
It does not have to be specifically for MySQL, any other SQL db would be good for me.
If I get it right you want to navigate the data and its relationships of your (relational) data source.
This is not exactly what Relational really perform so well: in particular JOINs are the issue in this kind of task.
The more JOIN the slower the query will be. And usually you have to use a lot of JOINs to navigate your data.
Said that, I've tried to give an JS panorama for this kind of tools on this answer: Big data visualization using "search, show context, and expand on demand" concept
More, the developers in my company just released a new blog post about visualizing networks from different data sources on our blog: while the post talks about KeyLines the process it pretty much the same for every JS framework out there, the complexity will change mostly when you have to implement the visualization itself.
Disclaimer: 'm part of the the Keylines dev team.
I'm using DBArtisan 8.5.5 and it has the ability to generate Database Diagrams using Build Query, it has a nice feature that lets it autojoin, detecting potential relationships on newly added tables to the diagram. So the diagram results into a SQL statement since its a Query Builder after all.
Is it possible to provide an SQL statement in DBArtisan and generate the Database Diagram? In other words, the reverse (give it the SQL to generate the diagram, instead of using diagrams to generate SQL)?
If no such feature, is there a product out there for Sybase DB that will provide said feature?
DbVis is an actionable choice, being open source and powerful - it's got a good amount of extra features aside from the one you need.
If you're willing to pay, Aqua Data Studio is a very complete and intuitive database IDE.
As a middle ground solution, disposing of both a - constantly updated - open source edition, the DBeaver Open Source IDE, and an Enterprise Edition. Both of these also offer what you need, the main differences as of now being interface, SSH algorithm support and SQL debugging framework offered in Enterprise. You can take a deeper look yourself, comparing the Open Source features with the Enterprise ones.
I have my database built already, but I really want to print out an erd to reference while I'm building my models. Is there a utility that can generate an erd from a SQL dump or by connecting to the database directly?
Thanks in advance,
~Brandon
The Data Modelling component of MySQL Workbench 5.2 OSS can do what you are describing, depending on the ERD notation you are seeking.
From the Home tab, select Create EER Model from Existing Database, then simply follow the wizard that displays. It will you run you through connecting to an RDBMS, choosing the objects to model, and then create the model for you.
If you're looking for traditional Chen or Crow's Foot notation, make sure you select Classic in the Model > Object Notation menu, and Crow's Foot in the Model > Relationship Notation menu.
MySQL Workbench
MySQL Workbench should be able to do this.
I found this tool Visual NHibernate at http://www.slyce.com/, but a search on here has not brought anything up for what I would have thought would have been a very popular product, in concept anyway.
Has anyone used this product? Any feedback on it?
Thanks
Right, first let me say you are on the right track. Visual NHibernate has come a long way from a tool to generate NHibernate Mappings and Classes from just Microsoft SQL Server to a tool that does all the major Databases (I am biased cause it does MySQL now).
Like the name suggests, it doe the configuration setup visually with a rather tasteful (lately) UI (Probably WPF) that surprisingly does not tax your computer!! It also allows for setup of validation rules, Auto-detection of relational integrity (Primary - Foreign Keys) and all this with a very very flat learning curve.
If you use Oracle, Microsoft SQL Server or MySQL Server and you do not wish to spend too much time designing mappings and typing classes then this is the tool for you.
I'm new to SQL and could use some help in creating a database schema for my program, which manages and installs programs for my home network. Are there any guidelines/tutorials for creating database schemas?
Probably the most important concept to understand before you design your schema (you'll thank yourself for it later, trust me! :-) is that of Normalisation. The tutorial at db.grussell.org doesn't look too shabby and will give you a good grounding. In fact, if you click the "Up One Level" link and take a look around, some of the other information might be quite useful as well.
My "top tip" is: Write it down on paper or in notepad, or anything other than a database, before you start writing code. Get a good idea of what you need your schema to be able to do before you set it in stone (And by "set it in stone" I mean, realise that you've written a load of code against the schema that would have to be re-written if you change it to do what you've just realised you now need).
Designing Databases is a separate field of study and expertise. It cannot be condensed into one answer. Since you are interested in tutorials, look at the section on Database Design in any text book on Database Management Systems. I would recommend
Database System Concepts, 5e, Abraham Silberschatz, Henry F.Korth, Sudarshan
In database design, remember the following
1) You are identifying the important objects of interest in your home network. Try to avoid excessive indulgence in the processes themselves though they are important to identify the important data units that you need to capture
2) Use ER/UML modelling techniques to come up with a Data Model Diagram/design. There are many case tools that can help you in drawing this.
3) Use the principles of Database Normalization to fine tune your schema to avoid data redundancies. Redundant data leads to the following side effects: Inability to maintain consistency among redundant data, Inability to store some data in an elegant manner
3) Forward engineer your design to DDL statements for the DB of your choice. Most case tools support this.
Case tools:
Microsoft Visio
ER Studio (very expensive)
TOAD data modeller
There are many open source tools too. You can try Dia. This does not support forward engineering