Showing entries 41 to 50 of 55
« 10 Newer Entries | 5 Older Entries »
Displaying posts with tag: MySQL Tutorial (reset)
MySQL Insert Statement to Add Rows

This tutorial explains the MySQL INSERT command to insert single and multiple rows in a table. Here, you’ll find some unique ways with different variations for adding records with fully working examples. 1. INSERT Statement Syntax 2. INSERT Single Row 3. INSERT Default Values 3. INSERT Date Columns 4. INSERT Multiple Rows Let’s now read and understand each of the section one by one. MySQL INSERT statement As stated initially, the INSERT command is a built-in MySQL statement which inserts the specified records into a given table. So, let’s first check the details and see how to use the INSERT

The post MySQL Insert Statement to Add Rows appeared first on Learn Programming and Software Testing.

MySQL Aggregate Functions

This tutorial explains the use of MySQL aggregate functions like AVG, COUNT, SUM, MAX, MIN with the help of simple examples. Aggregate functions are a bunch of methods that operate on a set of values. They can do calculations for us and then returns one final value. For example, you may like to compute the sum of the data values in a given field. The following are aggregate functions that we are covering in this tutorial. 1. COUNT function 2. MIN function 3. MAX function 4. SUM function 5. AVG function MySQL Aggregate Functions with Examples Before we go through

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

MySQL OPTIMIZE TABLE Statement

This tutorial explains MySQL OPTIMIZE TABLE statement which defrags tables and recovers unused space. We’ll describe the complete usage of this method with the help of simple examples. If your database is receiving a lot of deletes and updates calls, then it might lead to fragmentation in your MySQL data files. Therefore, a lot of unused space would go in vain, and also put a high impact on the performance. So, experts recommend that you must defrag your MySQL tables regularly. Hence, we’ll today explain how to use the MySQL OPTIMIZE TABLE to defrag tables and free up space. MySQL OPTIMIZE

The post MySQL OPTIMIZE TABLE Statement appeared first on Learn Programming and Software Testing.

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.

Showing entries 41 to 50 of 55
« 10 Newer Entries | 5 Older Entries »