0 votes
in Python by
Explain ORM Query

1 Answer

0 votes
by
Consider the sample SQL statement used to retrieve employees whose income is 10,000.00.

SELECT * FROM EMPLOYEE WHERE INCOME=10000.00

The equivalent Django ORM query is

emps = Employee.objects.filter(income=10000.00)

The above code is written in Python and easy to read.

Such an ability to write Python code instead of SQL speeds up web application development.

Related questions

0 votes
asked Oct 11, 2021 in Python by rajeshsharma
0 votes
asked Sep 22, 2021 in Python by sharadyadav1986
...