chester89
chester89

Reputation: 8627

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

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.

Upvotes: 6

Views: 705

Answers (6)

Yordan Georgiev
Yordan Georgiev

Reputation: 5420

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#

Upvotes: 1

HLGEM
HLGEM

Reputation: 96552

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.

Upvotes: 1

chburd
chburd

Reputation: 4159

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

Upvotes: 4

Alnitak
Alnitak

Reputation: 339806

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.

Upvotes: 4

Marc Gravell
Marc Gravell

Reputation: 1062715

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.

Upvotes: 9

User
User

Reputation: 30945

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.

Upvotes: 20

Related Questions