FrenchTech SAAS
33.5K views | +0 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
September 21, 2021 10:35 AM
Scoop.it!

Storing JSON in Your Databases: Tips and Tricks For MySQL Part Two

Storing JSON in Your Databases: Tips and Tricks For MySQL Part Two | FrenchTech SAAS | Scoop.it
Taking a look into performance, scale, and oddities that may occur when storing JSON in your MySQL databases.
No comment yet.
Scooped by Mickael Ruau
September 21, 2021 10:33 AM
Scoop.it!

Storing and Using JSON Within PostgreSQL Part Two

Storing and Using JSON Within PostgreSQL Part Two | FrenchTech SAAS | Scoop.it
Part two of Matt Yonkovit's series on storing and using JSON within PostgreSQL. ...
No comment yet.
Scooped by Mickael Ruau
September 20, 2021 1:03 AM
Scoop.it!

The Three-Valued Logic of SQL

SQL uses a three-valued logic: besides true and false, the result of logical expressions can also be unknown. SQL’s three valued logic is a consequence of supporting null to mark absent data. If a null value affects the result of a logical expression, the result is neither true nor false but unknown.

The three-valued logic is an integral part of Core SQL and it is followed by pretty much every SQL database.

Contents:

  1. Comparisons to null
  2. Logical Operations Involving Unknown
  3. General Rule: where, having, when, etc.
  4. Exception: Check Constraints
  5. Related Features
  6. Binary Decisions Based on Three-Valued Results
  7. Interactive is [not] (true|false|unknown) Emulator
  8. Compatibility
Mickael Ruau's insight:

Comparisons to null

The SQL null value basically means “could be anything”. It is therefore impossible to tell whether a comparison to null is true or false. That’s where the third logical value, unknown, comes in. Unknown means “true or false, depending on the null values”.

The result of each of the following comparisons is therefore unknown:0

NULL = 1 NULL <> 1 NULL > 1 NULL = NULL

Nothing equals null. Not even null equals null because each null could be different.

Mnemonic

For comparisons every null is a different null. This is different in group by, partition by and related operations.

That’s why SQL has the is null predicate to test whether a value is null or not and the is not distinct from predicate to compare two values while treating two null values as the same.

No comment yet.
Scooped by Mickael Ruau
September 16, 2021 9:43 AM
Scoop.it!

Industrialisation des développements : automatisez votre base de données | OCTO Talks !

Industrialisation des développements : automatisez votre base de données | OCTO Talks ! | FrenchTech SAAS | Scoop.it

Dans son article paru en 2003 intitulé « Evolutionary Database Design », Martin Fowler pose les principes du design évolutif de base de données. Les points clés en sont :

  • La base de données évolue en même temps que le code ;
  • Il faut donc tester en continu la base de données pour permettre un refactoring sans conséquence, comme on le fait avec le code source ;
  • Il faut outiller les processus autour de la base de données afin d’améliorer la productivité des développements et leur industrialisation.

Les outils existants reposent sur les principes suivants :

  • Un schéma doit pouvoir être détruit et recréé de manière répétable ;
  • La version du schéma doit être identifiable ;
  • La montée et la descente de version doivent être automatisées ;
  • Les changements appliqués doivent être connus ;
  • Un changement doit pouvoir être défait ou annulé ;
  • Un changement précédemment appliqué ne doit pas être modifié mais un nouveau changement doit être créé.
No comment yet.
Scooped by Mickael Ruau
September 13, 2021 1:01 AM
Scoop.it!

NULL-Aware Comparison: is [not] distinct from

In SQL null is not equal (=) to anything—not even to another null. According to the three-valued logic of SQL, the result of null = null is not true but unknown.

Mickael Ruau's insight:

SQL has the is [not] null predicate to test if a particular value is null.

With is [not] distinct from SQL also provides a comparison operator that treats two null values as the same.

No comment yet.
Scooped by Mickael Ruau
September 6, 2021 11:56 AM
Scoop.it!

Reduce Network Latency For insert

inserting multiple rows with a single insert statement is useful if the all-or-nothing semantic is desired and the number of rows is fixed or at least within known boundaries. In almost all other cases, batch APIs offer a better approach to reduce network latency.

 

No comment yet.
Scooped by Mickael Ruau
September 6, 2021 7:58 AM
Scoop.it!

