Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was struck by the heading

Tired of querying in antiquated SQL?

on http://www.linqpad.net/.

I am a N-Tier application developer and learnt my trade in a company that worked with a lot of data, so became fluent with SQL, but mostly for DALs. My finacée is a SQL developer so I've had an exposure of the SS/SSAS/SSRS/SSIS suite too.

Other than the LinqPad team writing antiquated SQL themselves, or only using PROCs for application DALs rather then data heavy tasks, I can't think why the the LinqPad team think SQL is antiquated?

share|improve this question
    
Did you maybe email the linq pad team? I'm not trying to be sarcastic, it seems the - logical - first post of call. At a guess they're just trying for an eye catching way of saying "Look at this shiny new thing that lets you write queries right in you code!" –  Binary Worrier Jul 6 '11 at 10:56
1  
@Binary Worrier, my first thought was that they were being flippant to grab attention too, but maybe there are devs on here who think that SQL really is antiquanted. –  StuperUser Jul 6 '11 at 11:00
1  
@StuperUser, There are not only devs here who think it antiquated, they despise it and think that it and RDBMS are a fad. –  maple_shaft Jul 6 '11 at 11:10
    
@maple_shaft [citation needed] programmers.stackexchange.com/q/90024/12436 :) –  StuperUser Jul 6 '11 at 11:52
add comment

3 Answers

up vote 6 down vote accepted

SQL is obviously more than antiquate as it would have not existed for more the 30 years. That is not to say the SQL is the most optimized way to do everything but it is still a very powerful tool. While LINQ is a very useful tools and I greatly prefer it over SQL, I would still use SQL when I needed raw power as it give me completely control and full power of SQL.

As for why LinqPad uses the phase:

Tired of querying in antiquated SQL?

it is just a marketing technique.

share|improve this answer
1  
+1 "just a marketing technique". –  FrustratedWithFormsDesigner Jul 6 '11 at 13:40
add comment

SQL is antiquated. It is about the last English-like programming language still widely used.

SQL is a poor programming language, but it is a truly terrible API. The code needed to produce dynamic SQL is just silly complicated. If a join is involved then things really get ugly.

share|improve this answer
    
To me, dynamic SQL is just string concatenation with some sanity checks to ensure proper input. Could you explain what you mean by "silly complicated"? –  tylermac Jul 6 '11 at 16:34
    
@tylermac: Suppose you are building a list of conditions for the WHERE clause. You have to start with something like "WHERE 1=1" so that you can put " AND" before each clause. You have to have special handling if the value list for an IN clause is empty; "IN ()" is not valid SQL. If you are trying to get columns from multiple tables, you have to prefix the column names so the result columns have unique names, and then parse the column names in the result set, etc. –  kevin cline Jul 6 '11 at 16:53
    
@tylermac: if you are building SQL queries by validating and then concatenating user-supplied values, you better read about SQL injection bugs. Always, always, always use prepared statements and keep the data separate from the query. –  kevin cline Jul 6 '11 at 16:56
1  
Building a dynamic query always seemed to me to be poor use of the language? Are there really cases where it's impossible/truly too impractical to pass variables as parameters to appropriate procs? –  StuperUser Jul 6 '11 at 20:24
    
@StuperUser: suppose the user can filter by any combination of five columns a,b,c,d,e. The user supplies values for a, c, and d. What can you do besides build a dynamic SQL query "WHERE a = ? AND c = ? AND d = ?" ? Either the application code has to build a query, or the stored proc does. Either way it's ugly. –  kevin cline Jul 6 '11 at 22:07
show 2 more comments

SQL is a truly awful and inadequate language by modern standards. It has endured mostly because it has been supported by the three DBMS mega-vendors with vested interests in maintaining the status quo - not because it has any great merits for its customers.

Problems with SQL and its implementations include: inconsistent and highly redundant grammar; lack of strong typing; duplicate rows; inconsistent and wrong results with nulls and three-value logic; poor support for constraints and referential integrity; poor data independence; lack of extensible type support; lack of support for basic relational operations like assignment and comparion; incomplete support for keys and key inheritence. This is by no means a complete list.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.