It is a bit strange to me about database schemas sample which I think most of the projects will need to design a database for it. but when I try to find sample online, it is really rare (eg. full database schema for Inventory Management, School Management, HumanResource management). I know that each database design is depends on the project requirement, but I don't think it is much different.
I just wonder why there is so few people kick it online as other source code.
Could anyone pointing me out where to get it or any advice?
Thanks in advance
This must be the ueber-list on database schemas. And here's an interesting reading list on Amazon. I can recommend the Len Silverston books. They will get you started.
There are plenty of database schemas out there, I'd say.
SQL Server 7/2000 schipped with "pubs" and "Northwind" which you can still download from CodePlex.
SQL Server 2005 shipped with AdventureWorks, which is quite extensive and available in various versions (OLTP, OLAP, Light) - also available from CodePlex.
Many bloggers have sample databases they use for their blogs and their screencasts, e.g. Rob Bagby has one for school data and one for a winery on his blog.
There are several more (aimed at finally getting rid of using the notorious Northwind database for demos) on Codeplex.
Marc
Why not look at open source projects for schemas along with the code that use them? For CMS schemas, there're Wordpress, Drupal and a zillion others, for CRM schemas, SugarCRM etc.
Related
By looking at the default, raw relational db schema of TFS2010 of its underlying team project collection sql database it is not necessarily self-explanatory how things work there and I was wondering whether someone has a more process oriented explanation how all these tables are related to each other. It seems like only 3 or 4 actually do have fk relations and such, the other ones are logically connected and would require joins and that's the part I am interested in & want to understand. Does anyknow have or know a more detailed explanation what's going on there?
I would strongly recommend using the TFS cube for all reporting needs, microsoft does not recommend the use of relational database as this may impact performance. As a good start you can read up about the schema, enhancements, dimensions of the TFS 2010 cube on the msdn library http://msdn.microsoft.com/en-us/library/ff432837.aspx. Also this walkthrough is very helpful to get you started with reporting against the tfs cube http://msdn.microsoft.com/en-us/library/ff730837.aspx#bkmk_tfsdb
HTH.
Cheers, Tarun
I have bought a Oracle 11g recently and I wanted all my developers to use it. Obviously I can't buy different licenses for each. So is it possible for me to create one database for each of the developers?. By inference I know it is possible.
However, I couldn't find how I can do it. I googled. There was no definite guide for this particular case. Can you point to the right resource?
Or could you list down the steps to achieve this?
I would ever be grateful.
-
Sheldon
When you create a user in Oracle, you're creating a schema. A schema is a collection of tables and related objects (views, functions, stored procedures, etc) specific to that schema. So each developer could have their own user/schema, and work independently of one another. Access to other users can be granted, and public synonyms can be created to ensure that YOUR_TABLE points to a YOUR_TABLE in a specific schema, without the need to specify that schema. But this can eat space...
If there is shared development, might be best to have a single schema so everyone is working on the same copy.
Create one database and give each developer it's own schema (username/password).
As long as all your database instances are on the same server you can build as many as you want without paying any more. Performance might become an issue with more instances depending on how heavily used they are.
You don't mention your platform.
On windows, here's how to use the Database Configuration Assistant (DBCA). I think it's pretty similar on *nix as well.
Each database so created has a different name. To access them it's simply a matter of using a tnsnames.ora file with different entries for each instance on the server.
You can buy Oracle personal edition for each developer and install it on their desktop/laptop. According to shop.oracle.com it's $460 per user. This way you can give everyone full access to Oracle and save a lot of trouble. Developers can learn Oracle more quickly and be more productive, and DBAs won't have to worry about them bringing down the server.
Or possibly you could even use it for free if your program is not in production yet. The Oracle Developer license lets you:
... use the Programs, subject to the restrictions stated in this
Agreement, only for the purpose of developing, testing, prototyping,
and demonstrating Your application and only as long as Your
application has not been used for any data processing, business,
commercial, or production purposes, and not for any other purpose.
Hi
is there any online resource for practicing SQL queries more complicated ?
basically I had a db dev until now and I kind of forgot. I want to switch jobs and freshen up a little.
They should more complicated than 2 joins or something, as my level is medium or senior hopefully :)
Thank you
It may be a bit dry, but if you're mid to senior level why not just look at the transact-sql reference on MSDN: http://msdn.microsoft.com/en-us/library/bb510741.aspx
Take a look at what's possible with the product, both the supporting examples and documentation are detailed and insightful. Many of the examples use the AdventureWorks sample database which you can download from codeplex
download SQL Server Express, it is free
Then pick out one of the zillion SQL Server books available at amazon or any local bookstore. There should be lots for every level of experience. Then, work through the examples in that book.
I'd like the ability to create a schema for multiple database types such as MySQL, SQL Server, and PostgreSQL. I know ORM tools such as Hibernate can do this, but I won't be using an ORM to access the database so would like a solution that doesn't depend on one. Are there any tools that can do this?
Edit:
I forgot to mention that this is a personal project so I'm looking for something either cheep or free.
Take a look at Erwin.
Edit: (Based on question update)
Yeah Erwin is not going to be cheap. I did a quick search and found Toad Data Modeler, which I haven't tried but may be worth looking into:
Entity relationship diagrams - both Physical and Logical modeling (incl. inheritance)
Support for various databases (Oracle,
MS SQL Server, MySQL, Sybase Ase,
PostgreSQL, DB2)
Generation of SQL (DDL) scripts
More...
SQL Power offer a FOSS modeling tool, SQL Architect. It can generate DDL for several flavours of database. It is still technically beta (current release is 0.9.1) but it should be fine for a personal project. Find out more.
I know you said u don't want an ORM but SubSonic 3's migrations might just do the trick for you. You don't have to use the ORM just have SubSonic build itself from your database and have it as a separate class library. Then change the provider say from MSSQL to MySQL and have it rebuild itself.
PowerDesigner is a far better choice than Erwin but it too is expensive.
It took me roughly 16 hours to install the demo of Erwin, lots of failed attempts, incomprehensible error messages, help phone number which were disconnected.
PD will give you 14 day free trial.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I've recently inherited the job of maintaining a database that wasn't designed very well and the designers aren't available to ask any questions. And I have a couple more coming my way in the near future.
It's been tough trying to figure out the relationships between the tables without any kind of visual aid or database diagram.
I was wondering what tools are recommended for this. I know about Visio, but I was hoping there were some good open source/freeware applications out there. I don't need it to change the database at all. Just read it and create some kind of visual aid to help me understand how things are laid out and try to figure out what the designer was thinking about how the data should relate.
Additional answer data: SchemaSpy was the kind of thing I was looking for, but having not done a lot with the command line in ages, I opted to use SchemaSpyGUI. There was also some configuration to get used to since I don't work with Java much, but the end result was what I was looking for (on open-source replacement for Visio's ER diagrams).
Try SchemaSpy. I ran it against a rather complex database and I was quite pleased by the result, with advice on optimization.
Try DBVis - download at http://www.minq.se/products/dbvis/ - there is a pro version (not needed) and a open version that should suffice.
All you have to do is to get the right JDBC - database driver, the tool shows tables and references orthogonal, hirarchical, in a circle ;-) etc. just by pressing one single button. Enjoy!
What DBMS (Database Management System) are you using? Many modern DBMS's like SQL server and Access can create an E-R diagram for you.
Microsoft Visio is an excellent tool and can reverse engineer SQL from any datasource.
DDT (Database Design Tool) can reverse engineer from raw SQL on windows and is very lightweight (very small free download).
MySQL Workbench is one of the more popular MySQL tools and has a freely downloadable version.
SQLFairy can do the same for MySQL on Linux.
dbdesc is not free, but I've heard very good things about it. It works with several of the major databases out there.
I have been lucky in that I haven't had to decipher other people's database schemas yet. I have use a set of templates that come with CodeSmith.
Firstly, may I say that I feel your pain!
Here are a couple of my tips:
In general, a tool will only be helpful if the designers have correctly defined all the primary and foreign keys, so be aware that a tool might not pick up all the important relationships.
The most useful thing is to see what queries are being performed by the client code. This will tell you not only what relationships exist, but which tables and relationships are the most frequently used - that's where you'll want to concentrate your effort.
There is a bit of open-source software out there but Visio Professional's tool for reverse-engineering database schemas is quite good because it de-couples the process of reverse-engineering and diagramming. I use this a lot because it tends to be readily available at most sites.
One nice feature of visio is that you can reverse engineer and then construct your own diagrams from the reverse-engineered schema. Doing this is a very good way to explore the schema and understand it as you are doing this work as a part of interactively building a reference document for the schema. I've used this technique to reverse engineer everything from Activity Based Costing Systems to Insurance Underwriting Systems, typically without much help from the vendor. Tinkering about with Visio diagrams is quite relaxing.
Between this and a little hypothesis testing about FK relationships (If the FK is not physically present on the table) you can make sense of quite complex schemas. I've found this diagramming approach makes Visio a head-and-shoulders leader because you can easily interact with the reverse-engineered model in a fairly convenient way. You can fill in missing foreign keys, build subject area diagrams and add annotations on the diagrams. The interactivity of this process makes it a good learning tool.
This is a somewhat subjective view but the interactivity works very well as a learning proces for me and it's by far my preferred approach. Most sites won't begrudge you the £300 or so for a license - if they don't already have it available. The only site I ever worked where they had to get it in was because they had Visio Standard instead of Pro. I asked nicely and the PHB signed it off.
I use mysql workbench (http://www.mysql.com/products/workbench/) for mysql databases. You can attach the workbench to your database and it will draw the ER digram for you.
Using pgsql/win32 I found the easiest solution was to write a perl script that made use of Graph::Easy from CPAN. Query the database for foreign key relationships, make a directed graph with tables as nodes and FK relationships as links. If this is your setup, I can post the code.
I like to try and see if the applications that use the database have ways of logging the SQL they use (or the DB backend itself, but that tends to be less tractable). Getting a feel for what requests performed on the database helps you concentrate on the important tables.
As with most things, the 80/20 rule applies here: 20% of the tables will do 80% of the interesting stuff. Once you've figured them out, a diagram is rarely necessary.
Look at the primary key foreign key relationshsips that have been set up as a starting place.
Since a database without existing diagrams, may not have relationships set up formally, I look at the table structures and names and make my best guesses as to what might be related to what, then dig into the structures to see if there are obvious (but undefined) foreign keys. I look at the stored procs to get an idea as to how the tables are joined and what fields are being queried on.
While automated tools to figure out the database can be spiffy, I find that when I really dig into the details of the database myself, I end up with a much better understanding than I can get from any picture created automatically.
I have some pretty good experience with Aqua Data Studio for reverse engineering a DB schema. It is very feature rich and supports even more exotic databases like Informix or Sybase.
This helped me with generating the ER diagrams on MS SQL Server 2012:
MS SQL Server management Studio > File menu > "Connect Object Explorer"
Choose your Database node and expand it. under this node you'll find a sub-node called "Database Diagrams"
Right click on "Database Diagrams" > "New Database Diagram" > Add tables that you wish to see their columns, relationships, ...
Use Visio. If using Vision 2010, you will need to use the Generic OLEDB Provider for SQL Server to ensure that there will be no problems with connecting to the Visio Driver.