Querying the data source using SQL
Querying the database is probably the second most useful feature of having database tooling built right into the IDE. As with many of the features in PyCharm, this one ensures you never need to leave PyCharm to get your work done.
There are several places that allow you to run queries. You can run ad hoc queries in a query console, or you can run queries directly from .
sql
files.
Ad hoc queries
Ad hoc queries are simply queries for an immediate purpose. An ad hoc query has a number of characteristics:
- Unplanned: Ad hoc queries are not part of a predefined set of queries. They are written on the spot to address a particular need.
- Temporary: They are used to retrieve data for a specific task or situation and are not saved for future use. They aren’t part of your application, though after some experimentation and tweaking, you might formalize them in your code.
- No optimization: Ad hoc queries might not be optimized for...