Click here to Skip to main content
14,842,013 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 2:33
mvaraddevus1-Dec-20 2:33 
GeneralRe: Controversial: SQL Pin
DumpsterJuice1-Dec-20 2:52
MemberDumpsterJuice1-Dec-20 2:52 
GeneralRe: Controversial: SQL Pin
Member 145416481-Dec-20 1:33
professionalMember 145416481-Dec-20 1:33 
GeneralRe: Controversial: SQL Pin
Member 103624061-Dec-20 1:57
MemberMember 103624061-Dec-20 1:57 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 2:35
mvaraddevus1-Dec-20 2:35 
GeneralRe: Controversial: SQL Pin
Brian Battles1-Dec-20 2:38
MemberBrian Battles1-Dec-20 2:38 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 2:51
mvaraddevus1-Dec-20 2:51 
GeneralRe: Controversial: SQL Pin
ElectronProgrammer1-Dec-20 2:40
MemberElectronProgrammer1-Dec-20 2:40 
For very special, or big, or being used a lot, queries (or for clients who can't spell SQL Big Grin | :-D ), I use something that you will probably hate. I use Java Smile | :)

I make a program in Java (basically a custom SQL generator) where I insert the code inside a method that receives parameters that allow to configure the query in things like database/table/field names, which fields to return, insert sub-queries, etc. Then document with Javadoc as with any other program.

All the queries are inside the same Java program, are selectable and configurable via command line or a web page that dynamically requests more configuration based on what you requested and configured so far.

Using the generated Javadoc or an IDE on the program source makes it easy to find anything. The program makes easy to get the configured SQL.

This has the advantage that you can tweak the Java source to add more functionality to the queries and make that selectable via parameters. You can even pass the program to clients and they will happily build some queries they need by just answering configuration questions and never touching SQL.

I have done this for a client in the past in which the program would generate SQL and JavaScript (to interact with the SQL via web page) for their web site recommendation system using Similarity Matrices, Friends-of-Friends and a few other algorithms implemented in SQL.

Since their recommendation system used the same algorithms to recommend different things (people, items, lists of people-item pairs, etc), this method was easier for me to maintain and they were very happy to be able to generate the required SQL in less than 5 minutes by answering a few questions instead of manually modifying each time the almost 500 lines of SQL code for the Similarity Matrix alone. They were even able to use the program by themselves, without requesting my help, to generate SQL to recommend things that were never mentioned to me.

Unfortunately, I can not show any of those programs as they are protected by IP Frown | :(

Yes, this is convoluted, but makes things easier on the long run.
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 2:53
mvaraddevus1-Dec-20 2:53 
GeneralRe: Controversial: SQL Pin
ElectronProgrammer1-Dec-20 4:03
MemberElectronProgrammer1-Dec-20 4:03 
GeneralRe: Controversial: SQL Pin
Rusty Bullet1-Dec-20 3:19
MemberRusty Bullet1-Dec-20 3:19 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 3:35
mvaraddevus1-Dec-20 3:35 
GeneralRe: Controversial: SQL Pin
rnbergren1-Dec-20 3:14
Memberrnbergren1-Dec-20 3:14 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 3:37
mvaraddevus1-Dec-20 3:37 
GeneralRe: Controversial: SQL Pin
obermd1-Dec-20 3:31
Memberobermd1-Dec-20 3:31 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 3:54
mvaraddevus1-Dec-20 3:54 
GeneralRe: Controversial: SQL Pin
AndrewGT1-Dec-20 3:36
MemberAndrewGT1-Dec-20 3:36 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 3:55
mvaraddevus1-Dec-20 3:55 
GeneralRe: Controversial: SQL Pin
Marc Clifton1-Dec-20 4:11
mvaMarc Clifton1-Dec-20 4:11 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 8:53
mvaraddevus1-Dec-20 8:53 
GeneralRe: Controversial: SQL Pin
Matt McGuire1-Dec-20 4:44
professionalMatt McGuire1-Dec-20 4:44 
GeneralRe: Controversial: SQL Pin
raddevus1-Dec-20 8:56
mvaraddevus1-Dec-20 8:56 
GeneralRe: Controversial: SQL Pin
Matt McGuire2-Dec-20 4:47
professionalMatt McGuire2-Dec-20 4:47 
GeneralRe: Controversial: SQL Pin
raddevus2-Dec-20 5:19
mvaraddevus2-Dec-20 5:19 
GeneralRe: Controversial: SQL Pin
MSBassSinger1-Dec-20 6:20
professionalMSBassSinger1-Dec-20 6:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.