Jump to content
House Price Crash Forum

Archived

This topic is now archived and is closed to further replies.

interestrateripoff

Need A Crash Course In Sql Any Tips

Recommended Posts

There appear to be a few programmers on here do we have any SQL experts who can recommend a crash course in this subject. I've been asked to demonstrate I can learn this so if anyone on here can offer where to start that would be useful. My knowledge level on this is currently zero.

Share this post


Link to post
Share on other sites

You can't do a "crash" SQL course. It's very different from how "programmers" think! :unsure:

Share this post


Link to post
Share on other sites

There appear to be a few programmers on here do we have any SQL experts who can recommend a crash course in this subject. I've been asked to demonstrate I can learn this so if anyone on here can offer where to start that would be useful. My knowledge level on this is currently zero.

Although there is an ANSI standard SQL comes in quite a few variants depending on database etc so it would help to know which one is involved ?

In addition while SQL statements can be executed singly there are also quite a few proprietary procedural SQL languages PL/SQL , T-SQL etc which enable quite complex routines to run.

SQL can also vary from simple statements such as 'SELECT * from TABLE A' to highly complex joins, subqueries, predicates, sorts etc

If you have an upto date Windows Machine (version 7 or later) with access to MS ACCESS as part of an office package that is probably the best place to start

Alternatively you can download install a free version of SQL Express from Microsoft which would give you access to a cut down version of their main Database Management system. It has a Management Studio with a built in run time environment you can use to run queries

There are loads of other free database variants out there but you will probably find more help available online for the MS ones than most of the others

My advise would say start with Access and get a basic instructional book like Access for Dummies and simply work through the exercise

though I warn you it is quite a hefty tome.

Share this post


Link to post
Share on other sites

Hmm maybe I just use very simple SQL, or maybe it's just cause I'm a programmer for a living - but I actually think learning SQL from scratch would be easier than learning MS access from scratch, and would be more powerful.

selects, conditions within selects, aggregate/group functions, sub-selects,joins, deletes/updates....if someone knows those few things isn't that pretty much what most people are going to use SQL for in the first place?

I don't have any examples of good tutorials but it's the sort of thing I could explain the basics of to a newbie very quickly, so someone must have posted a comprehensive into tutorial on youtube?

Share this post


Link to post
Share on other sites

Do you need to learn SQL (structured query language) or are they using the common short hand for SQL-Server, a database platform?

If the language, how good do they expect you to be? "Learning SQL" is a bit of a "how long is a piece of string" question.

I'd steer clear of MS Access - it does everything in its power to stop you using SQL.

Get a free version of MySQL or similar - or Oracle express edition. Set yourself a challenge, because just learning from books is a pain. Say - get the log file from a web server, couple of million records. Learn to load it in the database, use create table statements to make somewhere to put it, use select statements to clean up the data. How many records do you have? (select count). How many records with a certain characterisic (select count where). Average reponse time? Average response time per page (group by etc).

Don't know what challenge is appropriate to your line of work, but that is the way I learn new stuff.

Share this post


Link to post
Share on other sites

Do you need to learn SQL (structured query language) or are they using the common short hand for SQL-Server, a database platform?

If the language, how good do they expect you to be? "Learning SQL" is a bit of a "how long is a piece of string" question.

I'd steer clear of MS Access - it does everything in its power to stop you using SQL.

Ha ha! Yes! :huh:

Share this post


Link to post
Share on other sites

Hmm maybe I just use very simple SQL, or maybe it's just cause I'm a programmer for a living - but I actually think learning SQL from scratch would be easier than learning MS access from scratch, and would be more powerful.

selects, conditions within selects, aggregate/group functions, sub-selects,joins, deletes/updates....if someone knows those few things isn't that pretty much what most people are going to use SQL for in the first place?

I don't have any examples of good tutorials but it's the sort of thing I could explain the basics of to a newbie very quickly, so someone must have posted a comprehensive into tutorial on youtube?

I agree that for programmers Access often looks a bit of a chore but it is what a lot of non professional SQL developers cut their teeth on and it is what a lot of smaller businesses still use. Moreover many people have it already as part of an Office Suite so there is no install to go through

Whatever way you go you have to use a relational database so it would pay to choose one that is simple to install and which comes with a relatively friendly interface in which to run queries.

As I mentioned SQL Server Express is pretty easy to install and Management Studio gives a user interface that is relatively easy to use. There is also a sample Adventure Works database supplied that is useful for trying out queries though unhelpfully MS no longer install it by default

I am no fan of MS at a professional level but for newbies there really is a ton of support out there online for their stuff.

Alternatively there is MYSQL which runs on a host of platforms and also has loads of support.

https://dev.mysql.com/usingmysql/get_started.html

Share this post


Link to post
Share on other sites

I used the Sam's 21 days sql books back in the old days.

But do check on rxes point about whether it is just sql the language or sql server the platform.

Either way there is likely to be a Sam's 21 day course that you can whizz through in a week.

Share this post


Link to post
Share on other sites

I'd also recommend Access as a good starting point. The Query By Example grid interface is good for visually creating a query and then examining the SQL created. It supports 'action' queries (inserts, updates, deletes) too.

It is also quick and easy to create and populate a small database to use for testing.