SQLBolt - Learn SQL - SQL Topic: Unions, Intersections & Exceptions

SQLBolt provides a set of interactive lessons and exercises to help you learn SQL
Mickael Ruau's insight:

In the order of operations as defined in Lesson 12: Order of execution, the UNION happens before the ORDER BY and LIMIT. It's not common to use UNIONs, but if you have data in different tables that can't be joined and processed, it can be an alternative to making multiple queries on the database.

Similar to the UNION, the INTERSECT operator will ensure that only rows that are identical in both result sets are returned, and the EXCEPT operator will ensure that only rows in the first result set that aren't in the second are returned. This means that the EXCEPT operator is query order-sensitive, like the LEFT JOIN and RIGHT JOIN.

Both INTERSECT and EXCEPT also discard duplicate rows after their respective operations, though some databases also support INTERSECT ALL and EXCEPT ALL to allow duplicates to be retained and returned.

No comment yet.
Scooped by Mickael Ruau
September 3, 2021 10:41 AM
Scoop.it!

EXCEPT / MINUS

EXCEPT / MINUS | FrenchTech SAAS | Scoop.it

Dans le langage SQL la commande EXCEPT s’utilise entre 2 instructions pour récupérer les enregistrements de la première instruction sans inclure les résultats de la seconde requête. Si un même enregistrement devait être présent dans les résultats des 2 syntaxes, ils ne seront pas présent dans le résultat final.

A savoir : cette commande s’appelle différemment selon les Systèmes de Gestion de Base de Données (SGBD) :

  • EXCEPT : PostgreSQL
  • MINUS : MySQL et Oracle
No comment yet.
Scooped by Mickael Ruau
September 2, 2021 12:13 PM
Scoop.it!

The History of SQL Standards

The History of SQL Standards | FrenchTech SAAS | Scoop.it
Find out how the SQL standard has changed over 30 years, from SQL-86 to the standard data language of the 21st century.
No comment yet.
Scooped by Mickael Ruau
September 1, 2021 11:53 AM
Scoop.it!

Assign Names to Columns Without Known Name

Normally, we define column names using the create statement and alias them in select if needed. However, to alias a column using select you must first know its the original name. This is not the case when using table functions, unnest or values. The only way to assign names to such columns is on the basis of their position.

No comment yet.
Scooped by Mickael Ruau
August 31, 2021 10:43 AM
Scoop.it!

Logiciels

La conception d’un système qui va recourir à un Système de Gestion de Base de Données (SGBD) et donc qui devra utiliser le langage SQL nécessite parfois l’utilisation de logiciels pour concevoir un tel système grâce à des méthodes telles que UML ou Merise. Des logiciels peuvent aussi aider à gérer les données sans avoir à utiliser des lignes de commandes.

No comment yet.
Scooped by Mickael Ruau
August 31, 2021 9:41 AM
Scoop.it!

ANY / SOME

Dans le langage SQL, la commande ANY (ou SOME) permet de comparer une valeur avec le résultat d’une sous-requête. Il est ainsi possible de vérifier si une valeur est “égale”, “différente”, “supérieur”, “supérieur ou égale”, “inférieur” ou “inférieur ou égale” pour au moins une des valeurs de la sous-requête.

 

A noter : le mot-clé SOME est un alias de ANY, l’un et l’autre des termes peut être utilisé.

Mickael Ruau's insight:

Syntaxe

Cette commande s’utilise dans une clause conditionnelle juste après un opérateur conditionnel et juste avant une sous-requête. L’exemple ci-dessous démontre une utilisation basique de ANY dans une requête SQL :

SELECT * FROM table1 WHERE condition > ANY ( SELECT * FROM table2 WHERE condition2 )

Cette requête peut se traduire de la façon suivante : sélectionner toutes les colonnes de table1, où la condition est supérieure à n’importe quel résultat de la sous-requête.

A savoir : les opérateur conditionnels peuvent être les suivants : =, <, >, <>, !=,<=, >=, !> ou !<.

No comment yet.
Scooped by Mickael Ruau
August 31, 2021 8:28 AM
Scoop.it!

Oracle Tuning Concepts (Introduction)

