You should absolutely know SQL and keep your knowledge up-to-date. ORM is designed to ease the pain of doing something tedious that you know how to do, much like a graphing calculator is designed to do something that you can do by hand (and should know how).
The minute you start letting your ORM do things in the database that you don't fully understand is the minute you've lost control over your model.
Its always a good think to learn the underlying language for stuff like Linq To SQL. SQL is pretty much standardized and it will help you understand a new paradigm in programming.
It is still important to learn SQL queries/syntax. The reason is you need to at least understand how Linq to SQL translate to the database behind the scenes.
This will help you when you find problems, for example something not updating correctly. Or a query performance needs to increase.
It is the same that you need to understand what assembly language is and how it eventually becomes machine language. However in all you don't have to be an expert, but at least be able to write in it and understand it.
In my opinion, knowing SQL is more valuable than any vendor specific technology. There will always be cases when those nice prepackaged frameworks will not be able to solve a particular situation and knowledge of advanced SQL will be required.
- You may not always be working in .NET.
- Doesn't hurt to know the underlying concepts.
- LINQ to SQL is not being maintained anymore in favor of the Entity Framework
It is still important to know SQL and the paradigm (set-based) behind it to be able to create efficient SQL statements, even if your using LinqToSql or any other OR/M.
There will always be situations where you will want to write the query in native SQL because it is not possible to write it in LinqToSql / HQL / whatever, or LinqToSql is just not able to generate a performant query for it.
There will always be situations where you will want to execute an ad-hoc query on a database using native sql, etc...
Sooner or later you will run into problems that need at leat a working knowledge of SQL to solve. And sooner or later you will run into requirements that are best realised in the DB (whether in SP-s or in triggers or views or whaterver).
I think LinqToSQL (or other Linq to SQL providers) should not prevent you of knowing SQL.
When your query is not returning what you expect, or when it takes 30 minutes to run on the production database, you'd better be able to understand what LTS has generated, and why it is failing.
I know, it's a rehashed topic, and it might not be applicable to what you do ("small" database that will never hit that kind of problem etc), but it pays not to get too oblivious of abstraction layers sometimes.
The other reason is, Linq does not the whole range of what you can do in SQL, so you might have to resort to writing "raw" SQL, even if the result is materialised as objects.
LINQ To SQL will only work with .NET. IF you happen get another job where you are not working with .NET, then you will have to go back to writing Stored Procs.
Knowing SQL will also give you a better understanding of how the server operates as well as possibly making you a better database designer.
It depends what you're working on, and from what you said it might make more sense to focus on other areas.
Having said that I find knowing SQL allows the following:
- The ability to write queries to extract data from systems easily. For adhoc queries, or for checking things.
- The ability to write complex stored procedures, which allows me to group complex data processing in one place, where it should be, in the database.
- The ability to fine tune LinqToSql by adding indexes, and understanding the SQL/query plan's it procedures.
Most of these are more of a help on more complex systems, so if you're not working on those it might not be as much of a help.
It may help in your situation to list the technologies which might be of use, and then prioritise them.
In order words make a development plan for yourself, which may encompass more then just learning technical knowledge but allow a more broad focus like design patterns, communication skills and other areas.
SQL is a tool. Linq to SQL is also a tool. Having more tools in your belt is a good thing. It'll give you more perspectives when attacking a problem.
Consider a scenario where you may want to do multiple queries or multiple updates to the db in one operation. If you can write TSQL you can potentially save yourself a lot of roundtrips to the database.
I would say you definately need to know your SQL in depth, because you need to know what code your Linq-expression generates and what effects the code will have if you want high performing queries. Sure you might get the job done in most cases, but sometimes there is a huge difference in performance in very subtle difference in Linq-syntax.
I ran into this this morning actually, where I had done .Any(d => d.Id == (...).First().Id) instead of doing where (...).Any(i => i.Id == d.Id). This resulted in the query executing five times slower.
Sometimes you need to analyze the actual Sql-query to realise the mistakes you make.
- If using LINQ to SQL is there any good reason to learn SQL queries/syntax anymore?
- Is there a good source that gives an overview of linq optimizations?
- Good way to time SQL queries when using Linq to SQL
- Simplify the following code to a one-liner using Linq queries
- Convert string to int in one line of code using LINQ
- Using LINQ extension method syntax on a MatchCollection
- Is there a C# LINQ syntax for the Queryable.SelectMany() method?
- Is there a good LINQ way to do a cartesian product?
- Is there a pattern using Linq to dynamically create a filter?
- C# Is there a LINQ to HTML, or some other good .Net HTML manipulation API?
- How to Convert LINQ Comprehension Query Syntax to Method Syntax using Lambda
- AsNoTracking using LINQ Query syntax instead of Method syntax
- Is there a LINQ syntax for the (T, int) overloads of Where and Select?
- Which is the best book out there to learn Linq, including Linq to Entities?
- Syntax to execute code block inside Linq query?
- Is it possible to accelerate (dynamic) LINQ queries using GPU?
- Is there some sort of syntax error with this LINQ JOIN?
- If it's bad to use inline SQL, how does using LINQ to perform queries differ in practice?
- Is there a neat way of doing a ToList within a LINQ query using query syntax?
- Is there a way to watch LINQ queries as they happen?
- Using expressions in the "Select" part of LINQ to entities queries
- SQL Query to LINQ syntax using not exist and join
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- Left outer join using LINQ -- understanding the code
- How to reuse a linq expression for 'Where' when using multiple source tables
- Is there a suggested pattern for using LINQ between the Model & DataAccess Layers in a DDD based Layered Architecture
- Is it a good idea to learn LINQ first, then SQL?
- Avoiding code repetition when using LINQ
- Using LINQ to delete an element from a ObservableCollection Source
- Is there a JS library that supports writing linq to sql queries with nodejs?
- IGrouping <decimal,string> does not contain a defintion for 'name'
- A question about interface inheritance in .NET
- How to convert a unicode in linq query?
- convert sql query to LINQ statement
- Merge 2 lists with linq where at least one property has changed
- How do I select all objects from a list that have no related objects in another list/model
- Finding the combinations of values in a dictionary of hashsets
- NullReferenceError with linq to PostgreSQL
- Why is IEnumerable losing updated data?
- Binding repeater to a record?
- Iterating DataView for Update
- Change Connection String from Application B for Application A
- Entity Framework 5.0. What is wrong with my Query?
- Count of duplicate items in a C# list
- C# find object in list using a object field
- Object Reference not set to an instance of an object (Mapping a List to Automapper)
- How do I correctly implement LINQ statement 'from x in collection'?
- How to use Contains() function if field value is null in linq
- Omitting duplicate row sets from Linq-to-SQL subquery
- How to create a simple left outer join in lambda expression in EF ASP.NET MVC5