Execution order of JOIN, Left JOIN and Right Join tables of SqlServer and MySql
The reason for writing this article is that during the interview, the interviewer asked me what the difference is between a left join b and b right join a. I said there is no difference. The query results are the same, and the performance is the same. The interviewer said that the sequence of small tables and large tables has an impact on the p ...
Posted by Tux-e-do on Fri, 21 Jan 2022 17:26:02 +0100
Sql common errors_ two
1. Exits statement
When MySQL treats the EXISTS clause, it still adopts the execution method of nested subquery. As shown in the following SQL statement:
SELECT *
FROM my_neighbor n
LEFT JOIN my_neighbor_apply sra
ON n.id = sra.neighbor_id
AND sra.user_id = 'xxx'
WHERE n.topic_status < 4
...
Posted by rehfeld on Fri, 21 Jan 2022 15:48:26 +0100
Based on SQL (based on MySQL)
1 SQL overview
1.1 what is SQL
SQL (Structured Query Language) is a "structured query language", which is an operation language for relational databases. It can be applied to all relational databases, such as MySQL, Oracle, SQL Server, etc.
SQL standards (ANSI/ISO) include: 1. SQL-92: SQL language standard issued in 1992; 2. SQ ...
Posted by jtapoling on Fri, 21 Jan 2022 01:15:27 +0100
Read and understand the linked table query
1, Relationship between tables
1.1 one to one
1.2 one to many
A class can have multiple students, which is called one to many relationship
1.3 many to many
A teacher can lead multiple students, and a student can be taught by multiple teachers, so the relationship between the two tables is many to many.
2, Join table query
2.1 co ...
Posted by AJW on Thu, 20 Jan 2022 13:30:56 +0100
[one week introduction to MySQL] multi table query, sub query and common functions
Multi table query, sub query, common function
1, Multi table query
Multi table query: connect multiple tables through key fields with the same meaning in different tables to query the field information in different tables.
Correspondence
One to one: for example, the personnel information table and the personnel identity card correspon ...
Posted by theresandy on Tue, 18 Jan 2022 11:41:50 +0100
03-MySql Performance Monitoring Tool, Performance Tuning EXPLAIN Index Tuning trace Monitoring Sys schema View Call
Performance Monitoring Tools
-- Connect MySQL Number of servers
SHOW GLOBAL STATUS LIKE 'Connections';
-- MySQL Server online time
SHOW GLOBAL STATUS LIKE 'Uptime';
-- Number of slow queries
SHOW GLOBAL STATUS LIKE 'Slow_queries';
-- Select Number of rows returned by the query
SHOW GLOBAL STATUS LIKE 'Innodb_rows_read';
-- implement INSERT Nu ...
Posted by sixseven on Tue, 18 Jan 2022 07:48:11 +0100
SQL training camp -- Task03: complex query methods - views, subqueries, functions, etc
1 View
1.1 what is a view
A view is a virtual table, which is different from a direct operation data table. A view is created according to a SELECT statement. Therefore, when operating a view, a virtual table will be generated according to the SELECT statement that created the view, and then SQL operations will be performed on this virtual ta ...
Posted by duclet on Tue, 18 Jan 2022 06:26:14 +0100
The process of spark sql reading and writing hive
Hive related configuration is required for Spark sql to read and write hive, so hive site is generally used The XML file is placed in the conf directory of spark. Code calls are simple. The key is the source code analysis process and how spark interacts with hive.
1. Code call
Read hive code
SparkSession sparkSession = SparkSession.builder() ...
Posted by Brian W on Tue, 18 Jan 2022 02:41:37 +0100
Niu Ke SQL [common interviewers tear SQL]
Written test question 66: latest login date of each person of Niuke (I)
Detailed description: please write an sql statement to query the last login date of each user, and press user_id ascending sort
Problem solving ideas
Group by userid and take the maximum login time
source code
select user_id, max(date)
from login
group by user_id
order ...
Posted by tapos on Mon, 17 Jan 2022 11:50:51 +0100
Introduction to Hologres TPCH based performance test
Introduction: This paper will introduce how to do performance test based on TPCH data set in Hologres, and provide reference for test results to facilitate you to select product specifications.
background information
TPC-H (Business Intelligence Computing test) is a test set developed by the transaction processing performance Council (TPC) to ...
Posted by blues on Mon, 17 Jan 2022 08:47:52 +0100