This course introduces you to some of the advanced performance tuning tools and concepts associated with the Oracle RDBMS
Mickael Ruau's insight:
After completing the course, you will be able to:
  1. Use data blocks efficiently to improve I/O performance
  2. Tune using the new Oracle Data Structures
  3. Use the Data Dictionary to monitor performance
  4. Define and use Oracle table and index partitions
  5. Tune with Oracle indexes for optimal performance
  6. Tune Oracle for Web Applications
  7. Describe and implement tuning techniques for Distributed Databases
  8. Tune the Oracle Parallel Server (OPS)
No comment yet.
Scooped by Mickael Ruau
September 21, 2021 10:35 AM
Scoop.it!

PostgreSQL Database Security: OS - Authentication

PostgreSQL Database Security: OS - Authentication | FrenchTech SAAS | Scoop.it
Discussing the three operating system-based authentication methods for PostgreSQL; Ident, PAM, and Peer.
No comment yet.
Scooped by Mickael Ruau
September 20, 2021 1:13 AM
Scoop.it!

Use The Index, Luke!

Use The Index, Luke is the free web-edition of SQL Performance Explained

Mickael Ruau's insight:

Use The Index, Luke presents indexing in a vendor agnostic fashion. Product specific notes are provided

No comment yet.
Scooped by Mickael Ruau
September 17, 2021 9:56 AM
Scoop.it!

Il était une fois… une – presque – histoire d’index | OCTO Talks !

Il était une fois… une – presque – histoire d’index | OCTO Talks ! | FrenchTech SAAS | Scoop.it

Dans cet article, je vais vous raconter une petite histoire de diagnostic comme il nous – ingénieurs, développeurs et autres artisans du code – en arrive très souvent.

C’est une histoire technique qui parle de base de données, de logs, d’ORM sûrement mal configuré et de MySQL qui fait ce qu’on lui dit. C’est surtout l’histoire de comment et pourquoi on a regardé au mauvais endroit en apprenant pleins de trucs au passage.

Mickael Ruau's insight:

 

Pour la petite explication, il se trouve que MySQL va exécuter la requête mais ignorera l’index quand le type utilisé dans la clause where est incorrect. La colonne est un VARCHAR, le type Java est un Integer, ce qui se traduit par une absence de guillemets dans la requête. Voilà.

A noter que l’inverse est faux : si votre type côté base de données est un entier, alors utiliser un type string dans la clause where de la requête sollicitera quand même l’index. ¯\_(ツ)_/¯

No comment yet.
Scooped by Mickael Ruau
September 15, 2021 1:17 AM
Scoop.it!

SQL | EQUI Join and NON EQUI JOIN

A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
No comment yet.
Scooped by Mickael Ruau
September 8, 2021 1:09 AM
Scoop.it!

You Probably don’t Use SQL INTERSECT or EXCEPT Often Enough –

You Probably don’t Use SQL INTERSECT or EXCEPT Often Enough – | FrenchTech SAAS | Scoop.it
When people talk about SQL JOIN, they often use Venn Diagrams to illustrate inclusion and exclusion of the two joined sets: While these Venn diagrams are certainly useful to understand (and remember) SQL JOIN syntax, they're not entirely accurate, because SQL JOIN is a special type of a cartesian product, the CROSS JOIN. In a…
No comment yet.
Scooped by Mickael Ruau
September 6, 2021 9:52 AM
Scoop.it!

SQL JOIN Cheat Sheet

SQL JOIN Cheat Sheet | FrenchTech SAAS | Scoop.it
This 2-page SQL JOIN Cheat Sheet covers the syntax of different JOINs (even the rare ones!) Download it in PDF or PNG format.
No comment yet.
Scooped by Mickael Ruau
September 3, 2021 11:54 AM
Scoop.it!

https://modern-sql.com/use-case/pivot

Pivoting data is a rather common problem that comes in many different flavors. At its heart, the requirement is to transpose data from multiple rows into columns of a single row.

No comment yet.
Scooped by Mickael Ruau
September 2, 2021 12:35 PM
Scoop.it!

Literate SQL

Literate programming is an approach to programming introduced by Donald Knuth that, among other ideas, aims to arrange source code in order of human logic so that it can be understood by reading it like a novel: from the beginning to the end.

SQL works in the opposite way: due to the nesting of subqueries we must find and understand the innermost query and then start working from inside out. Not even well-chosen names can improve the recursive reading process notably because names follow the subqueries in SQL.

