Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between sql and linq?

user-image
Question added by Lana Oudeh , PR Coordinator , Al Ghanem
Date Posted: 2018/05/27
Tom Wilson
by Tom Wilson , Director Data and Analytics Integration , BMO Financial Group

Hi Lana,

The short answer is this: Unless you expect to be working in a .NET environment, I'd suggest learning SQL because it is universally used, but LINQ is really only within .NET, and it's definitely not the standard for web development.

I don't know what level you're at in terms of your learning, so I'll play it safe and assume you're just getting into this and start at the beginning.

You have indicated that you want to get into Web Development so lets start with that.

When we look at web development in general, there is front end (basically what will be directly shown in the web browser) and back end (servers that read data and incorporate that into front end pieces to send back).

From a front end perspective, The foundational technologies to learn are HTML, CSS and Javascript (note Javascript is not Java). 

From a back end perspective, there are many different choices like Java, .NET, PHP and probably many others. Each of them will likely work with some kind of SQL.  PHP is likely the de facto language for back end web development (80% of websites in the world run it) but it has a similar syntax with other languages so it's not like you'd have no idea what the language is doing if you're used to something like C++ or C#.

SQL has been around for almost 50 years and in my 20 years working with Databases, I've 100% of the time needed SQL and 0% of the time used Linq. SQL will not disappear, and if you choose to use Linq, just remember that Linq is meant to replace SQL in .NET so learning SQL means you're already well on your way understanding the concepts in Linq.

Deepak  Singh
by Deepak Singh , IT Head , Edgetelecom

  1. SQL Stored Procs are pre-compiled sql statement while LINQ has queries bonded and written with some programming language

 

SQL is a comprehensive specialized language which defines data querying, data manipulation, and data control components; in other words, it is not only a querying language but a functional definition for relational database design.

LINQ, on the other hand, is just a querying language; more specifically, it’s a language extension to .NET languages which allows for more-or-less format-agnostic querying of data sources ranging from SQL databases to XML files to .NET Objects.

 

LINQ to SQL allow you to query and modify SQL Server database by using LINQ syntax. Entity framework is a great ORM shipped by Microsoft which allow you to query and modify RDBMS like SQL Server, Oracle, DB2 and MySQL etc. by using LINQ syntax. Today, EF is widely used by each and every .NET application to query to database. The difference between LINQ to SQL and EF is given below.

Reshmy P P
by Reshmy P P , .NET Software Developer , Karma technologies LLC

Language-Integrated Query (LINQ) is an innovation introduced in the .NET Framework version3.5 that bridges the gap between the world of objects and the world of data.

You can write LINQ queries in C# for SQL Server databases, XML documents, ADO.NET Datasets, and any collection of objects that supports IEnumerable or the generic IEnumerable<T> interface. 

Structured Query Language (SQL) is a domain-specific language used in programming and designed for managing data held in a relational database management system (RDBMS),

 

Abdul Rouf
by Abdul Rouf , Full Stack .Net Developer , Priority Express Laundry

What exactly do you mean?

SQL is a comprehensive specialized language which defines data querying, data manipulation, and data control components; in other words, it is not only a querying language but a functional definition for relational database design.

LINQ, on the other hand, is just a querying language; more specifically, it’s a language extension to .NET languages which allows for more-or-less format-agnostic querying of data sources ranging from SQL databases to XML files to .NET Objects.

So, are you asking whether SQL queries or LINQ queries have better performance when querying a SQL Server database? Or are you asking which is faster to implement?

ABDUL HAMEED MOHAMMED SALEEM
by ABDUL HAMEED MOHAMMED SALEEM , IT Technical Support , Gulfsat communication Co.

The only difference is that the objects referenced in your queries are mapped to elements in a database. LINQ to SQL translates the queries you write into equivalent SQL queries and sends them to the server for processing. More specifically, your application uses the LINQ to SQL API to request query execution.

MELOVER  RETARDO
by MELOVER RETARDO , CIVIL ENGINEER/SITE ENGINEER /AUTOCAD DRAFTSMAN , LOCAL GOVERNMENT UNITS , PHILIPPINES

The only difference is that the objects referenced in your queries are mapped to elements in a database. ... More specifically, your application uses the LINQ to SQLAPI to request query execution. The LINQ to SQL provider then transforms the query into SQL text and delegates execution to the ADO provider.

Mohammad Shahabuddin
by Mohammad Shahabuddin , Marketing and Sales Executive , Active Group

I certify that the curriculum vitae made by me in which all information are true, complete and correct to the best of my knowledge and belief. I am also prepared to send any documentary evidence if the organization have been asked.

Kapil Vyas Kapil Vyas
by Kapil Vyas Kapil Vyas , Associate Tech Lead , SSE

Linq is generalized query language, using linq you no need to take of what DB you are interacting, but Sql is a DB dependent. If you are using Sql Server then you have to write Sql Server queries to do DB operations, if you are using My Sql then DB operations queries are different.

Mohamed Nasrallah
by Mohamed Nasrallah , Senior Programmer , albaha university

they are two apps to build database they are different in use and commands sql is more easier 

Samar Khan
by Samar Khan , Data Engineer , Google Cloud India Pvt Ltd.

SQL - Structured Query Language  - Used to query only SQL databases

LINQ - Language Integrated Query - query an in-memory collection. Can be SQL or Oracle or Db2. Strongly typed. LINQ follows either query syntax or method syntax.

ANTONY JOSEPH
by ANTONY JOSEPH , Trainee Engineer , Shipping Corporation Of India

SQL is allowed to quire and LINQ is modifiy the quire

More Questions Like This