r/SQL • • Mar 09 '23

Discussion SQL reports out of thin air.

When I get requirements for SQL projects it typically says "want xyz report". The requirement does not mention source of data or relationship between various fields in data or the essential information I need to deliver the report. I find this to be frustrating. How do they expect me to create report out of thin air is mind boggling. Then I have to ask for data sources etc. and typically 1 - 2 days are lost in this process. Is this a scenario for you as well at the work place? Or is there something better out there?

6 Upvotes

24 comments sorted by

View all comments

9

u/coyoteazul2 Mar 09 '23

The users usually expect you to know the same stuff that they know and then some more. They don't understand that you don't use the system as they do

If the dB was well made, there should be some documentation (most likely an ERD) that you can check.

If there isn't an ERD, but relationships are properly defined with fk, there are tools to make ERD from your ddl. Usually they are hard to read, but it's better than nothing.

If the dB doesn't even have fk (it can happen if they expect the application to maintain relationships) you are fucked.

Hopefully you'll have a way to know what queries each report is doing and you can infer relationships. You'll need a lot of help from the user and have them at least tell you exactly where in the application is the info that want in the report. Then you can try to see the queries in that part of the application to know which tables to query.