Navicat Blog

The SQL Semi Join Oct 15, 2024 by Robert Gravelle

Most database developers and administrators are familiar with the standard inner, outer, left, and right JOIN types. While these can be written using ANSI SQL, there are other types of joins that are based on relational algebra operators that don't have a syntax representation in SQL. Today we'll be looking at one such join type: the Semi Join. Next week we'll tackle the similar Anti Join. To gain a better understanding of how these types of joins work, we'll execute some SELECT queries in Navicat Premium Lite 17 against the PostgreSQL dvdrental database. It's a free database that's based on the MySQL Sakila Sample Database.

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.

Navicat Blogs
Feed Entries
Blog Archives
Share