Liquibase is a dabasebase chane management tool. Rather than writing SQL directly against the database to create, update or drop database objects, developers define their desired database changes in XML files.
Any change to database are grouped into "ChangeSet", the best practice is one changeset per modification to make roll back easily. Changes to database can … Read More →
1. Install Java
Liquibase 3.x requires Java 1.6+ so lets get that installed first
2. Get the Liquibase Code
I'm just going to install put Liquibase in the home directory for now
3. Install MySQL
4. Install the MySQL connector for Java
5. Create the MySQL database
6. Create a Changelog file
Add the following...
7. Run Liquibase
8. Create a liquibase.properties file
Add the following...
9. … Read More →
This post will look how to use encryption to secure your database credentials.
Before we can go on to use GPG to encrypt our credentials, we need to get it working. GnuPG comes with almost every *nix operating system, but for this post we’ll be using Ubuntu 16.04 LTS and we’ll presume that it isn’t yet … Read More →
Analyzing Business Metrics: https://www.codecademy.com/learn/sql-analyzing-business-metrics
SQL joins infografic: http://cd64.de/sql-joins
Sequel Pro: http://www.sequelpro.com/
Find out the IP Address of the Mysql Host
Sample database cart table contains four columns cart_id, user_id, product_id and created_at.
Enable MySQL Event Scheduler
Start MySQL event scheduler by executing following query in PhpMyAdmin or MySQL command prompt.
Create a Event
Here the following event will run everyday and clear/delete 10 days old data from cart table based on time stamp
If you want to modify the … Read More →
Schema changes can often lock your database, stall your application, and cause an outage, so you'll want to be careful in how you design the infrastructure to permit database changes.
Achieving a zero-downtime schema deployment can be done with load balancer and a technique called Blue-Green deployment.
"Blue-Green deployment" is a fancy term that basically means you … Read More →
Follow this steps for install MySQL Workbench in Fedora 21 :
L'évolutivité à son meilleur niveau !
Saviez-vous que MariaDB 10 améliore considérablement vos performances ? Et que le nouveau proxy MariaDB MaxScale (pour MariaDB & MySQL) permet une évolutivité simple de votre infrastructure de base de données tout en répondant aux besoins des DBA, des développeurs et des architectes de bases de données ? Savez-vous comment … Read More →
This MySQL tutorial explains how to create an AFTER INSERT Trigger in MySQL with syntax and examples.
An AFTER INSERT Trigger means that MySQL will fire this trigger after the INSERT operation is executed.
The syntax to create an AFTER INSERT Trigger in MySQL is:
CREATE TRIGGER trigger_name
ON table_name FOR EACH ROW
… Read More →
SQLite performs inserts 8-14 times faster then InnoDB / MyISAM
SQLite performs updates 4-8 times faster then InnoDB and as fast as MyISAM
SQLite performs selects 2 times faster than InnoDB and 3 times slower than MyISAM
SQLite requires 2.6 times less disk space than InnoDB and 1.7 times more than MyISAM
Allowing null values or using synchronous=NORMAL makes … Read More →
Most users at one time or another have dealt with hierarchical data in a SQL database and no doubt learned that the management of hierarchical data is not what a relational database is intended for. The tables of a relational database are not hierarchical (like XML), but are simply a flat list. Hierarchical data has … Read More →
When I was comparing performance of UNION vs MySQL 5.0 index merge algorithm Sinisa pointed out I should be using UNION ALL instead of simple UNION in my benchmarks, and he was right. Numbers would be different but it should not change general point of having optimization of moving LIMIT inside of union clause being … Read More →
The simplest way of exporting a table data into a text file is using SELECT...INTO OUTFILE statement that exports a query result directly into a file on the server host.
Exporting Data with the SELECT ... INTO OUTFILE Statement:
The syntax for this statement combines a regular SELECT with INTO OUTFILE filename at the end. The default … Read More →
You might be thinking that doing a full table scan sounds inefficient for something so simple – shouldn’t software be smarter?
It’s almost like looking through the entire table with the human eye – very slow and not at all sleek. But, as you probably guessed by the title of this article, this is where indexes … Read More →
MySQL implements UNION, but does not directly implement INTERSECTION or DIFFERENCE.
INTERSECTION is just an INNER JOIN on all columns:
drop table if exists a,b;
create table a(i int,j int);
create table b like a;
insert into a values(1,1),(2,2);
insert into b values(1,1),(3,3);
select * from a join b using(i,j);
| i | j |
| 1 | 1 … Read More →
In this article I’ll show several ways to emulate a FULL OUTER join on a RDBMS that doesn’t support it, as is the case with even the most recent versions of MySQL. This useful query is surprisingly tricky to get right.
A standard SQL FULL OUTER join is like a LEFT or RIGHT join, except that … Read More →