Navicat Blog

Working with Dates and Times in MySQL - Part 3 Mar 14, 2022 by Robert Gravelle

Important Functions

In the first two installments of this series on Dates and Times, we covered MySQL's five temporal data types. Now it's time to turn our attention to some of MySQL's many date/time-oriented functions.

Getting the Current Date and Time

Back in May of 2021, we covered some of SQL Server's notable Date & Time functions, starting with how to obtain the current date and time. It offers the GETDATE() function for that purpose. MySQL's equivalent function is simply called NOW(). In Navicat for MySQL 16, we can invoke this function without connecting to a database, since we aren't selecting any table columns:

Working with Dates and Times in MySQL - Part 2: TIMESTAMP and YEAR Types Mar 4, 2022 by Robert Gravelle

TIMESTAMP and YEAR Types

Welcome back to this series on working with dates and times in MySQL. In the first two installments, we're looking at MySQL's temporal data types. Part 1 covered the DATE, TIME, and DATETIME data types, while this installment will cover the remaining TIMESTAMP and YEAR types.

Working with Dates and Times in MySQL - Part 1 Feb 25, 2022 by Robert Gravelle

DATE, TIME, and DATETIME Types

The vast majority of databases store a great deal of "temporal" data. Temporal data is simply data that represents a state in time. An organization may collect temporal data for a variety of reasons, such as to analyze weather patterns and other environmental variables, monitor traffic conditions, study demographic trends, etc. Businesses also routinely need to store temporal data about when orders were placed, stock refilled, staff hired, and a whole host of other information about their day-to-day business.

Some Useful MySQL Numeric Functions Feb 18, 2022 by Robert Gravelle

Back in May of 2021, we examined a few of SQL Server's Important SQL Server Functions. Now, it's time to turn our attention to MySQL to see what it offers us in terms of math and numeric functions. To see how they work in practice, we'll use them in queries that we'll run in Navicat 16 for MySQL.

Writing Exclusive OR Conditions in Relational Databases Feb 11, 2022 by Robert Gravelle

One of the key ingredients to writing effective SQL queries is the ability to articulate a wide variety of conditions using SQL syntax. One condition that gives both newbies and experienced database developers pause for thought is the Exclusive OR. Software programmers tend to be more familiar with the syntax for the Exclusive OR condition, probably because most programming languages support the XOR logical operator, whereas many databases do not.

In simple terms, the Exclusive OR condition is similar to the regular OR, except that, in the case of the Exclusive OR, only one of the compared operands may be true, and not both. In this blog, we'll learn how to express an Exclusive OR condition for a variety of databases, whether they support the XOR operator, or not.

Navicat Blogs
Feed Entries
Blog Archives
Share