Practical MyBatis Integration and Advanced Configuration Guide
Core Concepts of MyBatis
MyBatis is a lightweight, flexible persistence framework that bridges Java objects and relational databases. It eliminates boilerplate JDBC code—such as resource management, parameter binding, and result set handling—while retaining full control over SQL. Developers define mappings using XML files or annotations, enabli ...
Posted on Wed, 05 Aug 2026 16:01:02 +0000 by cityboy101
Advanced MySQL Operations: Auto-Increment, Indexes, Foreign Keys, and Data Manipulation
Auto-Increment Configuration
The default behavior for auto-increment columns starts at 1 and increments by 1. However, specific scenarios may require customizing the starting point or the increment step.
Setting the Initial Value
ALTER TABLE records AUTO_INCREMENT = 100;
Adjusting the Increment Step
Session Scope: Affects only the current con ...
Posted on Mon, 03 Aug 2026 16:51:50 +0000 by fandelem
Calculate Percentage of Players Returning the Day After First Login
To determine the fraction of players who log in on the day immediately following their first login, we analyze the Activity table, which records player events with timestamps.
First, identify each player’s earliest login date and compute the expected return date — that is, the day after their first activity:
SELECT player_id, DATE_ADD(MIN(event ...
Posted on Sat, 01 Aug 2026 16:01:13 +0000 by koughman
Extracting Keys from JSON Data in Hive
Process Overview
To extract keys from JSON data in Hive, follow these steps:
Step
Action
1
Create a Hive table
2
Load JSON data into the table
3
Extract keys from the JSON
Step 1: Create a Hive Table
Define a table to store JSON strings. Use the following SQL command:
CREATE TABLE IF NOT EXISTS json_data_table (
json_content S ...
Posted on Thu, 23 Jul 2026 16:21:48 +0000 by wildcolour
Pagination Techniques in Oracle, MySQL, and SQL Server
SQL Server
SQL Server supports multiple approaches for pagination:
Nested TOP Queries (common in older versions):
SELECT TOP (@pagesize) *
FROM (
SELECT TOP ((@pageindex + 1) * @pagesize) *
FROM tbl
ORDER BY sortcolumn ASC
) AS sub
ORDER BY sortcolumn DESC;
ROW_NUMBER() with CTE (requires SQL Server 2005 SP2 or later):
WITH Pag ...
Posted on Wed, 22 Jul 2026 16:46:51 +0000 by alfmarius
MySQL Table Operations
Table Operations
Creating Tables
Syntax:
CREATE TABLE table_name (
field1 datatype,
field2 datatype,
field3 datatype
) character set charset collate collation engine storage_engine;
Explanation:
field represents column name
datatype represents column type
character set charset, if not specified, uses the database's character set
collat ...
Posted on Tue, 21 Jul 2026 16:15:12 +0000 by linkskywalker
Essential MySQL Commands Reference
1.1 Database and Table Operations
Data Definition Language is used for defining database structures
1.1.1 Database Operations
Display all databases: SHOW DATABASES;
Display database creation details: SHOW CREATE DATABASE database_name;
Create a database: CREATE DATABASE database_name;
Create database with existence check: CREATE DATABASE IF NO ...
Posted on Mon, 20 Jul 2026 16:42:45 +0000 by ibechane
Solving Complex SQL Problems: A Micro-to-Macro Approach for Daily New User Retention
Problem Source
This problem is from the SQL section of Niuke's Big Company Real Interview Questions, specifically scenario 02: User Growth (Baidu Information Flow), question SQL164: Calculate the next-day retention rate of new users for each day in November 2021.
Shifting from Macro-to-Micro to Micro-to-Macro
Previous chapters emphasized a top- ...
Posted on Sun, 19 Jul 2026 16:33:12 +0000 by rockindano30
Establishing and Utilizing Oracle Database Links for Cross-Database Operations
Oracle database links (DBLinks) provide a fundamental mechanism for enabling communication and data exchange between separate Oracle database instances. A DBLink defines a logical path from a local database to a remote databace, allowing users and applications to query tables, execute procedures, and perform other operations on the remote syste ...
Posted on Sat, 18 Jul 2026 16:33:24 +0000 by yendor
Database Schema Creation and SQL Query Exercises
Creating Database Tables and Relationshpis
-- Create class table and insert data
CREATE TABLE classes (
class_id INT AUTO_INCREMENT PRIMARY KEY,
class_name VARCHAR(32) NOT NULL DEFAULT ""
) CHARSET utf8;
INSERT INTO classes (class_name) VALUES
("Grade 3 Class 2"), ("Grade 1 Class 3"), ("Grade 3 Class ...
Posted on Sat, 18 Jul 2026 16:10:46 +0000 by mblack0508