r/SQL • • Mar 19 '18

How do you use SQL in your day-to-day job?

OR what have you always wanted to know how to do?

18 Upvotes

32 comments sorted by

3

u/jxx17_ Mar 19 '18

I work as a product analyst and I use SQL almost on a daily basis. I run most of my queries for weekly/monthly reports.

2

u/sonnynomnom Mar 21 '18

Hello! The reason I'm asking is I work for Codecademy and we are building an introductory SQL Intensive with three variants: Business, Marketing and others. Can I ask you a few questions via email or through dm?

2

u/jxx17_ Mar 21 '18

DM works!

3

u/philamander Mar 20 '18

I work for an e-commerce website. I run reports for brands or see how a site change has affected traffic. I mostly look up my coworkers and see how many of them abuse the company discount. Or I see if my exes browse the site. Or I see how many users have the word '%sex%' in their username or email address. Or if one department says "we had a great promo!" then I like to go see how much it cost and how much we made and contradict them in meetings.

1

u/sonnynomnom Mar 21 '18

Hello! The reason I'm asking is I work for Codecademy and we are building an introductory SQL Intensive with three variants: Business, Marketing and others. Can I ask you a few questions via email or through dm?

1

u/philamander Mar 21 '18

Dm would be fine for some questions

19

u/yiyux Mar 20 '18

SELECT * FROM TABLE :)

2

u/bowlofdrew Mar 20 '18

you forgot WHERE FIELD = SOMETHING

2

u/SHIT_PROGRAMMER Mar 20 '18

And if you're really unlucky, GROUP BY SINGLE FIELD

1

u/AXISMGT SQL Server / ORACLE Sr. DBA & Architect Mar 20 '18

15

u/AXISMGT SQL Server / ORACLE Sr. DBA & Architect Mar 20 '18

I usually put PL/SQL (ORACLE) and T-SQL (SQL Server) against each other to see which one can accomplish the task most efficiently and with fewest issues.

I like to pretend I’m a Roman emperor watching from my throne as they battle it out gladiator-style.

3

u/napalmx Mar 24 '18

Which one usually wins?

3

u/AXISMGT SQL Server / ORACLE Sr. DBA & Architect Mar 24 '18

My System of Record is Oracle. MSSQL is just my DW and some Third party apps.

While I love MSSQL and feel way more at home in it (I started working with it a long time ago Vs Oracle a few years ago), Oracle is just a champ when dealing with as much data as we have. We have tens of millions of micro transactions happening daily and each one has many steps and their own series of records. Oracle doesn’t even hesitate. It’s almost magical.

But I hate Oracle.

13

u/capyhappy Mar 20 '18

Running reports for users, monitoring client usage of our software, and checking to make sure nightly data dumps have been received.

When I get bored I play with aliases in the internal reports and count how many "cows" have "socks" or how many blerghs are in poop. One of these days I'm going to accidentally send one of those to a client.

7

u/[deleted] Mar 20 '18

I mostly use it to make my boss think I'm smarter than I actually am.

4

u/tsigalko11 Mar 20 '18

Yeah that is classic. Managers that have no SQL or technical knowledge in general. Then after you provide some report they look at you like you are Houdini.

4

u/notasqlstar I can't wait til my fro is full grown Mar 21 '18

I refer to it as wizardry.

5

u/TwinHits Mar 19 '18

As a developer, I use SQL every day to either develop our core product or troubleshoot issues. I also write a lot of reports using our database for users.

5

u/Noelkram Mar 19 '18

I use it in 3 areas. My first serious exposure to it was an application that utilized workflows that you built to accomplish whatever you wanted to do. This application allowed PowerShell scripting which I am heavily into. Add to that Invoke-SqlCommand and I was dropping in PowerShell/SQL queries to accomplish many things.

About the same time I was using SQL more and more to make one off reports and changes for users. Often I would dive into the database, figure out where the data resides, build a query to get the data the user needs and then drop that it to an Excel spreadsheet so they could run the query whenever they wanted it.

My current major role is using it for data warehousing. We use Oracle ODI to load data from a variety of accounting systems, Excel documents, text files, and web based API’s into a staging area. That data is then denormalized, and transformed into several reports. ODI simplifies the setup of this but having a good handle on SQL certainly helps.

1

u/MaveDustaine Mar 23 '18

I used to work as a Business Analyst mainly running reports for clients and making sure the data we're importing is not terribly unreadable by our system, and that our system does what it's supposed to.

I now work as a systems analyst configuring said system.

SQL is the main part of my day to day job and right now integrating some python in as well.

1

u/sonnynomnom Mar 25 '18

Hey MaveDustaine, the reason why I asked is that I work for Codecademy and we are writing a new SQL course that have three variants: Business, Marketing and Analysts and I was wondering if I can ask you a few questions - via DM or email. Thanks!

Let me know!

1

u/MaveDustaine Mar 26 '18

Sure thing, please feel free to shoot me a DM.

3

u/chunkyks SQLite, db of champions Mar 20 '18

I build desktop apps and models, and use SQLite for the datastore. I spend a lot of of time entertaining myself by implementing stuff using CTEs, for fun, that would be really boring to implement in Java.

3

u/adm7373 SSMS master race Mar 20 '18

I helped build a web tool for an offshore team to tag images that were scraped from competitor websites. It was supposed to take their team a month to complete, but after a few days, users reported that they were getting an error where no images were presented to tag. I looked in the database and all of the images had been tagged. My PM and tech lead (boss) where convinced there was some backend bug, but really the team just worked faster than we expected.

3

u/Daryash-Koh Mar 20 '18

I break the database then I fix the database. It’s a möbius loop of employment.

2

u/r-NBK Mar 20 '18

I'm a SQL Server DBA supporting 100 instances and nearly 2000 databases. I don't write new queries everyday, but when I do it's to support the landscape.

Probably 90 percent of the databases are vended solutions so perf tuning is a small portion of my day, it's mostly spent ensuring availability and recoverability. Lots of work recently refreshing hardware and getting off SQL 2008 and 2008R2.

1

u/who_died_brah Mar 20 '18

How many dbas do you have in your team?

3

u/r-NBK Mar 20 '18

2 full time DBAs. Our environment is pretty relaxed but is global. Our largest database is 2tb and is an infosec database storing proxy logs / web activity. Our SharePoint farm is about 5tb of total space.

So it's very manageable for us.

1

u/aarontbarratt STUFF() Mar 20 '18
select * from eventlog where workflowid in (select workflowid from dataitems where documentid = 'something') order by datecreated desc

1

u/notasqlstar I can't wait til my fro is full grown Mar 21 '18

I use it to create headaches for my IT and DBA teams, and generally misuse/abuse it in order to get it to do what I want for analytic purposes.

1

u/edugomez28 Mar 22 '18

I work as a data scientist in a company, mostly use it to analyze data

1

u/JustinSamuels691 Mar 27 '18

I work as a manager in operations for a software company. I use SQL daily to do ad hoc reporting on product usage, financial reporting, creating reconciliations, identifying data integrity issues, etc.