Linear regression is a regression model which tries to predict the relationship between the dependent variable Y and independent variable X in a linear fashion.

y=mx+c

It is a regression models which mean that it is used to predict continuous values.

Eg: Stock prediction, Insurance amount prediction, Loan amount Prediction…

Sorting given data in ascending or descending order makes it easy to comprehend.

By using ORDER BY clause SQL provides an option to sort the result by given column in ascending (ASC)or descending (DESC)order.

LIMIT and OFFSET clauses helps in further optimization.

The LIMIT will reduce the number of rows to return, and the optional OFFSET will specify where to begin counting the number rows from.

Let’s create a table.

CREATE TABLE Enrollment(Id int, StudentName Varchar(30), DOJ int);
insert into Enrollment values(1,’Preet’, 2009),(2,’Aman’, 2011),(3,’Bharathi’, 2003),(4,’Ishan’,2003);

select * from Enrollment;
— Sorting Date…

Lolithasherley

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store