0

I'm just starting out with SQL Server 2008 Express and spent the last hour or so trying out some basic queries. How does SQL scripting (correct term?) compare to general computer programming? Is writing SQL queries as involved, lengthy to learn, needs as much practice, etc. as software development? Is writing advanced SQL queries comparable to software development, at least to some degree, and if so could you explain that?

Also, I found a couple of tutorial and reference sites for learning SQL but could you also recommend some other sites.

Also(2), I was playing around with the SQL query designer in SQL Server and it seems like a good tool to learn writing SQL commands, but is there a way to use the designer to INSERT data. it seems that it's only for SELECT ing data.

Any other general comments for learning, better understanding, etc SQL would be appreciated. thanks

2
  • 1
    There isn't a 2010 version of SQLServer. Which version are you using? Commented Jul 22, 2010 at 2:58
  • whoops.. 2008 express edition. Commented Jul 22, 2010 at 4:20

2 Answers 2

4

SQL is a declarative language and it primarily deals with sets.

As such it it very different from procedural languages.

I would say it is somewhere between procedural languages and functional languages in terms of style.

I would recommend Joe Celko's books, this one by Hernandez, and this one by Bowman.

In SSMS, you can paste data into a table (usually from Excel).

Typically no users enter data through SSMS, usually loading data using a tool like SSIS.

You can INSERT data using INSERT INTO tbl VALUES (x, y, z), and SQL Server 2008 has a multi-row insertion ability through row constructors: INSERT INTO tbl VALUES (x, y, z), (a, b, c)

Sign up to request clarification or add additional context in comments.

1 Comment

In addition, right-clicking the query designer will pop up a menu with the 'change type' option, which will allow you (often) to start building the query as a SELECT, and turn it into an INSERT later.
0

Cade's answer is good. I'd like to add that (advanced) SQL is a slightly different mindset - one where you play with sets, indeed (check out mathematics manuals for the basics, if you like). It's possible to generate really advanced SQL queries, resulting in very complex sets, but often you'll find you'll want a stored procedure at some point (even if just for legibility). Once you're at that point, it becomes much more like traditional programming.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.