For people who know SQL, how do you remember but also learn how to navigate those phrases, syntax when you build the query? I felt like right now I can understand how it works, but I don’t have a clue how to build query on my own when I just get a database

like
Posting as :
works at
You are currently posting as works at

Practice. Start small and then go increasingly complex over time as you get comfortable with each step below:

1. Start with Simple select *
2. Add filters and where clauses
3. Simple operations - SUM, MIN, MAX,
4. Aggregate functions - GROUP BY & HAVING
5. Learn JOINS - LEFT, RIGHT, INNER, FULL and practice joining two simple tables
6. Join multiple tables
7. Data transformation operations - CAST, Concatenate, Format etc.
8. Conditional - WHEN, EVALUATE
9. Subqueries
10. Advanced SQL - ROW NUMBER, Cumulative Sum, RANK etc.
11. Combine all of the above to create a 7 pager complex SQL :D

likehelpful

In my opinion you need to know three things;
1. The logic operator’s available to you in order to create a query
2. The data tables primary keys
3. The data set you are trying to find

like

Would say the order of operations of logic in a query is most important

Early on, I found it helpful to write out a couple complex queries (with proper formatting). I put each in the center of a page and wrote out notes of: what each clause was doing, why a join was written a certain way, how xyz avoided a duplication issue, etc

like

A simple thing (in my view).

Understanding the business context around the tables you're using is KEY to understanding your query. Simple example, when working with SAP tables, understanding what the PKs are, the date fields and the key attributes represent is easy (ex: EKKO stores my PO, Contract, etc headers, and I use BSTYP to tell which is which). Once you are familiar with the business context behind your tables and fields, writing SQL is like writing a sentence. (Same ex: SELECT * FROM EKKO WHERE BSTYP = 'F' ORDER BY AEDAT DESC).

Now this is applicable for any type of tables you're working with (obviously some are more complex, with less obvious context, etc.) But the principle remains the same.

PS: It just takes time, practice, trial and error to get comfortable with SQL. When I started I had the exact same experience!

Also EY2 gave a very good list of increasingly complex query parameters!

like

If you are more familiar with excel, find some uses cases where you used multiple excels/tabs to collate data to solve some problem. And use that to find/write equivalent SQL. That way you’ll learn faster.

like

1) Cheat
2) Steal
3) Study

First, if you understand the basic syntax, use a database tool with a GUI that joins tables and uses filters. Then look at the SQL it generates. Try modifying it little by little. That's how you learn by cheating.

Look at example code from other queries. Know what the objective of the code is. Learn it. Try to recreate the logic and modify it so it does something else useful. I've learned tons from reverse-engineering other people's SQL. That's how you learn by stealing.

As you're learning from cheating and stealing, just Google what you don't understand. Watch online videos. There's an entire "Learn SQL" section on W3C.

It will help greatly if you understand the underlying type and structure of the database/tables you're querying. It will guide you to the type of relationships you need to build and to how to optimize your query.

Above all, practice. A lot. There's no magic bullet.

Related Posts

I was recently laid off at Snap. Does anybody have new opportunities in tech for a software engineer, 2 yrs of backend experience? Appreciate any referrals!

like

Hi...

Can someone please help me for my next week interview for below role.what topics i need to prepare well.
Role: Associate – Securities Valuation

Job Code:

500854

Hi 🐠 anyone here that works with or has knowledge in the SF Consulting Partner Program? (Not the ISV program?) and willing to give me a little insight? I really really need this please

like

Anyone looking for a referral to Deloitte? Feel free to dm me.

likefunny

Need 11 likes to unlock DM

like

I have been offered an internship for Equity Research role for 2 months. Based on my performance, I'll be on boarded full time. However, they are not letting me know the salary range I can expect once the internship ends. How can I negotiate a salary as per my expectations?

like

Hi All,

What will be the In hand salary for this compensation in IBM Bangalore
YOE - 6.7 years
Technology - Salesforce Developer
Current CTC - 10

Thanks

Post Photo
like

Hii Fishes!!
I am currently working as a Module Lead QA with 5 year of experience. I am into manual web application testing including API testing and SQL knowledge
Can you guyz please suggest what salary should I expect from Indian market these days. Also what is the required set of skill at this stage?

Can any1 refer me in JPmc ? I m an azure data engineer and yoe - 8. LWD - 19 oct

like

Infosys salary breakup, can someone explain the take home

Post Photo
like

Hi all,

What will be the in hand salary for this salary structure.

TIA!

Tata Consultancy

Post Photo
likefunny

I would love insight into typical hourly rates for contractors who help implement Applicant Tracking Systems. If you’ve enlisted a consultant or received quotes, I would immensely appreciate your insight.

Does anyone work at IBM, Salesforce, or Palo Alto Networks? I’ve been interviewing with all three and would love some insight about how you like your company/red flags you’ve come across.

like

Is McK Digital less brutal in terms of hours but the same level of prestige as general McK?

like

Hi! Can anyone here help with a referral to Liberty Mutual?

