Navicat Blog

Filtering Aggregated Fields Using the Having Clause Oct 8, 2024 by Robert Gravelle

If you have been writing SQL queries for some time, you are probably quite familiar with the WHERE clause. While it has no effect on aggregated fields, there is a way to filter records according to aggregate values, and that is by using the HAVING clause. This blog will cover how it works as well as provide a few examples on using it in SELECT queries.

Writing SELECT Queries with EXISTS Sep 26, 2024 by Robert Gravelle

The SQL EXISTS operator offers us an easy way to retrieve data based on the existence (or non-existence) of some other data. More specifically, it's a logical operator that evaluates the results of a subquery and returns a boolean value indicating whether rows were returned or not. While the IN operator can be utilized for much the same purpose, there are some differences to be aware of. Today's blog will cover how to use the EXISTS operator using a few examples as well as provide some guidance as to when to use EXISTS rather than IN.

The Search For a Universal SQL Syntax Sep 12, 2024 by Robert Gravelle

In the mid nineties, Sun Microsystems came out with a language that you could "write once, [and] run everywhere." That language was, of course, Java. And, while it did go on to be one of the most popular programming languages until this day, their slogan turned out to be just a little optimistic. The course of the Java language does bear some strong similarities to that of SQL. It too can be ported from one database to another, or even across operating systems, with little or no modification. At least, that's the dream. In the real world, production-level code tends to require some tweaking in order to work in a new environment. This blog will outline some of the reasons that SQL syntax may differ across different database vendors.

Creating Custom Fields In Navicat BI: Calculated Fields Sep 6, 2024 by Robert Gravelle

It's a well established practice in database design and development to avoid storing any data that can be calculated or reconstructed from other fields. As a result, you may be missing some data when constructing your charts in Navicat BI. But that's not an issue, as Navicat BI provides Calculated Fields specifically for that purpose. In today's blog, we'll be using Calculated Fields to build a chart that shows the average rental times - i.e., how long a customer keeps a movie before returning it - per customer. As with most of the articles in this series, the data will be curated from the free "dvdrental" sample database.

Creating Custom Fields In Navicat BI: Custom Sort Orders Aug 23, 2024 by Robert Gravelle

In Navicat BI, data sources reference tables in your connections or data in files/ODBC sources, and can select data from tables on different server types. The fields in the dataset can be used to construct a chart. In fact, when building a chart, you will need to specify the data source that's used to populate the chart.

As we've seen throughout this series, data sources support custom field types. These include: Type-Changed, Concatenated, Mapped, Custom-Sorted, and Calculated. The last blog covered how to use Custom-Sorted Fields to sort chart data according to a reference field. This week, we'll be learning how to set an explicit sort order. In order to do so, we will create a Vertical Bar Chart for the free "dvdrental" sample database that shows a sum of movie rental proceeds by month.

Navicat Blogs
Feed Entries
Blog Archives
Share