I would recommend learning about normalization and data modelling first so you understand the fundamental principles upon which the databases you will be querying are (hopefully) based.

Share this post


Link to post
Share on other sites

A few posters have suggested MS Access as a good starting-point, and that's exactly where I started.

Having said that, I would recommend anybody wanting to start learning SQL nowadays to avoid that route like the plague. If you didn't grow-up with Access, it'll just confuse you.

If however, you have grown-up with Access - and are reasonably adept at using queries - then the "View SQL" option in the query design view can make the penny drop a lot quicker than any training-course or book ever will.

In my opinion like...

XYY

Share this post


Link to post
Share on other sites

I'd also recommend Access as a good starting point. The Query By Example grid interface is good for visually creating a query and then examining the SQL created. It supports 'action' queries (inserts, updates, deletes) too.

It is also quick and easy to create and populate a small database to use for testing.

I would recommend learning about normalization and data modelling first so you understand the fundamental principles upon which the databases you will be querying are (hopefully) based.

+ 1

For the mention of data normalisation and modelling

If you get the data structures, primary keys and foreign keys etc in the tables right then you dont need to right fancy SQL queries.

That is one area where the visual design features of Access is useful since you can make the relationships graphically , save the query and then view the raw SQL.

In fact if you can model to third normal form that will put ahead of over 50 % of supposedly professional developers out there who as far as I can see design systems that then rely on heavily denormalised data structures, programming gymnastics and outer joins to other outer joins with sub queries added etc to get the data back. They then have the nerve to complain to the the DBAs/System Admins because their applications are running slowly when they try to run it on anything that contains more than 1000 rows in a table. If the SQL looks complex then chances are that the basic database design is flawed

Share this post


Link to post
Share on other sites

Learning to write simple SQL statements should be fairly straightforward. When looking at the SELECT statement, probably the most often used, it's just a way of collecting information from different sources(tables), combining it together,applying filters, setting limits and sorting it.

It takes a bit of getting used to, if you are used to traditional programming, in that it's like trying to do everything all in one go, with just one statement (obviously there is kind of a logical order within the statement). Where as when you program its usually the case that you do it in a logical order, one statement at a time. With SQL, statements can get rather complicated, quite quickly when you start joining multiple tables together. They can get so large that they become unwieldy, and sometimes you have to destruct them into their component parts so you can make sense of what it's trying to do.

Writing simple statements should be fairly easy to pick up. But...... writing complex queries, and most importantly, knowing how to tune those queries, perhaps with the odd hint here and there, is an art form. Watching people construct complex statements on the fly is a sight to behold :)

Share this post


Link to post
Share on other sites

Gte a bix - a cheap Intel nuc, put BSD and postgreqsl on it and start from there.

Get the python SQL bindings are you should be OK.

Share this post


Link to post
Share on other sites

Hmm maybe I just use very simple SQL, or maybe it's just cause I'm a programmer for a living - but I actually think learning SQL from scratch would be easier than learning MS access from scratch, and would be more powerful.

selects, conditions within selects, aggregate/group functions, sub-selects,joins, deletes/updates....if someone knows those few things isn't that pretty much what most people are going to use SQL for in the first place?

I don't have any examples of good tutorials but it's the sort of thing I could explain the basics of to a newbie very quickly, so someone must have posted a comprehensive into tutorial on youtube?

The people who made MS access are stnuc and should burn in hell.

Share this post


Link to post
Share on other sites

I've used CODEcademy for learning ruby, they do a SQL course.

https://www.codecademy.com/learn/learn-sql

Yeah I would highly recommend code academy for this.

All the basic CRUD stuff is easy. It is the joins that are complex to know what does what and what impact they have on performance. It is quite subtle. Also worth learning a bit about indexes and how you would use them to improve performance.

Why do you need to learn SQL? As a developer you often don't get too involved in writing SQL unless that is your speciality and you may even have tools that hide database access from you like Hibernate in Java. In years of development I've mainly been involved in sorting out performance issues from SQL written by "experts" that didn't work well and doing a bit of CRUD. Perhaps more important is an understanding of RDBMS theory which the Wiki page gives a good intro to.

https://en.wikipedia.org/wiki/Relational_database

Share this post


Link to post
Share on other sites

OK if it is to worn on sql server treat yourself to a copy of sql server developer edition. Last I looked it's about 25 quid.

Also see if you can get Sam's sql server in 21 days.

Note that the current version of sql server is 2014 so it will be less confusing if you get the book to match.

Also check out sqlservercentral.

Share this post


Link to post
Share on other sites

Yes. Before you start learning queries. I would suggest a course in database design.

My (limited - so I'm not going to recommend anything for the OP) experience with SQL is that it's very easy to do badly without knowing why. Much more so than in (normal) programming languages.

Share this post


Link to post
Share on other sites

My (limited - so I'm not going to recommend anything for the OP) experience with SQL is that it's very easy to do badly without knowing why. Much more so than in (normal) programming languages.

Ha ha! And I have had to fix it! :blink:

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Next General Election   94 members have voted

    1. 1. When do you predict the next general election will be held?


      • 2019
      • 2020
      • 2021
      • 2022

    Please sign in or register to vote in this poll. View topic


×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.