Notes on MySQL multi table connection

Introduction: in the project, I met the need to merge MySQL database tables. In the process of merging, I should skip the existing records, because the primary key was not set in the initial stage of table design. Finally, I realized the requirements through MySQL's not exists statement. By the way, I explored the multi table connection in MySQ ...

Posted by pipe_girl on Fri, 17 Sep 2021 06:32:06 -0700

Presto Distributed SQL Query Engine

Introduction to Presto Presto is a distributed SQL query engine developed by Facebook for efficient and real-time data analysis.Presto can connect Hive, Mysql, Kafka and other data sources. The most common way to connect Hive data sources is through Presto, which can solve the problem that Hive's MapReduce query takes too long.Presto is a ...

Posted by wing328 on Thu, 16 Sep 2021 12:43:56 -0700

clickhouse type error, aggregate function error -- precautions for field alias

Recently, I came into contact with clickhouse. I have to say that the performance is really powerful. Even the simplest use without any optimization is much faster than a conventional database. Therefore, it has always been used as an ordinary database and supports sql statements. It is easy to get started. However, the case when statement is u ...

Posted by healy787 on Fri, 10 Sep 2021 23:12:28 -0700

Hibernate JPA complex query

Hibernate JPA complex query 1. JPQL statement Full name of JPQL: Java Persistence Query Language EJB query language (EJB QL) and Java persistent query language (JPQL) introduced in EJB 2.0 are portable query languages. They aim to bind SQL syntax and simple query semantics with the expression of object-oriented expression language. Quer ...

Posted by Meissa on Fri, 10 Sep 2021 02:39:57 -0700

Comparison of three batch insertion methods of MyBatis, I recommend the third!

This article is reproduced from: https://mp.weixin.qq.com/s/K-wCUUztBxjGSlv2M5UA1Q This paper is mainly used to record the comparison of three batch insertion methods, so as to facilitate the selection according to the actual situation in the follow-up work The database uses SQL server, JDK version 1.8, and runs in the SpringBoot environment. ...

Posted by pjoshi on Fri, 10 Sep 2021 00:44:40 -0700

Join query for mysql

1. Meaning When fields of multiple tables are involved in a query, a join of multiple tables is required Selectect field 1, field 2 from Table 1, Table 2,...; Cartesian product: When querying multiple tables, no valid join condition is added, resulting in full join for all rows of multiple tables (Table 1 has m rows, Table 2 has n rows, resul ...

Posted by rallan on Wed, 08 Sep 2021 10:04:24 -0700

Analysis and generation of ShardingSphere statements

brief introduction In the previous article, we found a critical path code for converting logical SQL to real SQL. In this article, we will explore some details of statement parsing generation based on the previous article Source code analysis The code generated by the key parsing of the statement is as follows: @RequiredArgsConstructor publ ...

Posted by kaitan on Thu, 02 Sep 2021 17:44:03 -0700

SQL one trick a day: how to parse JSON through HQL

Many data in Hive will be stored in JSON format. For example, when developers embed the page on the APP, they will store multiple fields in a JSON array. Therefore, when the data platform calls the data, it is necessary to analyze the embedded data. Next, let's talk about how JSON data is parsed in Hive. Hive's own json parsing function 1. ge ...

Posted by cypher235 on Thu, 02 Sep 2021 17:13:25 -0700

Views and indexes

1, View (keyword: view) 1. View creation -- Basic format for creating views: create view <View name> as <Query statement>; -- The essence of view is to use<View name>replace<Query statement>,This is equivalent to aliasing the query statement. select * from class; create view v_c as select * from class; -- Created a ...

Posted by CAM on Wed, 01 Sep 2021 17:04:33 -0700

SQL practice: how to calculate user retention with SQL

How to calculate user retention problems with sql 1, Retained 1. Meaning of retention: Retained: refers to the number of users who arrive at the APP on the base date and return to the APP on the next n days; Retention rate = number of users returned on the day n days after the base date / number of users on the base date * 100% Or refers t ...

Posted by punked on Wed, 01 Sep 2021 15:35:54 -0700