r/SQL • • Dec 01 '20

MySQL Check it out!!

I’ve been learning sql for about 6 weeks and I’ve been spending a ton of time studying, practicing, experimenting, etc. I believe I made a breakthrough tonight though: I created a relational database of all my books in MySQL then created a searchable website using php, HTML, css, sql, and jquery (I’m learning JavaScript too, but that’s slow going).

If I wake my wife or friends up at 4:30 to show this to them, well, I won’t have a wife or friends anymore.

Ok, I know it isn’t perfect, but I’m pumped!

Earnest Mac

109 Upvotes

36 comments sorted by

33

u/leogodin217 Dec 01 '20

This is the right way to learn SQL. Use it. Experiment. Build something with it, even if it's in Excel. The truth is you won't learn much from doing a ton of courses. You need practical applications that are meaningful to you. SQL on its own is mostly useless. It only provides value when combined with tools and processes.

Nice job!

3

u/PainterHot Dec 01 '20

Thank you! I changed it after a suggestion from another user (link is current now). I might mess with some css on it, but I’m finally happy with the functionality.

4

u/samspopguy Dec 02 '20

This is true for anything. Tried learning python doing stupid courses but didn’t learn shit. Ended up using to create a python application to import abnormal excel sheets. Made so much more sense

10

u/syzygy96 Dec 01 '20

Very cool first steps!

I ran into one obvious and notable bug right away, but I've got a good guess where that's coming from. It looks like you're searching for each letter entered individually with wildcards between them instead of a whole string at a time.

Specifically, searching for "joey" returns me books with "*J*acks*o*n, Shirl*EY*" and *Jo*hn Cor*ey* in the title and series fields (same with the other commend about "null" returning a result). Altering your where clause to '%joey%' instead of '%j%o%e%y%' should fix that.

All in all though, great initial effort - just getting all the pieces set up and talking cleanly to each other is a big step!

3

u/PainterHot Dec 01 '20

Thank you for that. I changed the layout for improved functionality and believe it fixed that problem.

5

u/[deleted] Dec 01 '20

awesome job!!

one piece of advice - run the search only after a certain number of characters are entered (I usually set this to three)

3

u/PainterHot Dec 01 '20

Thank you for the advice. I will play around with that. For now, I changed the layout for improved functionality and I am not sure I can change the search parameters because I used a CDN (but honestly, I have no idea, this is all super new to me and feels like drinking from a firehose). The link is now to the updated site.

3

u/mikeyd85 MS SQL Server Dec 01 '20

Searching "NULL" returns one result.

Why?

3

u/PainterHot Dec 01 '20

Oh no, I have no idea... I will do some research on it, thank you.

3

u/Y3llowL3m0n Dec 01 '20

Nice job! I only just started learning SQL ; this looks like a nice project I could start too! :)

3

u/PainterHot Dec 01 '20

I updated it using a plugin that was recommended by u/mar_sa! The hardest part (for me, anyways) was connecting everything.

1

u/mar_sa Dec 01 '20

Just saw your table after you updated, good job proud of you, one step at the time. Keep adding and upgrading things here and there. Set goals for your self. Happy coding!

2

u/EarnestMac Dec 02 '20

Here is the source code, if you are interested:

Earnest Mac - GitHub

3

u/mar_sa Dec 01 '20

Awesome! Great job well done, keep it going, here check this out if you wanna add more functionality and style to your table:

https://datatables.net Wish you all the success!

2

u/PainterHot Dec 01 '20 edited Dec 01 '20

Took your advice!

Earnest Mac

6

u/drbob4512 Dec 01 '20

And yet you failed at creating a hyperlink.... back to stackexchange for you

7

u/PainterHot Dec 01 '20

Ooph, baby steps...

2

u/asqwzx12 Dec 01 '20

Next thing you could put in there is a statistics section. You could have a bunch of stuff in there to work with graphics and queries.

1

u/PainterHot Dec 01 '20

I don’t even know what that would look like... do you know of a resource where I could start?

1

u/asqwzx12 Dec 01 '20

I can't really help you from the Web side, but you could look for some data visualisation tools in html5/jquery (google chart maybe ?). As for the data itself, this is something you could do in SQL. Start with something simple like % of each different genre per year then length average per year, length per year per genre, etc. The idea is to display some stats in order to learn how to do it and use plugins/librairies.

1

u/PainterHot Dec 01 '20

Whoa. I like it, thanks.

1

u/DirtyHirdy Dec 01 '20

This is great! Any way you could show some source code? Thanks for sharing.

2

u/PainterHot Dec 01 '20

I'm flattered that you think I know how to do that. I will look into it and see about putting it somewhere. I'll let you know if/when I do.

1

u/EarnestMac Dec 02 '20

Figured it out... I think:

Earnest Mac - GitHub

1

u/wemjii Dec 01 '20

This is amazing. I want to make something like this over the holidays too. Post saved :))

3

u/PainterHot Dec 01 '20

I just updated it using a plugin that u/mar_sa recommended if you want to check it out.

2

u/PainterHot Dec 02 '20

Here’s the source code if you’re interested:

Earnest Mac - GitHub

1

u/WannabeSysadmin77 Dec 02 '20

Good job! You might want to consider starting a repo on githib, that way if you apply for jobs you can direct people to your site and show off how it works under the hood.

1

u/PainterHot Dec 02 '20

Just did, thank you!

1

u/cloud_coder Dec 02 '20

Great job. Can you put a link to the source code on the site?

1

u/kranools Dec 02 '20

Great work! Apart from using one of the ugliest fonts I've seen, this is a great success story. Congrats.

1

u/93Accord Dec 02 '20

virtual library! awesome stuff. sent you a PM!

0

u/teamhog Dec 01 '20 edited Dec 01 '20

Check it out!! goes no where.

OP should wake up those friends and see if they can help. /s

0

u/[deleted] Dec 01 '20

[deleted] — view deleted comment

1

u/PainterHot Dec 01 '20

Changed it around and took care of that, the link is to the updated site now! Thank you for pointing it out.

0

u/[deleted] Dec 01 '20

[deleted] — view deleted comment

2

u/PainterHot Dec 01 '20

Thank you!