ETA: I apologize for the length and meandering of this post. I've been trying to wrap my head around this stupid project and all its rules for weeks.
Hi guys,
I've spent the last few weeks trying, with a couple of different tools, to build a reasonably user-friendly database with reporting to replace a shockingly convoluted spreadsheet that my colleagues have been using to keep track of various advertising campaigns, contacts, accounts, and so on. It's a real nightmare.
One important issue that confounds my colleagues' attempts to build this thing as a spreadsheet is that there are complicated constraints on some items. For example:
Let's say I've got three tables: Hubs, Geegaws, Widgets.
Widgets has a field called Type; Type can be A, B, or C
Geegaws and Widgets both have Hubs.ID as a foreign key.
The following rules restrict the way Widgets and Geegaws can be associated with Hubs:
1. One Hub can be associated with no more than 5 of the following: Widgets-of-Type-A or Geegaws. That is, the sum of Geegaws and Widgets-of-Type-A with the same value for their Hubs foreign key cannot exceed 5.
2. One hub can be associated with one Widget of each other type.
So conceivably one Hubs.ID value might be associated with up to seven other records - five Type-A Widgets or Geegaws, and one each Type-B and Type-C Widgets.
I built my first DB using Access because I had it handy, but as soon as I got to the Form-building stage I kind of bounced off of it in favor of something a little more idiot-friendly. I never quite got to the point of trying to restrict the input according to the ridiculous rule above.
Next I tried building this application using Zoho Creator. I even implemented that ludicrous rule described above (I ended up having to create a relationship between Hubs and the lookup table for Widget types and, then query... nevermind, it's a nightmare). The forms were decent, easy for my colleagues to use, and it was reasonably easy to translate my database schema from Access to their system of Forms. Until I got to the stage where I need to start actually building reports...
And their report builder won't let you build reports that connect tables more than one relationship away from the current table! So if you have a DB where you've got tables A, B, C, D and relationships A->B, B->C, C->D, it's
impossible to build a report that joins data from all four of them. If I need information about D in a report that starts in table A, I have to write a script that copies data from D into C according to that relationship, then a script that copies data from C to B according to that relationship, and then my report can include data from A and B. Avoiding doing
exactly this is the reason relational databases were invented in the first place! (I bitched at length about this to a buddy and he explained that their reasoning is probably to avoid "N+1" or "N vs. 1" problems when deciding how to structure queries for reports)
Anyway, so much for Zoho Creator. If I want to keep using it I either have to write a lot of really bad scripts that turn my database into a crappy, ugly spreadsheet, or I have to mash a bunch of my tables together to make crappy, ugly spreadsheets to reduce the number of relationships so that Zoho can make intelligible reports out of them.
So, here it is:
Do y'all know of any relational database front-ends that will let me implement the kinds of complex input constraints I need
and have an adequate interface for adding/updating records
and have a decent way to turn queries into reports?
I know the basics of T-SQL and I can figure out how to do what I need to do in other flavors of SQL, and I can write sub-idiot-grade javascript and python (...and Deluge, thanks to frigging Zoho Creator). I know the
right way to do this is to build a custom application to run the queries and build the forms and their input constraints, but our one programmer has lots of much more important stuff to do.
Any suggestions? I downloaded dbForge studio just to see if I could start bashing together the basics of my tables and stuff in MySQL (I don't want to experiment on the company's MSSQL servers, because they do important stuff). For the frontend I was poking at myDBR, which has very pretty report-generating tools and forms, but I don't know if it can do the bizarre input rules I need.
Thanks!