PostgreSQL offers a handy feature called domains that can greatly enhance data integrity and simplify database design. In this article, we’ll explore what domains are, how they work, and when to use them in our database projects.
Continue readingTag: what is
A Quick Look at the MD5() Function in PostgreSQL
In PostgreSQL, the md5()
function computes the MD5 hash of the specific text, and outputs the result in hexadecimal.
We pass the text as an argument when calling the function.
Continue readingSQL for Beginners: 10 Must-Know Concepts to Kickstart Your Database Journey
SQL stands for Structured Query Language. It’s the go-to query language for most of us who develop relational databases. If you want to work with relational database management systems, learning SQL is pretty much non-negotiable. Especially if you want to become a SQL developer.
If you’re interested in becoming a SQL developer, here are ten essential SQL concepts that you need to learn.
Continue readingA Quick Look at TO_HEX() in PostgreSQL
In PostgreSQL, we can use the to_hex()
function to convert a number to its equivalent hexadecimal representation.
The function accepts the number as an integer or bigint, and it returns the result as a text representation of its hexadecimal equivalent.
Continue readingIntroduction to the Enum Data Type in SQL
The Enum
(enumeration) data type in SQL is a specialised string object that allows us to define a list of predefined values for a column. This data type can be particularly useful when we want to restrict the possible values that can be stored in a specific column to a fixed set of options.
A Quick Look at the ASCII() Function in PostgreSQL
In PostgreSQL, we can use the ascii()
function to get the numeric code of the first character of the argument.
When using UTF8, the function returns the Unicode code point of the character. Other multibyte encodings require an ASCII character.
Continue readingSQL Truncate Explained
In SQL databases, the TRUNCATE
statement can be used to quickly remove all data from a table. Unlike the DELETE
statement, TRUNCATE
is typically faster and uses fewer system resources, especially for large tables.
In this article, we’ll explore the TRUNCATE
statement, its usage, and provide some examples.
Understanding PostgreSQL’s SPLIT_PART() Function
The PostgreSQL split_part()
function splits a string based on a specified delimiter and then returns the specified part from the split string.
The function accepts three arguments; the string, the delimiter, and the part that we want to return.
Continue readingA Quick Look at PostgreSQL’s PG_CLIENT_ENCODING() Function
In PostgreSQL, we can use the pg_client_encoding()
function to get the current client encoding name.
Understanding the RIGHT() Function in PostgreSQL
In PostgreSQL the right()
function returns the specified number of rightmost characters in a given string.
We have the option of specifying the number of characters to return from the right or the number of characters to omit from the left. We do this by specifying a positive integer (to return n number of rightmost characters) or a negative integer (to return everything except n leftmost characters).
Continue reading