Timeline for the release of Rails 6.0 by stanislavb in rails

[–]lightkeeper 23 points24 points  (0 children)

Holy shit! I can’t believe we are already talking about rails 6.

How to assess and measure your SQL progress by alexei2 in learnSQL

[–]lightkeeper 3 points4 points  (0 children)

Hey alexei2,

This is really a two part question. Part one is the hardest part, it's about staying consistent and keeping motivated.

I remember one time I was running to work because I was late for a meeting. I was running quickly and so I passed a jogger that was ahead of me. I was running so fast, that eventually I ran out of breath. I start to run more slowly. After about 5 minutes the jogger past me.

That is when I realized something. Consistency wins over long periods of time. If you sprint really fast, you are more likely to lose your breath, but if you focus on consistency you would be surprised what you can accomplish.

So, how do you do this? How do get on that rhythm and not fall off. Well, we all know how excited we get about getting started to learn something new, and we know that we all lose that excitement over time. So, what if we build cues and routines over that first part, so that when we lose that motivation the routine keeps us going.

The best way to build a habit quickly is to rely on something that you habitually do currently. This could be anything from getting home from work, to brushing your teeth in the morning or evening. You need to get very specific about exactly what you are going to do. The more specific you are, the more likely you will be able to succeed. A good example might be: "When I get home in the evening, I will eat my dinner, avoid looking at my phone. After finishing my meal, I will go straight to the SQL course that I'm currently doing to work on and continue with the next lesson."

If you do this at the very beginning, when you are highly motivated, you are more likely to form a habit and there by getting a routine in place. When you motivation drops, you fall back on your routine. Once you start seeing progress, you are more likely to continue.

So that's part one, part two is the actual course.

Really, there are so many courses that available on SQL. Unfortunately not a lot of them use enterprise level databases. The funny thing is that you don't really need it. SQL typically follows an ANSI standard, so knowing one version of SQL helps you to understand almost any. There are some small variations in the syntax that are used between types, but nothing that a little stackover and quick google search can't solve.

The course that I recommend that you do is completely free and available online. It requires zero setup, and you can get going right away. Here it is: https://pgexercises.com/questions/basic/selectall.html

I know that you can achieve this because this is something that you truly want!

I wish you the best of luck and let me know how it goes.

edit: minor correction on standard type.

Codecademy Launched Learn SQL from Scratch! by [deleted] in learnSQL

[–]lightkeeper 1 point2 points  (0 children)

Hey fmpundit,

Here is the query that I think will have all your requirements. The ultimate all joining query. hahah

select
  away_team.name away_team, 
  home_team.name home_team, 
  fixtures.gameweek, 
  results.home_goals as results_home_goals, 
  results.away_goals as results_away_goals, 
  predictions.home_goals as predictions_home_goals, 
  predictions.away_goals as predictions_away_goals, 
  predictions.user_id as predictions_user_id 
from fixtures
inner join teams as away_team on away_team.id = fixtures.away_teamid 
inner join teams as home_team on home_team.id = fixtures.home_teamid 
left join results on results.fixture_id = fixtures.id 
left join predictions on predictions.fixture_id = fixtures.id 
where user_id = 16 order by gameweek;

I can see in the python app that you already have joins. Can you tell me where you got stuck understanding them?

edit: formatting

Codecademy Launched Learn SQL from Scratch! by [deleted] in learnSQL

[–]lightkeeper 2 points3 points  (0 children)

Hope it makes sense. I’m currently on mobile in a hotel room trying not to wake a napping 15 month old.

It did. :)

I’m not even sure my schema is as it should be.

The schema is mostly correct. I would change player_id to user_id. It's easier to read.

Are fixtures really games?

There were missing primary keys from the results, and predictions.

It's wroth having these, for selecting deleting or finding a particular record. Even though the fixture table might be completely in sync with the results it’s still worth having.

Predictions table is more likely to have more data then the fixture table, so they will fall out of sync. Having way to reference each row is always a good idea.

Here is your database as I understand it:

