Showing entries 51 to 60 of 62
« 10 Newer Entries | 2 Older Entries »
Displaying posts with tag: MySQL Tutorial (reset)
MySQL CONCAT to Concatenate Strings

This tutorial explains MySQL CONCAT() which is a built-in String function. It takes variable no. of strings as input and concatenates them together. We’ll describe the usages of this method with the help of simple examples. MySQL string concatenation is more user-friendly than other databases such as PostgreSQL or Oracle. They provide a string concatenation operator “||” instead of a proper function. However, MS SQL server does the same job using the addition arithmetic operator (+). 1. CONCAT() Syntax 2. CONCAT() Simple Examples 4. CONCAT() with Tables Let’s now go through each of the section one by one. MySQL CONCAT()

The post MySQL CONCAT to Concatenate Strings appeared first on Learn Programming and Software Testing.

MySQL DROP TABLE with Simple Examples

This tutorial explains MySQL DROP TABLE statement which deletes the specified tables from the in-use database. We’ll describe several usages of this method with the help of simple examples. 1. DROP TABLE Syntax 2. DROP TABLE If Exist 3. DROP TABLE Matching Pattern 4. DROP TABLE Full Example Let’s now read and understand each of the section one by one. MySQL DROP TABLE statement As stated initially, the DROP TABLE is a built-in MySQL statement which removes a specified table from the database. So, let’s first check the details and see how to use the DROP command. But first, create

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

MySQL ABS Function with Simple Examples

This tutorial explains MySQL ABS() which is a Math/Trig function. It takes a number as input and determines its absolute (positive) value. We’ll describe the usages of this method with the help of simple examples. 1. ABS() Syntax 2. ABS() Simple Examples 3. ABS() for Expression 4. ABS() with Tables Let’s now go through each of the section one by one. MySQL ABS() Function As stated initially, ABS() is a built-in MySQL function which does some math calculation to derive the absolute value of a number. In Maths term, an absolute value represents the length of a number on the

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

MySQL DATE_ADD Function with Simple Examples

This tutorial explains MySQL DATE_ADD function which adds up a slice of time (in days/hours, e.g., 1 day or 10 days) to the given date. We’ll describe the complete date arithmetic of this method with the help of simple examples. 1. DATE_ADD() Syntax 2. DATE_ADD() with -ve Interval 3. DATE_ADD() for Invalid Date 4. DATE_ADD() for Auto Adjustment Let’s now go through each of the section one by one. MySQL DATE_ADD() Function As stated initially, DATE_ADD() is a built-in MySQL function which adds the specified no. of days to a given date. So, let’s now see the details and check

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

MySQL DATE_SUB Function with Simple Examples

This tutorial explains MySQL DATE_SUB function which subtracts a slice of time (in days/hours, e.g., 1 day or 10 days) from the given date. We’ll describe the complete date arithmetic of this method with the help of simple examples. 1. DATE_SUB() Syntax 2. DATE_SUB() with -ve Interval 3. DATE_SUB() for Invalid Date 4. DATE_SUB() for Auto Adjustment Let’s now go through each of the section one by one. MySQL DATE_SUB() Function As stated initially, DATE_SUB() is a built-in MySQL function which subtracts the specified no. of days from a given date. So, let’s now see the details and check out

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

MySQL FIND_IN_SET Function with Simple Examples

This tutorial explains MySQL FIND_IN_SET function which finds the position of a string within a sequence of strings separated by commas (i.e., comma-separated such as str1, str2, find_this_string,…) with examples. 1. FIND_IN_SET() Syntax 2. FIND_IN_SET Flow Diagram 3. FIND_IN_SET() Examples 4. FIND_IN_SET() Function Vs. IN operator Let’s now go through each of the section one by one. MySQL FIND_IN_SET() Function As stated initially, FIND_IN_SET() is a built-in MySQL function which returns the index of a string in a list of comma-delimited strings. So, let’s now see the details and check out how can we use it. Syntax Below is the

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

How to Declare Variables in MySQL

This tutorial describes how to declare a variable (like user-defined, local, and system vars) in MySQL. We’ll tell you the complete syntax and provide simple examples for clarity. MySQL puts up the below three ways: 1. Declare a user-defined variable 2. Declare a local variable 3. Declare a system variable Let’s start with looking at all of them one by one. Declare Variable in MySQL There are primarily three types of variables in MySQL. And each has its specific way to provide a declaration. 1. Declare a User-defined Variable In MySQL, we can use the SET statement to declare a

The post How to Declare Variables in MySQL appeared first on Learn Programming and Software Testing.

MySQL Tutorial – Learn Step by Step

We bring you the best MySQL tutorial to learn all Basic to Advanced concepts step by step. This post covers all MySQL building blocks such as DDL, DML, DCL, and TCL. DDLs are commands to create, drop, alter, truncate, rename, comment databases, and tables. Also, DMLs are select, insert, update, delete commands to manipulate data. Moreover, you’ll also find the DCLs on this page such as grant and invoke to manage rights and permissions. After that, there are TCLs to control the transactions. So, let’s start by telling you that the father of MySQL is Michael Widenius, who named it

The post MySQL Tutorial – Learn Step by Step appeared first on Learn Programming and Software Testing.

MySQL Tutorial – Managing MySQL Server Logs: Rotate, Compress, Retain & Delete

MySQL Server generates several logs that can help you monitor the activities of the server. However, once these logs are enabled, they can grow in size and start taking up too much disk space. This is why it’s important to have an automated way of archiving and preserving MySQL log files for a certain duration, as well as deleting the old ones. In this blog post, we describe some best practices for setting up and managing MySQL error logs, general logs and slow query logs for your MySQL deployments.

Setting Up MySQL Server Logging

Let’s look at how to setup the following 3 types of logs:

Error Log

Logs all the problems encountered during starting, running, or stopping mysqld. This log can be enabled by having the following option in /etc/my.cnf file:

[Read more]
MySQL Tutorial – Understanding The Seconds Behind Master Value

In a MySQL hosting replication setup, the parameter Seconds_Behind_Master (SBM), as displayed by the SHOW SLAVE STATUS command, is commonly used as an indication of the current replication lag of the slave. In this blog post, we examine how to understand and interpret this value in various situations.

Possible Values of  Seconds Behind Master

The value of SBM, as explained in the  MySQL documentation, depends on the state of the MySQL slave in general, and the states of MySQL slave SQL_THREAD and IO_THREAD in particular. While IO_THREAD connects with the master and reads the updates, SQL_THREAD applies these updates on the slave. Let’s examine the possible values of SBM during different states of the MySQL Slave.

When SBM Value is Null

  • SBM is …
[Read more]
Showing entries 51 to 60 of 62
« 10 Newer Entries | 2 Older Entries »