Navicat Blog

Find Customers Who Have Purchased More Than <i>n</i> Items Within a Given Timeframe Jul 18, 2022 by Robert Gravelle

Part of knowing your business is tracking sales metrics such as units sold and identifying your best customers. To that end, you'll probably want to begin with fetching data about customers who've made the most purchases throughout the month, quarter, year, or other time period. This data will allow you to analyze their buying patterns and identify trends. This blog will present a few sample queries to do that by combining the mighty Count() function with the GROUP BY and HAVING clauses.

Selecting Odd or Even Numbered Rows From a Table Jul 8, 2022 by Robert Gravelle

Having to select only odd or even rows from a table sounds like something that you'd never have to do, that is until you do. A quick Google search confirms that it's something that is done often enough, but, with few database practitioners knowing how, they invariably turn to online database communities in search of answers. As a reader of this blog, you can save yourself the trouble of scouring database forums for a solution, as we'll set the record straight right here today.

Exporting MySQL Tables to CSV Jun 10, 2022 by Robert Gravelle

A CSV is a Comma-Separated Values file, which allows data to be saved in a tabular format. It's long been the preferred format for transferring data between databases. More recently, Internet-driven formats such as XML and JSON have also gained much traction. CSV files are well suited to databases because they represent table data exceptionally well and can be used with just about any spreadsheet program, such as Microsoft Excel or Google Spreadsheets. In today's blog, we'll be taking a look at a few ways to export table data to CSV in MySQL.

How to Test Insert and Update Statements before Executing Them Jun 2, 2022 by Robert Gravelle

In some cases, running a well crafted UPDATE statement in production can save the day. Other times, a botched UPDATE can cause more harm than the initial issue. You can always execute your Data Manipulation Language (DML) statements on a development or test database, but due to differences in the data, this approach makes determining the statement's effects on the production data a craps shoot at best.

So what are some options to accurately predict what the result of an INSERT, UPDATE, or DELETE statement will be on production data before running it? Well, that depends on the database vendor and product, at least in part. There are also some solutions that enjoy widespread support. We'll be taking a look at both options in this blog.

Nested Joins Explained May 26, 2022 by Robert Gravelle

Just when you thought you knew every type of join, here comes another! Perhaps you've heard of nested joins, or even nested-loop query plans, and wondered what they were. Well, wonder no more. Today's blog will settle the mystery once and for all!

Navicat Blogs
Feed Entries
Blog Archives
Share