FrenchTech SAAS
33.5K views | +5 today
FrenchTech SAAS
Les news de l'univers SAAS et FrenchTech
Curated by Mickael Ruau
Your new post is loading...
Your new post is loading...

Popular Tags

Scooped by Mickael Ruau
August 27, 2013 10:54 AM
Scoop.it!

DBMonster - feed your database!

DBMonster is a tool which generates random test data and puts it into SQL database. It helps to test how an application can deal with large database.
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:23 AM
Scoop.it!

SQL | Représentation d'arbres génériques

Le parcours d'un arbre en SQL repose souvent sur l'utilisation de procédures complexes et coûteuse en ressources ce qui fait qu'elles sont difficilement exploitables lorsque les arbres atteignent une certaine taille.
Mickael Ruau's insight:

Pour éviter toute récusion en SQL, une solution simple consiste à mettre l'arbre à plat. Ainsi, pour un noeud donné, on retrouve tous les éléments de l'arbre passant par ce noeud (si ce noeud est la racine, on retourne l'arbre en entier).

Cependant, si l'on met l'arbre à plat, on perd une partie de l'information, celle qui concerne notamment l'ordre hiérarchique des noeuds. Conserver le lien père-fils est donc primordial.

Un arbre générique sera donc stocké sous deux informations complémentaires :

hiérarchie : lien père-fils;parcours : arbre à plat.

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:22 AM
Scoop.it!

Paramodulation vs. Resolution

Paramodulation vs. Resolution | FrenchTech SAAS | Scoop.it
Equations are ubiquitous in mathematics, physics, and computer science. In database field an optimizer rewriting a query to standard restrict-project-join leverages relational algebra identities.
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:13 AM
Scoop.it!

XML:DB Initiative: Enterprise Technologies for XML Databases

XML:DB Initiative: Enterprise Technologies for XML Databases | FrenchTech SAAS | Scoop.it

The XML:DB Initiative's long term goals can be summarized as:

Development of technology specifications for managing the data in XML DatabasesContribution of reference implementations of those specifications under an Open Source LicenseFormation of a community where XML database vendors and users can ask questions and exchange information to learn more about XML database technology and applications.Evangelism of XML database products and technologies to raise the visibility of XML databases in the marketplace
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:13 AM
Scoop.it!

Comparing XML database approaches

Comparing XML database approaches | FrenchTech SAAS | Scoop.it
The increasing use of XML asks for systems that store semi-structured data without forcing it into inadequate data structures. These requirements are met by both native XML databases and relational databases with integrated XML support.
Mickael Ruau's insight:

Although XML documents can describe structured data, an NXD containing many XML documents might not be the best solution to describe relationships between structured data divided over multiple documents and maintain referential integrity. If it is already possible to manage such relationships (perhaps using XPointer), the usage is not standardized.

The best advice is to use the right tool for the right job. However, coexistence of an NXD with an RDBMS creates integration challenges. The pureXML features of DB2 combine the best of both worlds and allow the storage of both structured and semi-structured data. For the storage of unstructured data, NXDs and RDBMSs are equally suited.

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:11 AM
Scoop.it!

rpbourret.com - XML Database Products

rpbourret.com - XML Database Products | FrenchTech SAAS | Scoop.it
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:11 AM
Scoop.it!

Administer MySQL Like a DbNinja - SitePoint

Administer MySQL Like a DbNinja - SitePoint | FrenchTech SAAS | Scoop.it
Craig looks at DbNinja. It may be just another PHP-based MySQL client, but this one is a little special...
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:08 AM
Scoop.it!

Models for hierarchical data

Tree-like data relationships are common, but working with trees in SQL usually requires awkward recursive queries. This talk describes alternative solutions in
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:08 AM
Scoop.it!

Hierarchical SQL - O'Reilly Media

Joe Celko was a member of the ANSI X3H2 Database Standards Committee from 1987 to 1997 and helped write the ANSI/ISO SQL-89 and SQL-92 standards.

Mickael Ruau's insight:

Path enumeration models have problems with deeper trees and with trees that do not have a natural way of naming the nodes or edges. Maintaining proper constraints can be difficult in actual SQL products because of the lack of support for Full SQL-92 features.

On the plus side, path enumeration is a very fast and natural technique for trees without great depth and frequent changes to the structure. If you perform most of your searches and aggregations from the root down, it can handle surprisingly wide tree structures.

 

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:04 AM
Scoop.it!

The simplest(?) way to do tree-based queries in SQL (dirtSimple.org)

The simplest(?) way to do tree-based queries in SQL (dirtSimple.org) | FrenchTech SAAS | Scoop.it

I don't think I've ever seen an article on my preferred way of managing hierarchies in SQL, and that's using what I call a closure table.

 
Mickael Ruau's insight:

A closure table gives you the ability to do all the same sorts of "find me all children of X, to depth N" queries as any of the other methods, just by doing a join against the closure table.

But the killer feature of the closure table, is that to add or remove a parent-child relationship, you only need to run *one* SQL query -- a query so simple that even the least-powerful SQL databases can be configured to run it as a trigger on the main table!

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:02 AM
Scoop.it!

General trees persisted in relational databases - CodeProject

Persisting general trees in relational databases with fast path-finding capabilities.; Author: Daniel Aioanei, Adi Malinaru; Updated: 24 Jun 2003; Section: Database; Chapter: Database; Updated: 24 Jun 2003...
Mickael Ruau's insight:

The need to “archive” tree structures arises in some applications, especially those provide traceability for some tree structures. If a tree version that existed at some point in time is not frequently accessed, then some shorter encoding for the tree can be used to store in the database. I recommend the Prüfer-Like Codes. With most of these codes, the structure of a tree with N nodes is encoded in N – 2 integers in linear time. Be aware that these encodings only store the tree structure, and not the information in the nodes. That information has to be kept separately anyway.

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 9:56 AM
Scoop.it!

Managing Hierarchical Data in SQL | Pure Performance Inc

Managing Hierarchical Data in SQL | Pure Performance Inc | FrenchTech SAAS | Scoop.it
SQL databases are not designed for hierarchical data since the data is stored in flat relational tables with no built in parent-child relationship methods (Oracle does have the connect_by function to help).
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 9:45 AM
Scoop.it!

MySql: cleaning user input before storing the data | MySQL

This article describes a single MySql function to sanitize strings.
Mickael Ruau's insight:

The provided options are:

replace multiple spaces to a single spaceremove Unix and Windows linebreaks and replace them with a spaceremove tabs and replace them for a single spaceremove multiple backslashescompletely remove htmlentitiesreplace htmlentities with the corresponding characterremove all HTML tags

All code is available in a zip file.

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:24 AM
Scoop.it!

Gestion d'une structure d'arbre sous MySQL

Introduction : Il est très courant d'avoir à stocker une structure d'arbre dans une base de données. Par exemple, pour enregistrer l'organisation hiérarchique d'une entreprise ou bien pour représen...
Mickael Ruau's insight:

Au lieu d’utiliser la représentation classique d’un arbre, on peut aussi imaginer un arbre comme une imbrication d’ensembles. La racine est l’ensemble le plus grand qui regroupe tous les éléments, puis ses enfants sont des sous-ensembles plus petits qui regroupents leurs enfants, etc…

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:22 AM
Scoop.it!

Independence of Relational Operations

Independence of Relational Operations | FrenchTech SAAS | Scoop.it
Proving that standard relational algebra operations are independent is considered an exercise in standard database theory course. Here is extract from prof.
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:21 AM
Scoop.it!

Insert-Multiple Rows Into MySQL The Right Way With PHP

Quite often when coding with PHP, there is a need to insert many items into a a database. The data may come from a feed, an array in yousr code, a form submitting multiple values or many other sources.
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:13 AM
Scoop.it!

Sedna XML Database

Sedna is a free native XML database which provides a full range of core database services - persistent storage, ACID transactions, security, indices, hot backup. Flexible XML processing facilities include W3C XQuery implementation, tight integration of XQuery with full-text search facilities and a node-level update language.

Mickael Ruau's insight:

Basic Features

Available for free in open source form under Apache License 2.0Native XML database system implemented in C/C++Support for W3C XQuery language validated by W3C XQuery Test SuiteFull-text search indices (native or based on dtSearch) »Support for a declarative node-level update language »Support for ACID transactionsSupport for fine-grained XML triggers »Incremental hot backup »Indices (based on B-tree) »Support for Unicode (utf8)SQL connection from XQuery »XQuery external functions implemented in C »Database security (users, roles and privileges) »

Application Programming

The following drivers are available from the download page:

API for Java/C/PHP/Python/Ruby/Perl/Delphi/C# and moreXQJ and XML:DB drivers for JavaModule for Integration with Apache HTTP server
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:12 AM
Scoop.it!

BaseX | The XML Database

BaseX | The XML Database | FrenchTech SAAS | Scoop.it
BaseX is a very light-weight, high-performance and scalable XML Database engine and XPath/XQuery Processor with Full Text and Update extensions.
Mickael Ruau's insight:
BaseX 7.7 has been released!

BaseX is a very light-weight, high-performance and scalable XML Database engine and XPath/XQuery 3.0 Processor, including full support for the W3C Update and Full Text extensions. An interactive and user-friendly GUI frontend gives you great insight into your XML documents.

To maximize your productivity and workflows, we offer professional support, highly customized software solutions and individual trainings on XML, XQuery and BaseX. Our product itself is completely Open Source (BSD-licensed) and platform independent; join our mailing lists to get regular updates!

But most important: BaseX runs out of the box and is easy to use…

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:11 AM
Scoop.it!

Doing SQL arithmetic with SELECT instead of arithmetic operations

Learn how to do simple SQL arithmetic operations without using the arithmetic operators.
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:10 AM
Scoop.it!

Converting an adjacency list model to a nested set model

Another way of representing trees in SQL is to show them as nested sets. Here's how.
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:08 AM
Scoop.it!

Representing Trees in a relational DB

Representing Trees in a relational DB | FrenchTech SAAS | Scoop.it
No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:05 AM
Scoop.it!

Removing duplicate rows (SQL) | Pure Performance Inc

Removing duplicate rows (SQL) | Pure Performance Inc | FrenchTech SAAS | Scoop.it
At least once in your career you will have to deal with duplicate rows causing havic on you application. This post will help you get through that delema. I have Oracle and MySql examples below.
Mickael Ruau's insight:

With MySQL  we do not have the tools that Oracle has to easily find the duplicates. But most MySql tables use an auto-increment ID field that helps us to identify the duplicates.

Simple Method

As with the Oracle method use the “greater than” sign to to keep the earliest row entered. We can change this  to pull the latest  by replacing “greater than” with “less than”.

DELETE A FROM [TABLE] as A, [TABLE] as B
WHERE A.[UNIQUE FIELD(S)] = B.[UNIQUE FIELD(S)]
AND A.ID > B.ID;

Without the ID field

Now it gets complicated in MySQL, we need to create a table with an unique ID then remove the duplicates. Once the dups have been remove  then  we can put the data back onto the original table.

Drop the dups table if it exists.

DROP TABLE IF EXISTS [TABLE]_dups;

Create the dups table.  This table will be the base table(table with dups) with the ID added.

CREATE TABLE [TABLE]_dups (
id INT(11) default NULL auto_increment,
[ALL TABLE COLUMNS],
PRIMARY KEY (id)
);

Insert into the dups table from the base table.

INSERT INTO [TABLE]_dups
SELECT NULL,[UNIQUE FIELD(S)]
FROM [TABLE];

Delete the dups using the SQL we used in the prior example

DELETE A FROM [TABLE]_dups as A, [TABLE]_dups as B
WHERE A.[UNIQUE FIELD(S)] = B.[UNIQUE FIELD(S)]
AND A.ID < B.ID;

Delete the Base table

DELETE FROM [TABLE];

Insert into the base table from the dups table.

INSERT INTO [TABLE]
SELECT [all columns less the ID field]
FROM [TABLE]_dups;

Remove the dups table

DROP TABLE [TABLE]_dups;

I hope this posts help you when you run into this problem… and we all run into this problem.

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 10:03 AM
Scoop.it!

One more Nested Intervals vs. Adjacency List comparison

One more Nested Intervals vs. Adjacency List comparison | FrenchTech SAAS | Scoop.it
When comparing different hierarchical SQL query methods many people cite inefficiency of tree structure organized into adjacency list. They claim inferior performance of the methods that the big th...
Mickael Ruau's insight:

Chapter 6 of “SQL Design Patterns” book summarized different methods in the following feature matrix:

Adjacency relation (tree edges; standalone, or combined with the tree nodes)Nested SetsMaterialized PathNested Intervals via Matrix encodingHave to use proprietory SQL extensions for finding ancestors and descendants; although the queries are efficientStandard SQLStandard SQLStandard SQLFinding descendants is relatively efficient (i.e. proportional to the size of the subtree)Finding descendants is easy and relatively efficient (i.e. proportional to the size of the subtree)Finding descendants is easy and relatively efficient (i.e. proportional to the size of the subtree)Same as MP: Finding descendants is easy and relatively efficientFinding ancestors is efficientFinding ancestors is easy but inefficientFinding ancestors is tricky but efficientSame as MP: Finding ancestors is tricky but efficientFinding node’s children is trivialFinding node’s children as all the descendants restricted to the next level is inefficient (e.g. consider root node)Finding node’s children as descendants on next level is inefficientSame as AR: Finding node’s children is trivialFinding node’s parent is trivialFinding node’s parent as ancestor on the previous level is inefficient due to inefficiency of ancestors searchFinding node’s parent as ancestor on the previous level is efficientSame as AR: Finding node’s parent is trivialAggregate queries are relatively efficient (i.e. proportional to the size of the subtree)Aggregate queries are relatively efficient (except counting, which is super fast)!Aggregate queries are relatively efficient (i.e. proportional to the size of the subtree)Aggregate queries are relatively efficient (i.e. proportional to the size of the subtree)tree reorganization is very simpletree reorganization is hardtree reorganization is easytree reorganization is easy (but not as simple as in AR)

After the book were published I found some wrong assertions in this matrix as well.

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 9:59 AM
Scoop.it!

Troels' links: Relational database systems

No comment yet.
Scooped by Mickael Ruau
August 26, 2013 9:55 AM
Scoop.it!

Managing hierarchical data with MySQL - Vincent Lamanna

A simple approach on solving this complex problem using MySQL.
Mickael Ruau's insight:

The concept of a lineage is quite simple. You store as text the hierarchical representation in your Database.

No comment yet.