Article Tags
Article Tags
How to Update Records in a MySQL Table? (SQL Query Examples)
When using the UPDATE statement to update MySQL records, you must use the WHERE clause to accurately locate rows; you can update multiple columns at one time; use SELECT to preview before execution; support JOIN and subqueries to implement complex updates.
Jan 13, 2026 am 04:57 AM
How to use the HAVING clause in MySQL? (Post-Aggregation Filter)
HAVINGfiltersgroupsafteraggregation,enablingconditionsonCOUNT(),SUM(),AVG(),etc.,unlikeWHEREwhichrunsbeforegroupingandrejectsaggregates.ItrequiresGROUPBYinmostcases,followsitsyntactically,supportscolumnaliases(MySQL≥5.7.5,noONLY_FULL_GROUP_BY),andmus
Jan 13, 2026 am 04:35 AM
How to Create an Index in MySQL to Speed Up Queries? (Best Practices)
Creating appropriate indexes is one of the most effective ways to improve MySQL query performance. It is necessary to first identify high-impact queries, then design compound indexes according to query patterns, keep the index streamlined and maintain it regularly.
Jan 13, 2026 am 03:57 AM
How to get the last inserted ID in MySQL? (LAST_INSERT_ID())
UseLAST_INSERT_ID()immediatelyafteranINSERTwithAUTO_INCREMENT—itreturnsthefirstauto-generatedIDforthatstatement,isconnection-specific,safeforconcurrency,andavoidsraceconditions.
Jan 13, 2026 am 03:26 AM
What is a Primary Key in MySQL and How to Add One? (Guide)
MySQL primary key is a column (or column combination) that uniquely identifies each row in the table. It must be non-empty and unique, and there is only one per table. Clustered indexes are automatically created to improve query performance and support single column or composite primary keys. Use PRIMARYKEY to declare when creating a table, and use ALTERTABLE to add or delete existing tables.
Jan 13, 2026 am 01:54 AM
How to use the GROUP_CONCAT function in MySQL? (String Aggregation)
GROUP_CONCATaggregatesrowsintoacomma-separatedstringpergroup,requiringGROUPBYorimpliedaggregation;ittruncatessilentlyatgroup_concat_max_len(default1024bytes),lacksstandardSQLportability,andneedsexplicitDISTINCT,ORDERBY,SEPARATOR,andNULLhandlingtoavoi
Jan 13, 2026 am 01:35 AM
How to use Temporary Tables in MySQL? (Session Data)
CREATETEMPORARYTABLEcreatesasession-local,auto-droppedtableinvisibletootherconnections;itdefaultstoin-memorystorage,ignoresforeignkeys,allowsnameclasheswithpermanenttables,andsupportsstandardDMLbutnocross-sessionaccessorinheritedindexes.
Jan 13, 2026 am 12:53 AM
How to implement caching with Redis for a MySQL database
Use the cache bypass mode, first check Redis, if there is a miss, load it from MySQL and write it to the cache; 2. Read operations give priority to access Redis, and return directly if they hit, and backfill if they hit MySQL; 3. Delete the corresponding Redis key immediately after updating MySQL for a write operation, ensuring that the cache is refreshed next time; 4. Reasonably design key names and set TTL to prevent data expiration and memory overflow.
Jan 13, 2026 am 12:07 AM
How to use the CASE statement in MySQL? (Conditional Logic)
CASEinMySQLenablesconditionallogicinquerieslikeIF-ELSE,usedmainlyinSELECT,ORDERBY,orWHEREtocategorizeortransformdataonthefly;ithassimple(value-based)andsearched(boolean-expression-based)forms,withsearchedbeingmoreflexibleandNULL-safe.
Jan 12, 2026 am 05:39 AM
How to use the TIMESTAMP data type in MySQL? (Time Zones)
TIMESTAMPstoresvaluesasUTCinternally,convertingfromthesessiontimezoneoninsertandbackonretrieval,unlikeDATETIMEwhichstoresliteralsunchanged;ithasa1970–2038rangedueto32-bitUnixepochlimits.
Jan 12, 2026 am 05:32 AM
How to find the size of a MySQL database? (Disk Space)
Useinformation_schematoestimatedatabasesizeviadata_length index_length,orduforactualfilesystemusage;theydifferduetologicalvs.physicalallocation,pre-allocatedspace,andexcludedserver-widefileslikeibdata1orbinarylogs.
Jan 12, 2026 am 05:10 AM
How to use Full-Text Search in MySQL? (Natural Language Search)
MATCH()...AGAINST()isMySQL’snaturallanguagefull-textsearchsyntaxthatrequiresaFULLTEXTindexonthesearchedcolumns;withoutit,queriessilentlyfailorthrowERROR1191.
Jan 12, 2026 am 04:51 AM
How to implement Pagination in MySQL? (Limit and Offset)
LIMITrestrictsthenumberofrowsreturned,whileOFFSETskipsthefirstNrowsbeforeapplyingLIMIT;togethertheyenablepage-basedpaginationbutdegradewithlargeoffsetsduetofullrowscanning.
Jan 12, 2026 am 03:52 AM
How to create a user and grant permissions in MySQL?
MySQL8.0 requiresexplicitCREATEUSERbeforeGRANT;use'user'@'host'withproperquoting,caching_sha2_passwordauth,andleast-privilegegrants—e.g.,CREATEUSER'myuser'@'localhost'IDENTIFIEDWITHcaching_sha2_passwordBY'StrongPass123!';GRANTSELECT,INSERT,UPDATEONmy
Jan 12, 2026 am 02:19 AM
Hot tools Tags
Undress AI Tool
Undress images for free
AI Clothes Remover
Online AI tool for removing clothes from photos.
Undresser.AI Undress
AI-powered app for creating realistic nude photos
ArtGPT
AI image generator for creative art from text prompts.
Stock Market GPT
AI powered investment research for smarter decisions
Hot Article
Popular tool
vc9-vc14 (32+64 bit) runtime library collection (link below)
Download the collection of runtime libraries required for phpStudy installation
VC9 32-bit
VC9 32-bit phpstudy integrated installation environment runtime library
PHP programmer toolbox full version
Programmer Toolbox v1.0 PHP Integrated Environment
VC11 32-bit
VC11 32-bit phpstudy integrated installation environment runtime library
SublimeText3 Chinese version
Chinese version, very easy to use
Hot Topics
20424
7
13582
4