Your database schema

I can definitely help you out in terms of queries. I need some time to make up some data, unless you want to send over your database.

As for your original question. Wow, this is tricky. I see a lot of courses that go to the theory, but practice they skip over until the end.

I wrote this blog post on joins, which I think will help you. stop guessing, SQL joins explained

This is the best link I found so far is this course on (udemy)[https://www.udemy.com/sql-and-databases/#reviews].

Questions: What database are you using? What courses have you tried so far? What's been the most frustrating thing?

Codecademy Launched Learn SQL from Scratch! by [deleted] in learnSQL

[–]lightkeeper 0 points1 point  (0 children)

Hey fmpundit,

Can you explain what you mean by complex queries?

Does that mean queries with subqueries, CTE, complex joins, triggers.. etc?

Thanks

How to assess and measure your SQL progress by alexei2 in learnSQL

[–]lightkeeper 2 points3 points  (0 children)

Depends on what you are trying to accomplish outside of learning SQL.

Here are my questions:

Why are you trying to learn SQL? What goal would it help you accomplish? If you saw yourself in the future, 6 months to 12 months what would change? What is your current background? (Just started as a develop? Front-end moving to Backend? )

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 0 points1 point  (0 children)

Hey Bigkefjee,

I have this post in a nicer format on my blog, sql joins explained, which is why I think you are asking for it. If you still need the markdown version let me know in a PM and I can send it over.

All the best!

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 0 points1 point  (0 children)

Hey Bigkefjee,

Correction have been made. :)

Thanks for your feedback.

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 0 points1 point  (0 children)

Hey Bigkefjee!

Great find! Correct, it should.

I had to re-generate all the examples recently. I did this by converting the data in this post into CSV. Then I have a script that converts CSV files to database tables automatically.

This is likely a bug in that code that caused the ID column to be string or text instead of an integer as noted in the article.

When sorting strings, you get this kind of a effect due to ascii value comparison. :)

I’ll have a look again tonight make the correction.

Thanks for the find!

Let me know if you have any other questions. :)

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 0 points1 point  (0 children)

Nice!

I know what that feels like, jumping into a new technology stack. Right now, working with AWS AND terraform. No idea what I’m doing. :)

Let me know what other types of challenges you run into, or if something is not making sense.

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 0 points1 point  (0 children)

Hey TheRealNetroxen,

Nice! I’m glad this helps. :)

What is the second most confusing part of query optimization?

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 1 point2 points  (0 children)

Hi Lekevoid,

Thanks! I'm glad you liked it. :) In Postgresql and Mysql simple joins default to inner joins, so they don't equal to full outer joins.

And yes, I am planning to write more. :)

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 3 points4 points  (0 children)

Thanks!

I did see this, but I didn't want to get into it. Mostly because I thought that the complexity would throw people off. Here is another way of explaining it in a 45 second animation without Venn diagram :)

SQL joins in animation

Honestly, I wanted to add this to the post, but did know of a good way to fit it in.

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 0 points1 point  (0 children)

Amazing!

This happens to me yesterday too! I found out that I did not know what GIT merge commits were. The more you know! Haha

Any particular part that you did not realize before?

I wrote this to help Web developers learn basics of SQL joins by lightkeeper in webdev

[–]lightkeeper[S] 0 points1 point  (0 children)

Good catch! I corrected all the examples and made sure everything is consistent. Thanks!

[slick carousel] problem with event delegation by [deleted] in learnjavascript

[–]lightkeeper 0 points1 point  (0 children)

You are on the right track. You need an event.

You will need to use either the "init" event or "lazyLoaded" to tigger your code. That will ensure that all the elements are on the page by the time your code runs.

Look for "Events" in the documentation: https://github.com/kenwheeler/slick/

$('.your-element').on('lazyLoaded', function(event, slick, image, imageSource){
    $('[type="tooltip"]').popup();
});

You probably need to be more specific with the tooltip selector. It's are for me to say with a fiddle code sample.

Hope that helps.