MySQL Database Architecture, Querying, and Performance Tuning

Data Definition and Schema Management Table Construction and Inspection Defining the schema involves specifying column names, data types, and constraints. Tables can be inspected using metadata commands to verify structure. Data Type Selection Choosing the correct storage type impacts efficiency and accuracy. Numeric Types Integers and decimals ...

Posted on Thu, 11 Jun 2026 17:44:32 +0000 by Grayda

Database Transactions and Concurrency: ACID Properties and Isolation Levels

1. Introduction to Transactions A transaction is a set of operations that are treated as a single unit. All operations in a transaction are either committed or rolled back together. By default, each SQL statement is an automatic transaction. 2. Transaction Operations -- 1. Check Alice's account balance SELECT * FROM account WHERE name = 'Alice' ...

Posted on Tue, 09 Jun 2026 17:38:10 +0000 by Jona

MySQL Fundamentals and Common Operations

After a prolonged break from coding, I found myself struggling to recall basic SQL syntax 😅 Reviewing my old SQL notes and adding some updates 😂 Primary references: MySQL Documentation: https://dev.mysql.com/doc/refman/8.0/en/tutorial.html Yi Bai Tutorial: https://www.yiibai.com/mysql "Learning SQL" by Alan Beaulieu Basic Operatio ...

Posted on Tue, 09 Jun 2026 17:12:16 +0000 by tidalwave

Interacting with MySQL Databases via Python and PyMySQL

Environment Preparation Before executing database commands, install the required connector package in your Python workspace. pip install pymysql Establishing a Connection Database interactions begin with an active session. The following pattern initializes a connection and retrieves server metadata. import pymysql db_credentials = { &quot ...

Posted on Sun, 07 Jun 2026 18:08:49 +0000 by norpel

SQL Query Strategies: Handling NULL Values in Referee Filtering

Problem Context The objective is to retrieve a list of customer names from a database table, specifically exclduing those who were referred by the customer with ID 2. A naive approach might involve a direct comparison operator in the WHERE clause. SELECT name FROM customer WHERE referee_id <> 2; However, executing this query often yiel ...

Posted on Sun, 07 Jun 2026 17:20:07 +0000 by ollmorris

Understanding MyBatis Caching: First-Level and Second-Level Cache Mechanisms

Introduction to Caching Caching is a common feature in ORM frameworks, designed to enhance query performance and reduce database load by storing frequently accessed data in memory. Cache Architecture In the MyBatis source code, classes related to caching are located in the cache package. The core of this system is the Cache interface, with the ...

Posted on Thu, 04 Jun 2026 18:41:26 +0000 by jini01

Essential MySQL Command Parameters

1. Common mysql Command Options 1. --auto-rehash (tab completion for table names and fields) # mysql -u root --auto-rehash # vim my.cnf [mysql] auto-rehash 2. -B (disable history file, non-interactive mode) # mysql -uroot -D test -e "show tables;" -B 3. -E (vertical output for query results) # mysql -uroot -D test -e "sho ...

Posted on Wed, 03 Jun 2026 16:33:41 +0000 by Vinze

Calculating Capital Gains and Losses from Stock Transactions

The Stocks table schema is defined as follows: Column Name Type stock_name varchar operation enum operation_day int price int The primary key for this table is the combination of stock_name and operation_day. The operation column is an enumeration containing ('Buy', 'Sell'). Each row represents a transaction made on a specific s ...

Posted on Tue, 02 Jun 2026 18:08:55 +0000 by hush2

Conditional Logic in MySQL Using CASE Expressions

Conditional Expression Syntax MySQL supports two forms of conditional expressions using the CASE construct for implementing decision-making logic within queries. Simple CASE Based on Column Values The simple form compares a specific column's value against predefined constants: CASE column_expression WHEN constant_value_1 THEN return_value_1 ...

Posted on Tue, 02 Jun 2026 17:36:31 +0000 by pristanski

Apache Doris Weekly Troubleshooting Digest: SQL, DDL, and Cluster Operations

SQL Execution Error E-3113 on long string columns in 2.1.x Symptom SELECT statements fail with [E-3113] string column length after upgrading to 2.1.0 or 2.1.1. Fix Raise the session variable parallel_pipeline_task_num. On a 32-core / 256 GB node: SET parallel_pipeline_task_num = 16; -- or 32 JDBC catalog connection exhaustion Symptom Can not ...

Posted on Sun, 31 May 2026 00:16:23 +0000 by tmharrison