Looking for Sql exercises

Solarion

Honorary Master
Joined
Nov 14, 2012
Messages
28,050
Reaction score
17,804
I have this exam coming up, one of those hackerRank/codingame type of exams and historically it is usually SQL that gets me. These exams are usually around 15-30 mins per question so it's nothing major. Any of you please please have any tests for me or can point me in the direction where I can find some to practice with?
 
I have this exam coming up, one of those hackerRank/codingame type of exams and historically it is usually SQL that gets me. These exams are usually around 15-30 mins per question so it's nothing major. Any of you please please have any tests for me or can point me in the direction where I can find some to practice with?
I have one SQL assessment, not done normally due to ORMs.
PM me your email and I’ll forward the doc.
 
I have this exam coming up, one of those hackerRank/codingame type of exams and historically it is usually SQL that gets me. These exams are usually around 15-30 mins per question so it's nothing major. Any of you please please have any tests for me or can point me in the direction where I can find some to practice with?
You could try hackerrank's or codewars' SQL exercises, they're pretty nice
 
I come bearing naught but memes, good sir.


HSzuye-GjvUi7eGGqLNTRb7D3BagAeAbSYU142nzez4.jpg

v4ws5.jpg

yOLzCR0qSzul2WpjQorxINB0xpU3_N9twmFVsgbGJwQ.jpg



Good luck.
 
My sql can't be that bad at least I get that pic :X3: or at least now I will never forget join types ever again lol

Yes seen plenty of SQL in full capslock. My first job in dev back in 2003 my head dev was capslock everything.
 
You could try hackerrank's or codewars' SQL exercises, they're pretty nice

Bingo thanks that is where I am right now on hackerRank I will check out code wars. I have a week to prepare so going to be cramming my weak areas which is SQL and general C# algorithms.

Since starting this thread I have collected nearly 300 algorithmic tests from easy to very hard. Will be hitting those all week.
 
My sql can't be that bad at least I get that pic :X3: or at least now I will never forget join types ever again lol

Yes seen plenty of SQL in full capslock. My first job in dev back in 2003 my head dev was capslock everything.
That’s a good thing if consistent. It’s a style guide. Upper case all the SQL reserved words.
same reason you don’t use random casing/conventions every time you declare a local variable
 
That’s a good thing if consistent. It’s a style guide. Upper case all the SQL reserved words.
same reason you don’t use random casing/conventions every time you declare a local variable

I find it easier to read when they use the right case. We were taught at CTI using the correct casing and would lose points in tests if not adhering. This is early 2000's CTI when, not sure what it's like today.
 
That’s a good thing if consistent. It’s a style guide. Upper case all the SQL reserved words.
same reason you don’t use random casing/conventions every time you declare a local variable
I concur with this, caps lock stuff like SELECT, FROM, WHERE, etc, and keep field names in lowercase like field_id, etc.
Bingo thanks that is where I am right now on hackerRank I will check out code wars. I have a week to prepare so going to be cramming my weak areas which is SQL and general C# algorithms.

Since starting this thread I have collected nearly 300 algorithmic tests from easy to very hard. Will be hitting those all week.
Also maybe a pro tip I can give to quickly remember and use basic SQL syntax is this mnemonic (I think it's called that).

SFWGHOL: Similar Friends Will Go Hang Out Later
  • Similar (SELECT)
  • Friends (FROM)
  • Will (WHERE)
  • Go (GROUP BY)
  • Hang (HAVING)
  • Out (ORDER BY)
  • Later (LIMIT)
Here is also a weird email I made for an low-rent Email-app I have to make for CS50W to keep your spirits up (maybe...), lmao:

1629706954226.png
 
Found a few more working through them now.


These tests mess with your mind because when you are on the clock they ask you the most BASIC thing and you are like "Nooo there must be more to it it can't be that easy" and then you sit there second guess yourself.
 
Don't think I've ever come across Binary Trees in SQL.

Question

Tutorial
 
I find it easier to read when they use the right case. We were taught at CTI using the correct casing and would lose points in tests if not adhering. This is early 2000's CTI when, not sure what it's like today.
I hope you had a more professional campus than we did. Ours sort of seemed like a dude at a bar and his drinking friends decided to start a college. And then of course making sure that the 'student advisors' had a minimum hotness level.
 
That’s a good thing if consistent. It’s a style guide. Upper case all the SQL reserved words.
same reason you don’t use random casing/conventions every time you declare a local variable
Personally i prefer the other way around. Lower case for reserved words and upper for my stuff. I find it easier to ignore the reserved words and focus on my stuff this way. Same reason maybe why many other programming langs have reserved words and statements lower and then vars and methods as camel case.
 
Personally i prefer the other way around. Lower case for reserved words and upper for my stuff. I find it easier to ignore the reserved words and focus on my stuff this way. Same reason maybe why many other programming langs have reserved words and statements lower and then vars and methods as camel case.

probably depends on the database too. Is there an existing database that already has tables and columns defined in one style or another? Are you using an ORM with code first and migrations, where it, in some instances, controls the table and column name style? Is the underlying database case sensitive with regards to table and column names?

these things are further assisted/mitigated by your tooling - as it is in an IDE. different things “look” different - reserved words, tables, columns, strings, numbers, etc.

The “correct” style is a consistent style :thumbsup:
 
I'm looking for some SQL string challenges. You know like Substring etc.

Here's a couple eg. Things like this. Give me your best shot guys!

Code:
--Return only the domain names from each email address.
SELECT SUBSTRING ([Email], CHARINDEX( '@', [Email] ) + 1, LEN([Email])) AS [Domain Name] FROM [Employee]

--Return only the email address up to and exluding the domain and exluding the @
SELECT SUBSTRING(Email, 1, CHARINDEX( '@', [Email] ) - 1) As 'Only email name' FROM [Employee]
 
Last edited:
I think would be better to find a special forum for this purpose. These software development teams use many different processes by mlsdev.com/services/custom-software-development. Often, however, these groups will use the same basic processes, such as using a common IDE (integrated development environment), using the same text editors (PCs), and using similar coding tools and style guides. However, there are some key differences between software development teams that make each group unique. Some of these differences include the size and reach of their respective staffs, the tools they use, and the number and quality of their projects. All of these differences have important consequences for the programmers and engineers who work on the software development teams.
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X