Even the order of clauses in the simplest query has a forward dependency: the meaning of the select clause depends on the from clause. That actually poses an unsolvable problem for development tools: when typing select, it is not yet know which tables are accessed and it is therefore also unknown which columns are visible. Without from no sensible code completion for select.

SQL:1999 introduced an alternative to the nesting at least: the with clause. In context of literate SQL, the with clause has two important properties: (1) names come first; (2) subqueries can be unnested.

 
Mickael Ruau's insight:

 

By now it should be clear why this technique is called “literate SQL”: writing easily readable SQL is an art, not science.

Performance Considerations

For some database—most notable PostgreSQL— the with clause has a performance impact. See “with Clause: Performance Impacts”.

Compatibility

 
No comment yet.
Scooped by Mickael Ruau
September 2, 2021 12:10 PM
Scoop.it!

Modern SQL: Beyond Relational

Since 1999, SQL is not limited to the relational model anymore.

Back then ISO/IEC 9075 (the “SQL standard”) added arrays, objects and recursive queries. In the meanwhile the SQL standard has grown five times bigger than SQL-92. In other words: relational SQL is only about 20% of modern SQL.0

If you can spare 15 minutes I’d like to tell you this story in this video. Alternatively on YouTube.

Mickael Ruau's insight:

On modern-⁠sql.com I explain old and new SQL features and show which products support them. Take this example.

Click on one of the features on the left hand side, e.g. “With clause”, to see how long the tested databases support this feature.

You cannot make up for 20 years of SQL evolution today. Subscribe the newsletter via E-Mail, Twitter or RSS to catch up successively and to keep modern-⁠sql.com on your radar.

If you want to start right away I’d recommend the articles about the pivot method, the extract expression and the with clause for the beginning. These are among the most popular articles on modern-⁠sql.com.

No comment yet.
Scooped by Mickael Ruau
September 1, 2021 10:00 AM
Scoop.it!

ALL

Dans le langage SQL, la commande ALL permet de comparer une valeur dans l’ensemble de valeurs d’une sous-requête. En d’autres mots, cette commande permet de s’assurer qu’une condition est “égale”, “différente”, “supérieure”, “inférieure”, “supérieure ou égale” ou “inférieure ou égale” pour tous les résultats retourné par une sous-requête.

Mickael Ruau's insight:

Syntaxe

Cette commande s’utilise dans une clause conditionnelle entre l’opérateur de condition et la sous-requête. L’exemple ci-dessous montre un exemple basique :

SELECT * FROM table1 WHERE condition > ALL (   SELECT *   FROM table2   WHERE condition2 )

A savoir : les opérateur conditionnels peuvent être les suivants : =, <, >, <>, !=, <=, >=, !> ou !<.

No comment yet.
Scooped by Mickael Ruau
August 31, 2021 10:40 AM
Scoop.it!

INTERSECT

INTERSECT | FrenchTech SAAS | Scoop.it

La commande SQL INTERSECT permet d’obtenir l’intersection des résultats de 2 requêtes. Cette commande permet donc de récupérer les enregistrements communs à 2 requêtes. Cela peut s’avérer utile lorsqu’il faut trouver s’il y a des données similaires sur 2 tables distinctes.

A savoir : pour l’utiliser convenablement il faut que les 2 requêtes retourne le même nombre de colonnes, avec les mêmes types et dans le même ordre.

Compatibilité : PostgreSQL, SQL Server, Oracle et SQLite. Pas disponible sous MySQL, mais il existe une alternative présentée sur cette page.

No comment yet.
Scooped by Mickael Ruau
August 31, 2021 9:16 AM
Scoop.it!

Jointure

Jointure | FrenchTech SAAS | Scoop.it

Les jointures en SQL permettent d’associer plusieurs tables dans une même requête. Cela permet d’exploiter la puissance des bases de données relationnelles pour obtenir des résultats qui combinent les données de plusieurs tables de manière efficace.

Mickael Ruau's insight:

LEFT JOIN (sans l’intersection de B)

Jointure gauche (LEFT JOINT sans l’intersection B)

SELECT * FROM A LEFT JOIN B ON A.key = B.key WHERE B.key IS NULLv
No comment yet.