Curious- what do you all listen to while you work out?

like

I'm just getting my interior styling business off the ground. We're offering interior decorating services for those who are local and virtual designs for those who aren't.

Let me know what you guys think about this design.

Most critiques are welcome!😉

Post Photo
like

You may think he has nothing to do all day. But really he works hard to be adorable.

Post Photo
likeuplifting

Christmas Eve appetizer 2: caprese cups

Post Photo
like

Additional Posts in Technology/IT Consultants

I always thought of Oracle as the evil empire, but for real, what's it like working for them?

Found an attractive posting and I don't want to pass up something good over an opinion I formed as a high school linux geek.

like

Agile Program Managers, I am looking to dedicate a few hours a day to growth and skill building. Looking for any great book recommendations around this subject. To be more specific, I manage automotive user interface design programs within software engineering groups.

like

If you join pwc with an approved I140, do they start the green card transfer (perm, i140) immediately ? I was told by recruiter it will start immediately after H1 transfer . I Wanted to know how true this is if anyone been through this

like

Does anyone know how to become an independent contractor?

like

What do you think of today’s (6/9) IBM major worldwide Cloud outage? Could it be related to the recent major layoffs?

like

I had 4 rounds of interviews with Microsoft recently. How many days will Microsoft take to share the result. Any idea?

like

Hi all. I accepted an offer for a PDM position with Deloitte few days back. However now I have an offer from a very big gaming company for a similar role and want to decline D's offer. Just want to know if any of you have faced this situation and what are the repercussions of doing so? Any suggestions?

helpful

I’m at a point in my life that just want to quit and become a school counselor 🙄. I need to feel what I do can make a difference in something. Anyone has experience with such harsh transition? I always wanted to be come a psychologist

like

I applied for few SA roles at AWS after getting the SAA certificate and some badges like the “WAF” and “Advanced Migration”. I also optimized my resume recently trying to match what AWS would look for, but I did not get any 1st call or screening interview!
I also applied to some of the roles using friend’s referral. I have more than 15 years in IT infrastructure mainly in Storage systems (EMC, Hitachi) What could be the problem? Thanks.

like

Advice when looking for Tech Consulting internships in Chicago or DC Metro? My GPA (3.04) has disqualified me from most major companies. I've opted to focus my efforts into my student organizations and helping others reach their goals, in doing this I compromised for a B average. Are there any firms that will accept recommendation letters with the application? The networking route is also something I am exploring, but haven't had much success thus far. Any help is welcome! Have a great day!

like

Received a 105k base salary offer for a Data Analytics Consultant position. I had 3 years of industry exp before joining - Do you guys feel that was a decent offer?

like

Looking to work as a Tech/IT Risk Consultant in San Francisco. Does anyone know of any good recruiters I can get in touch with? Thanks!

like

Looking to specialize in privacy and was considering getting the CIPP/CIPM/CIPT. I already have my CISSP and CISA. Is it worth it?

like

EY Interview - Business Consulting - Technology Risk - Senior

Hello All,
I applied and ended up getting an interview for a Business Consulting Technology Risk Senior interview at EY. I have a call with the recruiter tomorrow to discuss opportunities within the service line. Can you please help if anyone has been through this process? What should I expect in the call tomorrow as well as the process? Is it going to be difficult for me to get the job? I really want it!

Thank you.

like

I work heavily in AWS and am looking to learn another cloud platform. I have zero knowledge of azure and gcp and would like input on which to learn. Azure would make sense since its the second largest in terms of market share, but GCP seems far more interesting and technically challenging with things like Kubernetes and BigQuery.

like
like

Any suggestions on good books on consulting for reading during holidays

like

Tips to clear AWS solution architect professional exam. No background in AWS

like

Any interview prep advice for the SAP Senior Consultant position at EY ? First step is Hireviu questions with some written portion. What to expect for the Hireviu questions and the written part?

like

Any experience with GRC practice within the Big4? If so, which one would be the better choice as far as maturity & pay?

like

New to Fishbowl?

Download the Fishbowl app to
unlock all discussions on Fishbowl.
That was just a preview…
Sign Up to see all discussions
  • Discover what it’s like to work at companies from real professionals
  • Get candid advice from people in your field in a safe space
  • Chat and network with other professionals in your field
Sign up in seconds to unlock all discussions on Fishbowl.

Already a user?
Login here

Share

Embed this post

Copy and paste embed code on your site

Preview

Download the
Fishbowl app

See what’s happening in your industry
from the palm of your hand.

A phone with Fishbowl app

Scan your QR code to download
Fishbowl app on your mobile

Download app

Sign up for free to view this conversation on Fishbowl

By continuing you agree to Terms of Use and Privacy Policy

Already have an account? Log in

Sign up for free to continue using Fishbowl

By continuing you agree to Terms of Use(New) and Privacy Policy(New)
Messaging rates may apply

Already have an account? Log in

For account settings, visit Fishbowl on Desktop Browser or

General

Legal