How to re-order a comma-separated list in Oracle SQL

Suppose you have a comma-separated list composed of numbers and you want it sorted in order from smallest to largest. Continue reading and see a working example I came up with as I continue studying Oracle SQL…

(more…)

How to Rename an SQL Table

There are a number of reasons why you may need to rename a table in your SQL Database. Whatever the case may be, the process is super-easy. In this post, I share 2 different ways you can rename an existing table in the Oracle Database. Continue reading and learn how…

(more…)

MySQL Searched CASE Expression – with examples

During many decision-making phases in programming code (conditional logic), there are times execution depends on several different factors. Multiple conditional tests are powerful and constraining, oftentimes requiring more than one test to be passed in order for program flow to proceed. For MySQL (and standard SQL in general) the CASE expression is used for IF/THEN/ELSE conditional logic. The post, MySQL Simple CASE Expression – with examples, covered Simple CASE queries which are essentially equality tests. MySQL Simple CASE is but one variant of 2, with the other being a MySQL Searched CASE Expression.  A MySQL Searched CASE Expression can have multiple conditional tests in each WHEN clause. These conditional tests can be AND/OR comparisons, BETWEEN value range tests, subqueries, IN() operators, and more. Continue reading to see examples of the MySQL Searched CASE Expression…

[Keep reading for more MySQL database and Python/PHP-centric content >>>]

MySQL Simple CASE Expression – with examples

Programming logic is foundational in any application or piece of software. Without it, software wouldn’t really do much of anything. Everything happens off of choice. In the end, some truthy or falsy value is what makes stuff work. For IF/THEN/ELSE logic in standard SQL, there is the CASE expression. There are 2 variations of the CASE Expression: Simple and Searched. In this post, I cover the Simple MySQL CASE expression with example queries…

[Keep reading for more MySQL database and Python/PHP-centric content >>>]

MySQL Column Aliases using the AS keyword

Be it running reports or displaying data in some other visualization, SQL SELECT column expressions should be meaningful and understandable. To provide those valuable query results, SQL Developers, use a multitude of available functions, adjacent columns, or other means not readily apparent to end-users. All that being said, the column names often suffer the most as far as readability is concerned, taking on long function call names or other combined expressions. But, as luck would be on our side, there is an easy fix and that is aliasing columns using the AS keyword. Although AS is optional – in this particular context – I err on the side of readability and use it when aliasing SELECT column expressions.

[Keep reading for more SQL database and PHP/Python-centric content >>>]