Showing entries 1 to 10 of 25
10 Older Entries »
Displaying posts with tag: MySQL Tutorial (reset)
MySQL CURRENT_TIMESTAMP() Function

This tutorial explains how to use the MySQL CURRENT_TIMESTAMP() function with the help of examples. By using it, you can convert or display the current date and time. The output format is either ‘YYYY-MM-DD HH:MM: SS’ format or YYYYMMDDHHMMSS, which depends on the context of the calling function, whether it is numeric or string. The function NOW() and CURRENT_TIMESTAMP() are equivalent of the CURRENT_TIMESTAMP. Please note that examples shown here will give results depending upon the present date. MySQL CURRENT_TIMESTAMP() This function provides a date and time value formatted in a ‘YYYY-MM-DD HH:MM: SS’ style. This function confirms to work

The post MySQL CURRENT_TIMESTAMP() Function appeared first on Learn Programming and Software Testing.

Grant Privileges on a Database in MySQL

This tutorial explains how you can grant privileges on a database in MySQL. It will introduce you all the steps beginning from connecting to MySQL and then accessing the MySQL commands to set the desired level of privileges. So, if you wish to grant or update the privileges in MySQL, first you should connect to the running MySQL instance. You may log in with a root user or as someone with the super user-level access. While you install the MySQL, it asks to set the root user password. And you need to keep it secure with you as it will

The post Grant Privileges on a Database in MySQL appeared first on Learn Programming and Software Testing.

MySQL FROM_UNIXTIME() Function

This tutorial explains how to use the MySQL FROM_UNIXTIME() function with the help of examples. By using it, you can convert or display a UNIX_TIMESTAMP value to a timestamp. The output format is either YYYY-MM-DD-HH-MM-SS or YYYYMMDDHHMMSS, which depends on the calling context of the function. It means that FROM_UNIXTIME() would return a string for a string and a number in a numeric operation. Please note that MySQL also has this function UNIX_TIMESTAMP(). It gives us a value in seconds since ‘1970-01-01 00:00:00’ UTC as an unsigned number. We are going to use the result of this function in our

The post MySQL FROM_UNIXTIME() Function appeared first on Learn Programming and Software Testing.

MySQL UPSERT | INSERT or UPDATE Whichever is Applicable

This tutorial explains about MySQL UPSERT command with the help of simple examples. An upsert is a smart operation which turns into INSERT or UPDATE whichever is applicable. Also, it is an atomic transaction, means complete in a single step. Let’s understand – If a record is new, then UPSERT triggers an INSERT. But, if it already exists, then UPSERT performs an UPDATE. MySQL provides the ON DUPLICATE KEY UPDATE option to INSERT, which accomplishes this behavior. However, there are other statements like INSERT IGNORE or REPLACE, which can also fulfill this objective. We’ll discuss and see all these solutions

The post MySQL UPSERT | INSERT or UPDATE Whichever is Applicable appeared first on Learn Programming and Software Testing.

MySQL Date and Date Functions

This tutorial explains about MySQL DATE data type and walks you through some of the standard date functions. It will help you use and handle dates more efficiently with MySQL. MySQL DATE is a temporal data type for accessing and setting dates by applications. It accepts DATE values only in YYYY-MM-DD format. And MySQL doesn’t allow to change it. The DATE format has three subfields: Year, Month, and the date value. And, they should appear in the given order. You won’t be able to use something like MM-DD-YYYY or anything of that sort. MySQL Date and Date Functions with Examples

The post MySQL Date and Date Functions appeared first on Learn Programming and Software Testing.

MySQL LOWER() and LCASE() Functions Explained

This tutorial explains MySQL LOWER()/LCASE() functions which convert the upper case characters of a string to the LOWER case. We’ll describe the functioning of this method with the help of simple examples. 1. LOWER()/LCASE() Syntax 2. LOWER()/LCASE() to convert text to lower case 3. LOWER()/LCASE() on table data 4. LOWER()/LCASE() on binary text Let’s now go through each of the section one by one. MySQL LOWER()/LCASE() Functions As stated initially, LOWER() is a built-in MySQL function which changes a string value to the LOWER case. So, let’s now see the details and check out how can we use it. Syntax

The post MySQL LOWER() and LCASE() Functions Explained appeared first on Learn Programming and Software Testing.

MySQL UPPER() and UCASE() Functions Explained

This tutorial explains MySQL UPPER()/UCASE() functions which convert the lower case characters of a string to upper case. We’ll describe the functioning of this method with the help of simple examples. 1. UPPER()/UCASE() Syntax 2. UPPER()/UCASE() to convert text to upper case 3. UPPER()/UCASE() on table data 4. UPPER()/UCASE() on binary text Let’s now go through each of the section one by one. MySQL UPPER()/UCASE() Functions As stated initially, UPPER() is a built-in MySQL function which changes a string value to upper case. So, let’s now see the details and check out how can we use it. Syntax Below is

The post MySQL UPPER() and UCASE() Functions Explained appeared first on Learn Programming and Software Testing.

MySQL ORDER BY with Simple Examples

This tutorial explains MySQL ORDER BY clause and its usage with both the ASC and DESC options. We’ll describe this MySQL statement with the help of simple examples. 1. ORDER BY Clause Syntax 2. ORDER BY W/O ASC or DESC 3. ORDER BY DESC 4. ORDER BY Relative Position 5. ORDER BY Two Fields ASC & DESC Let’s now go through each of the section one by one. MySQL ORDER BY Clause The MySQL SELECT command doesn’t return a sorted result set by default. Hence, to sort the output, you have to append the ORDER BY clause in the SELECT

The post MySQL ORDER BY with Simple Examples appeared first on Learn Programming and Software Testing.

MySQL Data Types Explained

This tutorial explains all MySQL data types, their characteristics, and min, max as well as possible default values. We’ll describe their usages so that you can use them efficiently for creating schemas and tables. A MySQL table can have one or more fields with specific data types such as a string or date. However, there are more available in MySQL to ease up your job of collecting and storing data. It is also crucial that you understand which data type should you use and when. Here are some standard goals that define them what do they represent: 1. The data,

The post MySQL Data Types Explained appeared first on Learn Programming and Software Testing.

MySQL TIMESTAMP with Simple Examples

This tutorial explains MySQL TIMESTAMP and TIMESTAMP field characteristics such as automated initialization and updating. We’ll describe their usages with the help of simple examples. 1. TIMESTAMP Syntax 2. TIMESTAMP Simple Examples 3. Set Timezone and Use Timestamp 4. Auto Init and Update Timestamp Let’s now go through each of the section one by one. MySQL TIMESTAMP The MySQL TIMESTAMP is a transient data type that contains a mixture of date and time. It is exactly 19 characters long. The structure of a TIMESTAMP field is as follows: Syntax # MySQL Timestamp YYYY-MM-DD HH:MM:SS The TIMESTAMP value shows in UTC

The post MySQL TIMESTAMP with Simple Examples appeared first on Learn Programming and Software Testing.

Showing entries 1 to 10 of 25
10 Older Entries »