Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it a good idea to learn LINQ first, then SQL?

Tags:

sql

linq

I know that in most cases it`s more useful to learn more complicated technology/language and then easy one than vice versa.
But, actually, time to do university tasks is limited. If I first learn LINQ, then go for SQL, would it be hard for me to use and learn sql?
EDIT
The task I need to do is to work with database and get some data from it, so the question is almost about LINQ to SQL.

like image 632
chester89 Avatar asked Apr 09 '09 07:04

chester89


6 Answers

It is a bad idea.

And if today's universities teach you LINQ instead of giving you foundation to build your knowledge upon, I can only feel sorry and pity for their students.

Time is always limited. Don't waste it on things that are subject to constant change.

SQL will be there tomorrow, LINQ.... well who knows.

SQL is applicable anywhere, LINQ only in .NET world.

Either LINQ or something else, it will be easy to "learn" it afterwards. When you have the knowledge of SQL, it will just me a matter of hours/days/weeks, hardly longer.

like image 98
User Avatar answered Nov 17 '22 22:11

User


Well, the 2 things are very different. LINQ (in the pure sense) isn't actually related to databases at all - it can be used quite happily just with in memory objects, or against web services, etc.

If you are mainly interested in writing better .NET code, then learn LINQ - but learn it properly - perhaps pick up C# in Depth, for example - which covers it very well in the last few chapters.

If you want to know about databases, then sure: learn SQL (such as TSQL) - but understand the differences. Databases are good if you need to write enterprise software, but not necessarily if you just want to do simple tasks.

edit re edit to the question

If you are just getting simple data in and out of the database, then you probably don't need to know much about SQL. Just use LINQ-to-SQL (or whatever tool), and let the ORM tooling worry about it.

like image 34
Marc Gravell Avatar answered Nov 17 '22 21:11

Marc Gravell


Learn SQL first, then LINQ.

That way you'll understand how LINQ-to-SQL is working behind the scenes, but you'll also know enough to be able to cope when LINQ can't do what you need.

like image 27
Alnitak Avatar answered Nov 17 '22 22:11

Alnitak


SQL is a standard, learn the standard.

More precisely :

  • learn database theory

  • learn CODD algebra

  • then pick up a "common database", do some tutorials on it, ...

I personnaly really like PostgreSQL tutorial

like image 4
chburd Avatar answered Nov 17 '22 20:11

chburd


I submit that you cannot effectively use LINQ unless you have SQL knowledge. If you don't understand, at a minimum, the following, you cannot effectively query a database in any fashion:

select
insert
delete
update
joins
group by
boolean algebra
relational theory
set theory

Learning SQL will give you the concepts you need even if you use LINQ later.

like image 1
HLGEM Avatar answered Nov 17 '22 20:11

HLGEM


Sql. However you could play with linq pad for a while - it is a freeware and realize that LINQ is a nice hybrid between SQL and C#

like image 1
Yordan Georgiev Avatar answered Nov 17 '22 22:11

Yordan Georgiev