Generated by All in One SEO v4.9.5.1, this is an llms.txt file, used by LLMs to index the site. # Baeldung on SQL ## Sitemaps - [XML Sitemap](https://www.baeldung.com/sql/sitemap.xml): Contains all public & indexable URLs for this website. ## Posts - [How to Interpret and Fix the MySQL Error 1093 - Can't specify target table for update in FROM clause](https://www.baeldung.com/sql/mysql-fix-error-1093-hy000) - When working with MySQL, we might run into "ERROR 1093 (HY000): You can't specify target table 'x' for update in FROM clause". This error typically occurs when trying to access the outer query table within a subquery in an UPDATE or a DELETE statement. We can't do this, but there are a few ways that we can rework our query to still get what we need. - [Database, Table, and Column Naming Conventions](https://www.baeldung.com/sql/database-table-column-naming-conventions) - Learn about naming conventions for database tables and columns. - [Generate SQL Insert Script From Excel Worksheet](https://www.baeldung.com/sql/excel-worksheet-insert-script) - Explore methods for generating SQL INSERT scripts from an Excel worksheet and best practices for ensuring a smooth execution process. - [What Is Sargability in SQL?](https://www.baeldung.com/sql/sargability) - Learn what sargability is and why it matters. - [Lateral Join vs. Subquery: What’s the Difference](https://www.baeldung.com/sql/lateral-join-vs-subquery) - Explore the differences between lateral joins and subqueries. - [How To Count Distinct Over Multiple Columns](https://www.baeldung.com/sql/count-distinct-on-many-columns) - A quick tutorial on using COUNT DISTINCT on multiple columns in SQL. - [Understanding and Handling the Error Column X is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause](https://www.baeldung.com/sql/invalid-column-aggregate-error) - Learn how to handle a specific error that occurs when SQL can reconcile multiple aggregated data points with their distinct properties. - [Introduction to CrateDB](https://www.baeldung.com/sql/cratedb-introduction) - Discover CrateDB, an open-source, distributed SQL database designed for storing and running high-speed analytics on large volumes of data. - [Import an SQL File Using the Command Line in MySQL](https://www.baeldung.com/sql/mysql-file-import-cmd-line) - Explore commonly used command-line approaches to import an SQL file in MySQL. - [How to Return a Pivot Table Output in SQL?](https://www.baeldung.com/sql/pivot-table-output) - Explore the difficulties associated with pivoting data in SQL compared to spreadsheets. - [Types of Locks in SQL Server](https://www.baeldung.com/sql/ms-sql-locks) - Study the types of locks in SQL Server and when they are used. - [Which MySQL Data Type Is Best for Storing Boolean Values?](https://www.baeldung.com/sql/mysql-boolean) - Learn different ways to represent and handle Boolean values within MySQL databases. - [How to Retrieve the Database Size?](https://www.baeldung.com/sql/database-size) - Learn how to check the size of databases via SQL for different database management systems. - [Viewing Roles and Permissions Granted to Users of Azure SQL Server Instance](https://www.baeldung.com/sql/azure-view-roles-permissions) - Learn to view roles and permissions in Azure SQL Server. - [How to Exclude a Column Using SELECT EXCEPT in SQL](https://www.baeldung.com/sql/select-except-columns) - Learn how to exclude one or more columns when displaying whole tables. - [How to Check Blocking Queries](https://www.baeldung.com/sql/blocking-queries-monitor-fix) - Learn to monitor blocked transactions in SQL Server 2022. - [How to UPDATE a Record Using a SELECT in SQL Server](https://www.baeldung.com/sql/update-via-select) - Learn several methods to use a SELECT statement for updating values through an SQL Server query. - [When to Use Single Quotes, Double Quotes, and Backticks in MySQL](https://www.baeldung.com/sql/mysql-single-double-quotes-backticks) - Learn when to use single quotes, double quotes, and backticks in MySQL. - [Fixing MySQL ‘Host Not Allowed’ Error: A Simple Guide](https://www.baeldung.com/sql/mysql-host-not-allowed-error-troubleshoot) - Learn how to fix this MySQL connection error. - [What Is a Stored Procedure and How Does It Work?](https://www.baeldung.com/sql/stored-procedures-guide) - Learn about the concept of a stored procedure in SQL with practical examples and explore how it can be beneficial when working with databases. - [Guide to Join Types in SQL](https://www.baeldung.com/sql/join-types) - Learn about various types of joins in SQL, including inner joins, left joins, right joins, full outer joins, and cross joins. - [Difference Between Stored Procedure and View](https://www.baeldung.com/sql/stored-procedure-vs-view) - Learn the difference between a stored procedure and a view. - [Removing the Primary Key in a MySQL Table](https://www.baeldung.com/sql/mysql-delete-primary-key) - Learn about dropping a PRIMARY KEY in a MySQL database. - [Retrieving the Current Date and Time in SQL](https://www.baeldung.com/sql/retrieving-current-date-time) - Learn how to obtain the current date and time in MySQL, SQL Server, and PostgreSQL. - [What Does Collation Mean in SQL?](https://www.baeldung.com/sql/collation-guide) - Explore the concept of collation in SQL databases and understand how it affects text comparison and sorting. - [Sorting by a List of Strings in SQL](https://www.baeldung.com/sql/sql-sorting-list-strings) - Learn how to sort a list of strings alphabetically or in a specific order. - [Find Null or Empty Values in SQL](https://www.baeldung.com/sql/select-null-empty-strings) - Learn how to select rows with NULL, empty strings, or both types of values. - [How to Configure Time Zone Settings in MySQL?](https://www.baeldung.com/sql/mysql-configure-time-zone-settings) - Learn how MySQL handles time zones. - [Combining DISTINCT and COUNT in an SQL Query](https://www.baeldung.com/sql/distinct-count-combination) - Learn ways to use COUNT and DISTINCT together within a single SQL query. - [Updating Rows With a Subquery Referencing the Same Table in SQL](https://www.baeldung.com/sql/subquery-update-rows) - Learn how to update a table based on data from that table by using an SQL subquery. - [Get the First Day of a Month in SQL](https://www.baeldung.com/sql/date-get-first-day-month) - Learn how to calculate the first day of a month from a date field in SQL Server, PostgreSQL, and MySQL. - [Exit Out of psql Command-Line Utility](https://www.baeldung.com/sql/exit-psql-cli) - Review the different methods of exiting from the psql command-line utility. - [SQL injection that gets around mysql_real_escape_string()](https://www.baeldung.com/sql/mysql_real_escape_string-injection) - Review some obscure corner cases that enable malicious inputs to slip past mysql_real_escape_string(). - [MySQL Dump by Query](https://www.baeldung.com/sql/mysql-dump-using-query) - Learn how to produce a dump via mysqldump according to a query. - [How to Sort SQL Results With NULL Values at the End When Ascending](https://www.baeldung.com/sql/sort-ascending-null-values-last) - Explore how to ensure NULL values appear last when sorting results in the ascending order. - [What's the Ideal Data Type to Use When Storing Latitude / Longitude in a MySQL Database?](https://www.baeldung.com/sql/mysql-latitude-longitude-storage) - Storing latitude and longitude data in relational databases poses some challenges due to the spatial nature of the data, as traditional numeric data types don't lend themselves well to their related calculations. In this article, we'll explore some options for storing geographical coordinates (latitude/longitude) in MySQL including DECIMAL and POINT. We'll also say why you shouldn't use FLOAT. - [How to Use Columns From a Subselect in WHERE Clause in SQL](https://www.baeldung.com/sql/where-subselect-columns) - Learn how to use columns from subselects within WHERE clauses in SQL. - [What Is a Trigger in SQL?](https://www.baeldung.com/sql/triggers) - Learn how to define and modify triggers in PostgreSQL, MySQL, and SQL Server. - [Reasons the DELETE Statement in SQL Can Be Very Slow](https://www.baeldung.com/sql/delete-statements-slow) - A quick tutorial explaining common reasons why deleting can be slow in an SQL database. - [SQL Query for Calculating a Rolling 7-Day Average](https://www.baeldung.com/sql/compute-rolling-seven-day-average) - Discuss a general approach to calculating a 7-day rolling average, including indexed views in MSSQL Server, materialized views in MySQL, and materialized views with refresh in PostgreSQL. - [SQL WHERE Condition for "Not equal to"](https://www.baeldung.com/sql/where-clause-not-equal) - Explore the intricacies of using the WHERE condition for the "Not equal to" query. - [Find the Default Value of a Column in SQL](https://www.baeldung.com/sql/columns-default-value) - Learn how to find columns' default values in SQL and how they affect data integrity. - [Most Efficient Way to Get Table Row Count in SQL](https://www.baeldung.com/sql/table-row-count-efficient) - Learn efficient ways to get the table row count without performance degradation and burdening the server. - [Introduction to Apache Doris](https://www.baeldung.com/sql/apache-doris-tutorial) - A quick intro to Apache Doris. - [How to Check Indexes on a Table in SQL](https://www.baeldung.com/sql/check-indexes) - Explore various methods to check the indexes of a table in PostgreSQL, MySQL, and SQL Server. - [Retrieving Table and Index Storage Size in SQL](https://www.baeldung.com/sql/determine-table-index-size) - Find out how to compute and analyze the storage usage of your SQL tables and their indexes. - [How to Get OID of PostgreSQL Table](https://www.baeldung.com/sql/postgresql-table-oid) - Explore several methods for retrieving the OID of a table in PostgreSQL. - [Change a PostgreSQL User Password](https://www.baeldung.com/sql/postgresql-user-password) - Learn different ways to update the PostgreSQL user password. - [How to Fix Error 1064 When Using ALTER TABLE ADD CONSTRAINT in MySQL](https://www.baeldung.com/sql/mysql-error-1064) - MySQL's Error 1064 (42000) when using the ALTER TABLE ... ADD CONSTRAINT statement could be tricky to fix. It provides very sketchy information regarding the error itself, only directing the user to check the syntax without telling what the syntax issue is. - [How to Remove the First and Last Character of a Text in SQL](https://www.baeldung.com/sql/remove-first-and-last-text-character) - Learn how to strip the initial and ending characters of an SQL string. - [How to Optimize All the Tables in MySQL](https://www.baeldung.com/sql/mysql-physical-storage-index-optimization) - MySQL supports different types of storage engines, like InnoDB and MyISAM, each with their own propensity for fragmentation or other deterioration that can reduce storage allocation and performance. We can address these by optimizing these takes using a straighforward command or MySQL utility. - [Deleting One of Two Identical Rows in SQL](https://www.baeldung.com/sql/delete-identical-rows) - Learn different approaches to deleting duplicate rows in SQL. - [How to Efficiently Insert Multiple Rows in a Single SQL Query](https://www.baeldung.com/sql/insert-multiple-rows-same-query) - Learn how to insert multiple rows of data into a table using a single SQL query. - [Storing Data in MySQL as JSON](https://www.baeldung.com/sql/mysql-json-column) - Explore various ways to store data as JSON in MySQL. - [Images in MySQL](https://www.baeldung.com/sql/mysql-store-images) - Explore two ways of storing images in a MySQL database. - [Recursive Queries in MySQL](https://www.baeldung.com/sql/mysql-recursive-cte) - Learn how to write a recursive query in MySQL using a recursive common table expression. - [Comments in MySQL](https://www.baeldung.com/sql/mysql-comments-single-line-multiline-hint) - Learn about comment types in MySQL: single-line, multiline, and optimization hints. - [Pattern Matching in MySQL](https://www.baeldung.com/sql/mysql-pattern-matching) - Learn how to search for exact and partial string matches in MySQL. - [How to Find the Engine for a Specific Table in MySQL?](https://www.baeldung.com/sql/mysql-find-table-storage-engine) - Learn how to find the storage engine used for a specific table or all tables in our MySQL database. - [Changing a Table's Storage Engine in MySQL](https://www.baeldung.com/sql/mysql-change-table-storage-engine) - Lean how to change a table's storage engine in MySQL. - [Update Multiple Rows With Different Values With Single Query](https://www.baeldung.com/sql/update-multiple-rows-different-values-same-query) - Explore how to update multiple rows with different values, depending on the value of existing columns - [How to Lock a Single Row in MySQL](https://www.baeldung.com/sql/mysql-lock-single-row) - When using InnoDB in MySQL, we need to consider the rows that are locked by our queries. We may end up locking more rows than we need to, which unnecessarily blocks other queries trying to access the same rows. In this tutorial, we'll look at how we can run SQL statements to lock only a single row. - [Storing a Tree Structure in a Relational Database](https://www.baeldung.com/sql/storing-tree-in-rdb) - A guide to representing trees in relational databases. - [How to Retrieve a Random Row in SQL](https://www.baeldung.com/sql/random-row-select) - A quick and practical guide to retrieving a random row with SQL. - [Running a Query With LIMIT/OFFSET While Still Getting the Total Row Count](https://www.baeldung.com/sql/limit-offset-include-total-row-count) - Learn to use LIMIT and OFFSET to retrieve specific data subsets with the window functions. - [How to Return a Single Row in a Joined Table](https://www.baeldung.com/sql/return-single-row-joined-table) - Learn how to return a single row in a joined table. - [Understanding SQL RANK() vs. ROW_NUMBER()](https://www.baeldung.com/sql/rank-vs-row-number) - Learn about the difference between RANK() and ROW_NUMBER() in SQL. - [Save PostgreSQL Result to a File](https://www.baeldung.com/sql/psql-save-result-file) - Learn how to use PostgreSQL and its command-line interface to export query results to a file. - [Convert Month Number to Month Name Function in SQL](https://www.baeldung.com/sql/convert-month-number-name-function) - Explore different approaches to get the month names using numbers in SQL. - [Get the Description of a Table in SQL](https://www.baeldung.com/sql/table-describe) - Learn how to find an explanation of a table in SQL. - [Run SQL Query on CSV File Contents From the Command Line](https://www.baeldung.com/sql/csv-run-query-cli) - Learn how to run SQL queries on CSV file contents from the command line. - [How to Insert a CSV File Into an SQL Table](https://www.baeldung.com/sql/table-import-csv-file) - Learn to import data from a CSV (Comma-Separated Values) file into an SQL table. - [What Does Keyword “AS” Do in SQL](https://www.baeldung.com/sql/as-keyword-alias) - Learn how to use the AS keyword in SQL queries to rename columns, tables, and subquery results in your queries and enhance the readability and manageability of your SQL code. - [How to Duplicate a Row in a Table Containing an Auto-Increment Field in MySQL](https://www.baeldung.com/sql/mysql-auto-increment-duplicate-row) - The MySQL relational database uses its auto-increment feature to automatically generate a unique, ascending sequence of integers for a column when we add a new row of data. In this tutorial, we'll learn how to handle duplicating rows and how MySQL prevents collisions in various arrangements. - [Differences Between JSON and JSONB Data Types in PostgreSQL](https://www.baeldung.com/sql/postgresql-json-vs-jsonb-data-types) - Explore the differences between JSON and JSONB in PostgreSQL, especially with respect to their storage mechanisms and performance characteristics. - [Using CASE Statements in SQL SELECT Queries](https://www.baeldung.com/sql/case-statements-select-queries) - Learn how to combine SELECT queries with CASE statements for complex conditional checks. - [Performing an Insert if Not Exists Operation in SQL](https://www.baeldung.com/sql/insert-if-not-exists-operation) - Learn about various ways to perform an 'insert if not exists' operation in SQL. - [Updating Data with Joins in SQL Queries](https://www.baeldung.com/sql/updating-data-joins) - Explore various approaches of using UPDATE JOIN to update the data. - [Retrieving Table Primary Key With SQL Queries](https://www.baeldung.com/sql/table-inspect-primary-key) - Learn how to retrieve a table's primary key with SQL queries in MySQL, PostgreSQL, and SQL Server. - [Creating Temporary Tables in a SELECT Statement Without a Separate CREATE TABLE](https://www.baeldung.com/sql/create-temp-tables-select) - Learn how to create temporary tables directly within a SELECT statement in SQL. - [Deleting All Records Except the Top or Bottom N in SQL](https://www.baeldung.com/sql/delete-rows-except-first-last-few) - Learn how to delete all rows from a table except the top or bottom few. - [DELETE With a SELECT Statement in the WHERE Clause](https://www.baeldung.com/sql/delete-select-where-condition) - Explore how to use the DELETE statement in combination with a SELECT query in the WHERE clause. - [Dropping All Database Tables in One SQL Query](https://www.baeldung.com/sql/drop-every-table-single-query) - Discuss how to drop all the tables in a schema using a SQL script. - [Difference Between HAVING and WHERE in SQL](https://www.baeldung.com/sql/having-vs-where) - Learn about the difference between HAVING and WHERE in SQL. - [Difference Between WHERE Clause and ON Clause in JOIN](https://www.baeldung.com/sql/join-where-clause-vs-on) - Learn to use JOIN statements with ON and WHERE clauses. - [Query to Retrieve Rows With Datetime Column Equal to Today in SQL](https://www.baeldung.com/sql/select-rows-current-date) - Learn to filter rows for today's date. - [How to Select a Date Without Including the Time in SQL](https://www.baeldung.com/sql/select-date-without-time) - Learn how to select a Date without the Time in SQL. - [Determine the Database Version in SQL](https://www.baeldung.com/sql/determine-database-version) - Tutorial on finding database server versions for relational databases. - [How to Represent Inheritance in a Database?](https://www.baeldung.com/sql/database-inheritance) - Learn three ways of representing inheritance in a database: table-per-hierarchy, table-per-class, and table-per-concrete-class. - [How to Sum Two Columns in an SQL Query?](https://www.baeldung.com/sql/sum-two-columns) - Learn about summing two columns using column expressions, aggregation, and window functions. - [Using Greater-Than Operator in a SQL CASE Statement](https://www.baeldung.com/sql/case-greater-than-operator) - Learn the proper syntax for using the greater-than operator in SQL CASE statements. - [How to Escape a Single Quote in SQL](https://www.baeldung.com/sql/escape-single-quote) - Learn how to escape a single quote in SQL queries using various methods. - [Counting Distinct Values With Conditions in SQL](https://www.baeldung.com/sql/counting-distinct-values-conditions) - Explore several techniques for counting distinct values with conditions in SQL, focusing on a university database as the example. - [Insert Into a SQL Table or Update if the Row Exists](https://www.baeldung.com/sql/insert-update-if-row-exists) - Explore inserting a row into a SQL table or updating the row if it already exists. - [Deleting Rows Using LEFT JOIN in SQL](https://www.baeldung.com/sql/delete-rows-left-join) - Learn how to delete rows using LEFT JOIN in SQL. - [How to Query for Specific Values in an Integer Column in SQL](https://www.baeldung.com/sql/query-values-integer-column) - Learn how to query specific values from an integer column in SQL. - [Extracting the First N Characters of a Value in SQL](https://www.baeldung.com/sql/extract-first-n-characters) - Learn how to extract a prefix of length N when querying string data in SQL. - [How to Remove the First N Characters of a Column in SQL](https://www.baeldung.com/sql/remove-first-n-characters) - Learn how to use SQL functions such as SUBSTRING and RIGHT to remove the first few characters of a column in SQL. - [Deleting SQL Rows Where IDs Do Not Have a Match From Another Table](https://www.baeldung.com/sql/delete-rows-ids-not-match-other-table) - Learn how to delete rows in SQL where the IDs don't have a match in another table. - [Update Data From One SQL Table to Another Based on ID Match](https://www.baeldung.com/sql/update-data-id-match) - Learn various ways to update data from one table to another based on ID matching. - [UPDATE and REPLACE Part of a String in SQL](https://www.baeldung.com/sql/string-update-replace-substring) - Learn how to use SQL statements to replace any occurrence of a substring within a string, focusing on UPDATE and REPLACE. - [How to List Table Foreign Keys in SQL](https://www.baeldung.com/sql/list-table-foreign-keys) - Learn how to find the foreign keys in a table in MySQL, PostgreSQL, and SQL Server. - [How to Store Decimal Values in SQL](https://www.baeldung.com/sql/column-decimal-number) - Learn how to store decimal values in SQL. - [Inserting Values From a SELECT Statement into Another Table](https://www.baeldung.com/sql/insert-into-select) - Learn about copying data between tables with the INSERT INTO ... SELECT statement - [Change the Data Type of a Column in SQL](https://www.baeldung.com/sql/alter-column-datatype) - Learn to modify the data type of a column of an existing table in an SQL database. - [Check if a Table Exists in a Given Schema in SQL](https://www.baeldung.com/sql/check-table-existence-particular-schema) - Learn how to check if a table with the specified name is present in a particular schema in MySQL, SQL Server, and PostgreSQL. - [Delete Using INNER JOIN in SQL](https://www.baeldung.com/sql/delete-inner-join) - Learn how to use an INNER JOIN to delete data in SQL. - [Script to Generate All Indexes in a Database in SQL](https://www.baeldung.com/sql/script-generate-db-indexes) - Learn how to retrieve all indexes in a database in SQL. - [How to SUM DISTINCT Rows in SQL?](https://www.baeldung.com/sql/sum-distinct-rows) - Learn how to select distinct rows when performing a SUM. - [Rebuilding All Indexes in a SQL Server Database](https://www.baeldung.com/sql/sql-server-rebuild-fragmented-index) - Learn how to rebuild a fragmented index in SQL Server. - [How to Restrict Results to Top N Rows per Group in SQL](https://www.baeldung.com/sql/top-n-rows-window-functions) - By utilizing window functions like ROW_NUMBER(), RANK(), or DENSE_RANK() along with CTE or subqueries, we can partition and rank our data - [How to Fetch Maximum Value for Each Group Using SQL](https://www.baeldung.com/sql/max-value-per-group) - Learn how to fetch the maximum value for each group using SQL. - [How to Ignore an Index in an SQL Query](https://www.baeldung.com/sql/index-exclude) - Learn about running an SQL query by excluding all or specific indexes. - [Altering a Column From NULL to NOT NULL in SQL](https://www.baeldung.com/sql/alter-column-constraint-not-null) - Learn about ways to modify the current NULL constraint of a column in SQL. - [Dropping a Database Table if It Exists in SQL](https://www.baeldung.com/sql/drop-table-if-exists) - Learn to delete a table safely. - [How to Remove Duplicate Rows in SQL](https://www.baeldung.com/sql/duplicate-removal) - A quick tutorial on removing duplicate rows in a SQL database. - [Merging Two Rows in SQL](https://www.baeldung.com/sql/merge-two-records) - Learn how to combine data from two records into a single record in SQL. - [Using ALTER to Drop a Column Only if the Column Exists in SQL](https://www.baeldung.com/sql/drop-column-if-exists) - Learn to use ALTER to drop a column only if it exists. - [Deleting a Column From a Table in SQL](https://www.baeldung.com/sql/delete-column-from-table) - Learn how to delete a specific column from a table using various methods in SQL. - [Understanding the SQL OVER() Clause](https://www.baeldung.com/sql/over) - A quick tutorial on using the OVER function in SQL. - [Retrieve All Table Names From a Specific Database Using SQL](https://www.baeldung.com/sql/find-table-names-within-db) - Explore various ways to retrieve the table names within a specific database. - [How to Execute an IF...THEN Logic in an SQL SELECT Statement](https://www.baeldung.com/sql/select-conditional-logic) - Learn how to use the IF...THEN logic in an SQL query. - [How to Count the Number of Distinct Values in a SQL Column](https://www.baeldung.com/sql/count-distinct-values) - Learn how to count the number of unique values in a column using SQL. - [Checking Database Connectivity With a Script](https://www.baeldung.com/sql/check-connectivity-via-script) - Learn how to check database connectivity with a script. - [Pattern Matching Functions in PostgreSQL](https://www.baeldung.com/sql/postgresql-pattern-matching-functions) - Learn about various pattern matching functions available for PostgreSQL queries. - [Adding a Foreign Key to an Existing SQL Table](https://www.baeldung.com/sql/add-new-foreign-key) - Learn how to add a foreign key to a table. - [Selecting Dates Within a Range Using SQL Queries](https://www.baeldung.com/sql/select-dates-range) - Explore how to effectively select dates within a range using SQL queries. - [Difference Between CTE and Subquery](https://www.baeldung.com/sql/cte-vs-subquery) - Explore and understand, with practical examples, the differences between Common Table Expressions(CTEs) and subqueries. - [Difference Between != and <> for Not Equal in SQL](https://www.baeldung.com/sql/not-equal-operators) - Discover the differeneces between not equal operators in SQL. - [Incorporating IF Statements Within SQL WHERE Clauses](https://www.baeldung.com/sql/if-statement-where-clause) - Learn how to use IF statements inside WHERE clauses on MySQL, SQL Server, and PostgreSQL. - [What Causes "Lock wait timeout exceeded" Error in MySQL?](https://www.baeldung.com/sql/mysql-lock-wait-timeout-error) - Learn about locks in MySQL, understand how they work and when they cause the "Lock wait timeout exceeded" error. - [Understanding MySQL Keys: MUL, PRI, and UNI Explained](https://www.baeldung.com/sql/mysql-keys-mul-pri-uni) - Explore the various types of MySQL keys and their distinct characteristics. - [How to Select Rows in SQL Where a Column Contains Specific Words](https://www.baeldung.com/sql/select-column-contains-specific-string) - Learn how to find the rows where a column contains the given string. - [How to Split Single Column Values to Multiple Columns in SQL](https://www.baeldung.com/sql/split-single-column-values) - Learn how to split a string column into multiple columns using various methods in SQL. - [How to List ALL Grants of a User in SQL](https://www.baeldung.com/sql/show-all-grants-user) - Learn how to list user grants in MySQL, PostgreSQL, and SQL Server. - [Convert Integer to String in PostgreSQL](https://www.baeldung.com/sql/postgredql-convert-integer-string) - Learn how to cast an integer to a string in PostgreSQL. - [How to Back up a Single Table With Its Data From a Database](https://www.baeldung.com/sql/single-table-backup-data) - Learn how to back up an SQL table and its data. - [Making a Column Nullable in SQL](https://www.baeldung.com/sql/nullable-column) - Learn how to make a column nullable in SQL across PostgreSQL, SQL Server, and MySQL. - [How to Execute Multiple Queries Using psql Command From Bash](https://www.baeldung.com/sql/psql-bash-run-multiple-queries) - Learn how to use the psql command from the Bash command line to execute multiple SQL queries at once. - [Getting the Size of a Table in MySQL](https://www.baeldung.com/sql/mysql-determine-table-size) - MySQL supports different types of storage engines and these can take differing amounts of disk space to use when storing tables. Whether it is MyISAM or InnoDB, we can query MySQL to find out how much space each of our tables is taking up to better help us do capacity planning. - [How to Change the Default Port of MySQL](https://www.baeldung.com/sql/mysql-change-default-port) - Add an extra layer of security by changing Mysql's default port. - [Counting Instances of Character in SQL Column](https://www.baeldung.com/sql/counting-character-column) - Learn how to count a character in a column in MySQL, PostgreSQL, and SQL Server. - [Using LEFT OUTER JOIN With a WHERE Clause](https://www.baeldung.com/sql/left-outer-join-where-clause) - Learn how to use LEFT OUTER JOIN with the WHERE clause in major SQL platforms. - [Alter Constraints in SQL](https://www.baeldung.com/sql/alter-constraints) - Learn what to do when you want to change an existing constraint in SQL. - [How to UPSERT (MERGE, INSERT ... ON DUPLICATE UPDATE) in PostgreSQL?](https://www.baeldung.com/sql/postgresql-upsert-merge-insert) - Learn ways to upsert (UPDATE or INSERT) with a singular atomic operation using the PostgreSQL DBMS. - [What Is a Conceptual Data Model and Why Is It Important in SQL Design?](https://www.baeldung.com/sql/design-conceptual-data-model) - Learn about conceptual data modeling, the first step in database design. - [Understanding WHERE 1=0 in SQL: When and Why to Use It](https://www.baeldung.com/sql/where-1-0-clause) - Discover several useful real-world applications for the WHERE 1=0 clause in SQL: metadata retrieval, query safety, dynamic conditions, and empty table creation. - [How to Calculate Percentage With an SQL Statement](https://www.baeldung.com/sql/calculate-percentage) - Learn how to calculate a percentage with an SQL statement. - [Commit, Rollback, Savepoint in MySQL](https://www.baeldung.com/sql/mysql-transaction-management-statements) - Learn to manage transactions in MySQL. - [How Do I Connect to a SQL Database in Python?](https://www.baeldung.com/sql/db-connect-python) - Learn how to connect to a MySQL database from Python. - [How to Replace NULL With 0 in SQL](https://www.baeldung.com/sql/null-replace-with-zero) - Learn cross-compatible and database-specific ways of replacing NULL values with zeros to avoid errors in calculations. - [Implementing Keyword Search in SQL](https://www.baeldung.com/sql/keyword-search-like-full-text) - Learn how to implement keyword search in SQL for simple searches or full-text indexing. - [How to Limit the Number of Rows Returned by SQL Query After Ordering?](https://www.baeldung.com/sql/limit-rows-after-ordering) - Learn how to apply the SQL LIMIT clause and combine it with other SQL mechanisms to get a limited subset of rows after sorting. - [Give All Permissions to a User in SQL](https://www.baeldung.com/sql/user-all-permissions) - Learn how to grant all necessary permissions to a user in PostgreSQL, MySQL, and SQL Server. - [What Are Common Table Expressions (CTE) Used For?](https://www.baeldung.com/sql/common-table-expressions) - A quick tutorial explaining common table expressions in SQL databases. They're particularly useful for simplifying complex queries and organizing intermediate results in a structured manner. - [Why Window Functions Cannot Be Used in WHERE Clause in SQL](https://www.baeldung.com/sql/window-functions-condition-where-clauses) - Sometimes, it would be handy to apply conditions on the window functions in the WHERE clause. Learn why that can't be done and what workarounds you can use. - [The Relationship Between Primary Keys and Clustered Indexes](https://www.baeldung.com/sql/primary-keys-vs-clustered-indexes) - Discover clustered indexes, as well as their relation to and differences from primary keys. - [Function vs. Stored Procedure in PostgreSQL](https://www.baeldung.com/sql/postgresql-function-vs-stored-procedure) - Learn the differences between functions and stored procedures in PostgreSQL. - [Set a Database From Single-User Mode to Multi-User Mode](https://www.baeldung.com/sql/enable-multi-user-mode) - Learn how to change a database from single-user to multi-user modes in various SQL platforms. - [Creating Tables Using the WITH Clause in SQL](https://www.baeldung.com/sql/with-clause-table-creation) - Learn how to create a table using the WITH clause in various SQL database platforms. - [Selecting a Single Row Based on Multiple Criteria From One Column in SQL](https://www.baeldung.com/sql/select-one-row-multiple-conditions-one-column) - Learn how to construct SQL queries for selecting single rows based on several criteria over the same column. - [How to Ignore Case While Searching for a String in SQL?](https://www.baeldung.com/sql/case-insensitive-search) - Learn several methods to perform case-insensitive search in SQL. - [How to Reset Auto Increment in MySQL](https://www.baeldung.com/sql/mysql-reset-auto-increment) - Learn about resetting the auto-increment sequence in MySQL. - [Calculating SUM() for Multiple Rows with Conditions](https://www.baeldung.com/sql/sum-multiple-rows-conditions) - Learn how to use the SUM function with WHERE, GROUP BY, and other more advanced techniques tu sum multiple rows. - [Adding a Comment to a Column When Creating a Table in SQL](https://www.baeldung.com/sql/table-creation-add-column-comment) - Learn how to add a comment to a column when creating a table in various SQL platforms. - [How to Loop Through a Set of Records in SQL](https://www.baeldung.com/sql/loop-through-records) - Learn how to loop through a set of records using various methods in SQL. - [Detecting Locked Tables in MySQL](https://www.baeldung.com/sql/mysql-detect-locked-tables) - Explore several techniques for identifying locks, including SHOW OPEN TABLES, GET_LOCK, and performance_schema.metadata_locks. - [Specify a Password in psql Non-Interactively](https://www.baeldung.com/sql/psql-non-interactive-password) - Learn ways to set up access to a PostgreSQL database via psql without supplying a password interactively. - [Subquery vs. Correlated Subquery: What’s the Difference?](https://www.baeldung.com/sql/subquery-vs-correlated-subquery) - Explore the similarities and distinctions between a subquery and a correlated subquery. - [Inserting Columns at a Specific Position in an Existing SQL Table](https://www.baeldung.com/sql/insert-column-existing-table) - Learn how to insert columns at a specific position in an existing SQL table. - [How to Create JSON Format With GROUP_CONCAT in MySQL](https://www.baeldung.com/sql/mysql-create-json-concat) - Learn about creating JSON format with GROUP_CONCAT() in MySQL. - [Accessing Outer Query Tables Within a Subquery](https://www.baeldung.com/sql/subquery-outer-table-reference) - Learn how to use an outer reference in SQL to access an outer query table within a subquery. - [What Is the Difference Between ER Diagrams and Database Schema?](https://www.baeldung.com/sql/entity-relationship-diagram-vs-database-schema) - Explore the differences between ER diagrams and database schema. - [Remove the Last Two Characters From a String Column in SQL](https://www.baeldung.com/sql/remove-last-two-string-characters) - Learn about ways to use SQL for removing the last two characters of string within a column. - [How to Use SELECT with Multiple Subqueries to Same Table in SQL](https://www.baeldung.com/sql/select-several-subqueries-same-table) - Using multiple subqueries referencing the same table can make the overall query long and inefficient. Learn how to avoid this. - [Summing Values in a Column Grouped by ID in SQL](https://www.baeldung.com/sql/sum-group-by) - A quick tutorial on summing grouped data in SQL. - [How to Handle SQL Column Names That Are SQL Keywords?](https://www.baeldung.com/sql/column-names-use-reserved-words) - Learn how to use reserved words as column names in SQL. - [How to Rename a Database in SQL](https://www.baeldung.com/sql/rename-database) - Learn how to change a database's name. - [Run SELECT Query Without Locking in MySQL](https://www.baeldung.com/sql/mysql-execute-select-no-locking) - Learn about running SELECT queries without using locks. - [When to Use Equals (=) vs. LIKE in SQL Queries](https://www.baeldung.com/sql/queries-equals-vs-like) - Explore the differences between the Equals (=) and LIKE operators and understand how they differ between MySQL, MSSQL, and PostgreSQL. - [How to Get the Day of the Week in SQL](https://www.baeldung.com/sql/day-of-the-week) - Explore various functions to find the day of the week in MySQL, PostgreSQL, and SQL Server. - [Best Practices for String Concatenation and Aggregation in SQL](https://www.baeldung.com/sql/string-concatenation-aggregation) - Explore various practical applications of string concatenation and aggregation in SQL. - [How to Export SQL Schema Without Data](https://www.baeldung.com/sql/export-schema-without-data) - Learn how to export a SQL schema without any data from an existing MySQL or PostgreSQL database. - [How to ORDER BY the Order of Values in a SQL IN() Clause](https://www.baeldung.com/sql/order-by-in-clause) - A quick tutorial on using an IN() clause with ORDER BY for custom ordering with a SQL query. - [Understanding the Purpose of Creating a View in a Database](https://www.baeldung.com/sql/database-view-purpose) - Learn what SQL views are and when they are helpful. - [How to Remove Leading Zeros in SQL](https://www.baeldung.com/sql/remove-leading-zeros) - A quick tutorial on removing leading zeros in numeric data that has been stored as a string. - [Natural vs. Surrogate Keys in Database](https://www.baeldung.com/sql/keys-natural-vs-surrogate) - Explore the concepts of natural and surrogate keys and their ideal use cases. - [Selecting the Bottom N Rows in SQL Queries](https://www.baeldung.com/sql/select-bottom-n-rows) - Learn how to select the bottom N rows in PostgreSQL, MySQL, and SQL Server. - [Difference Between SET autocommit=1 and START TRANSACTION in MySQL](https://www.baeldung.com/sql/mysql-autocommit-one-vs-start-transaction) - Learn about the differences between two transaction-control statements in MySQL: SET autocommit=1 and START TRANSACTION. - [Group Query Results by Month and Year in SQL](https://www.baeldung.com/sql/group-by-date-parts) - Learn how to group query results by year and month in SQL to analyze trends. - [How to Join on the Same Table Twice in SQL](https://www.baeldung.com/sql/join-same-table-twice) - Learn how to join on the same table twice in SQL with various types of queries. - [Turning Off Autocommit For a MySQL Client](https://www.baeldung.com/sql/mysql-turn-off-autocommit-mode) - Learn about turning off the autocommit mode in MySQL. - [Does JOIN Order Matter in SQL?](https://www.baeldung.com/sql/join-order) - Explore the effect of changing the JOIN order in an SQL query. - [Detecting Differences Between Two Tables in SQL](https://www.baeldung.com/sql/find-differences-between-tables) - Explore how to identify the differences between tables using EXCEPT and JOIN queries. - [Physical vs. Logical Deletion of Database Records](https://www.baeldung.com/sql/physical-vs-logical-deletion) - Explore physical and logical methods of deleting database records. - [Difference Between GROUP BY and DISTINCT in SQL](https://www.baeldung.com/sql/group-by-vs-distinct) - Learn the difference between GROUP BY and DISTINCT in SQL. - [Trimming Strings in SQL](https://www.baeldung.com/sql/strings-trim-function) - An introduction to trimming strings in MySQL, PostgreSQL, and SQL Server. - [Which SQL Statements Require a Commit in MySQL](https://www.baeldung.com/sql/mysql-necessary-explicit-commit) - Learn which DDL and DML statements require an explicit COMMIT in MySQL. - [DATETIME2 vs DATETIME in SQL Server](https://www.baeldung.com/sql/sql-server-datetime2-datetime-differences) - Learn about the differences between DATETIME2 and DATETIME in SQL Server. - [How to Retrieve the Size of All Tables in a Database](https://www.baeldung.com/sql/table-size-get) - Explore various methods of retrieving table sizes in PostgreSQL, MySQL, and SQL Server. - [Autocommit Mode in MySQL](https://www.baeldung.com/sql/mysql-autocommit-mode) - Learn about the autocommit mode and how it affects commits and transactions in MySQL. - [Conditionally Renaming a Column if It Exists in SQL](https://www.baeldung.com/sql/rename-only-existing-columns) - Learn how to rename a column only if it exists in MySQL and PostgreSQL. - [Retrieving Data From the Last N Days in SQL](https://www.baeldung.com/sql/select-most-recent-days) - Learn to select rows from the last N days. - [Order String as Number in SQL](https://www.baeldung.com/sql/order-string-as-number) - Explore different methods for sorting numerical values stored as text in SQL databases. - [MySQL Database Engine Types Explained](https://www.baeldung.com/sql/mysql-storage-engine-types) - Learn about MySQL storage engines and their use cases. - [Concatenate with NULL Values in SQL](https://www.baeldung.com/sql/concatenate-null) - Explore various solutions to handle NULL values cautiously with string concatenation. - [How to Retrieve Column Names From a Table in SQL](https://www.baeldung.com/sql/find-table-column-names) - Learn how to extract the names of table columns via SQL. - [Transactions vs Locking Tables in SQL](https://www.baeldung.com/sql/transactions-vs-locking-tables) - Learn the differences and similarities between transactions and locking when it comes to database access via SQL. - [JOIN Syntax vs WHERE JOIN in SQL](https://www.baeldung.com/sql/join-syntax-vs-where-join) - Explore the differences between queries with JOIN and WHERE. - [How to Parameterize an SQL IN Clause](https://www.baeldung.com/sql/parameterize-in-clause) - Learn how to parameterize an SQL IN clause. - [How to Determine the Data Type of a Column Using SQL](https://www.baeldung.com/sql/find-column-data-type) - Learn how to find the data type of a column or all columns in relational databases (PostgreSQL, MySQL, MariaDB, SQL Server...). - [How to Use GROUP BY on Multiple Columns in SQL](https://www.baeldung.com/sql/group-by-multiple-columns) - Learn how to use GROUP BY on multiple columns in SQL. - [Difference Between Joins and Subqueries](https://www.baeldung.com/sql/join-vs-subquery) - Learn the difference between joins and subqueries. - [Full University Schema](https://www.baeldung.com/sql/full-schema) - The full schema used for examples on Baeldung. - [Selecting All Records From One Table That Don’t Exist in Another Table in SQL](https://www.baeldung.com/sql/select-rows-not-in-another-table) - Explore various methods of fetching all the records from one table that aren't present in another table. - [How to JOIN Two SELECT Statement Results](https://www.baeldung.com/sql/join-two-selects) - Explore the concept of SQL joins step-by-step, starting with the basics of SELECT statements and gradually moving into the syntax and applications of joining techniques. - [How to Combine Data From Multiple Tables Using an SQL Joins](https://www.baeldung.com/sql/join-data-multiple-tables) - A quick and practical guide to combining data from multiple tables using SQL. - [When to Avoid Using SELECT * in SQL Queries?](https://www.baeldung.com/sql/select-all-columns-best-practice) - SELECT * returns all the columns, but in some cases, we should avoid this. Learn when SELECT * should not be used. - [Moving Data Between Tables in SQL](https://www.baeldung.com/sql/transfer-data-between-tables) - Learn how to move data between tables in SQL. - [Simple University Schema](https://www.baeldung.com/sql/simple-schema) - The basic schema used for examples on Baeldung. - [Different Types of Keys in SQL](https://www.baeldung.com/sql/key-types) - Effective key management is fundamental to maintaining a well-structured and efficient SQL database. Explore the types of keys you can use. - [How to Check if a Record Exists in SQL](https://www.baeldung.com/sql/record-check-existence) - Explore different methods for checking the existence of a record in an SQL table. - [Generating a Range of Numbers Between Two Values in SQL](https://www.baeldung.com/sql/generate-interval-numbers) - Learn how to generate a range of values in PostgreSQL, MySQL, and SQL Server - [Difference Between JOIN and UNION in SQL](https://www.baeldung.com/sql/join-vs-union) - Learn the difference between JOIN and UNION in SQL. - [Difference Between COUNT(*), COUNT(1), COUNT(column), and COUNT(DISTINCT)](https://www.baeldung.com/sql/count-methods-differences) - A quick and practical overview of various methods of using COUNT. - [Difference Between CHAR, NCHAR, VARCHAR, and NVARCHAR in SQL Server](https://www.baeldung.com/sql/sql-server-char-nchar-varchar-nvarchar) - Explore the differences among four text data types in SQL Server. - [Finding the Maximum Value Across Multiple Columns in SQL](https://www.baeldung.com/sql/max-several-columns) - A quick and practical guide to finding the maximum value across multiple columns in SQL. - [Set Default Values for Columns in SQL](https://www.baeldung.com/sql/column-default-value) - A quick tutorial on setting default values for columns in an SQL table. - [Clustered and Non-Clustered Indexes in SQL](https://www.baeldung.com/sql/index-clustered-vs-non-clustered) - An introduction to clustered and non-clustered indexes in SQL. - [How to Perform an Inner Join With Three Tables in SQL](https://www.baeldung.com/sql/inner-join-three-tables) - Learn how to perform an inner join with three tables in SQL. - [Get Current Timestamp in SQL Server](https://www.baeldung.com/sql/sql-server-current-timestamp) - Quick tutorial on various methods to obtain the current timestamp in SQL Server. - [How to Round Numbers to Two Decimal Places in SQL](https://www.baeldung.com/sql/numbers-rounding-decimal-places) - Learn ways to round numbers in an SQL query. - [Preventing Division by Zero Errors in SQL](https://www.baeldung.com/sql/division-by-zero-avoid) - Learn some techniques for avoiding the divide-by-zero error when writing SQL queries. - [Distinguishing Between UNION and UNION ALL Operations](https://www.baeldung.com/sql/union-duplicates-keep-remove) - We can combine results from multiple queries using the UNION ALL operator. We look at how it works and how it differs from the UNION operator. - [Selecting the Nth Row in an SQL Database Table](https://www.baeldung.com/sql/find-nth-row-table) - A quick and practical guide to selecting the nth row in an SQL table. - [What Are DDL, DML, DCL, and TCL in SQL?](https://www.baeldung.com/sql/ddl-dml-dcl-tcl-differences) - An introduction to DDL, DML, DCL, and TCL in SQL. - [How to Use Condition in Count in SQL](https://www.baeldung.com/sql/count-conditional-aggregation) - Learn how to use conditions in COUNT(). - [Constraints in SQL](https://www.baeldung.com/sql/constraints) - Learn about the SQL constraints for data insertion and manipulation. - [Understanding the Difference Between TRUNCATE, DELETE, and DROP in SQL](https://www.baeldung.com/sql/truncate-vs-delete) - Learn the difference between the TRUNCATE and DELETE operators in SQL. - [Databases: Simple vs. Complex vs. Materialized Views](https://www.baeldung.com/sql/databases-views-simple-complex-materialized) - Learn how simple and complex SQL views differ from materialized views. - [Retrieving Data From Multiple Tables With SQL Queries](https://www.baeldung.com/sql/retrieve-data-multiple-tables) - Learn ways to extract data from multiple tables with SQL. - [How to Identify Duplicate Values in a SQL Table](https://www.baeldung.com/sql/identify-duplicate-values) - A quick and practical guide to identifying duplicate values in an SQL table. - [How to Select Only Rows With Maximum Value in a Column in SQL](https://www.baeldung.com/sql/find-rows-containing-column-max) - Learn how to select rows that contain the maximum value of a column in SQL. - [Identifying Tables Containing a Specific Column Name](https://www.baeldung.com/sql/find-table-with-column-name) - Explore how to find the tables that include a particular column name. - [Matching Multiple Patterns in Queries](https://www.baeldung.com/sql/match-multiple-patterns) - Learn how to use the LIKE and IN operators to filter matches against more than one pattern in a column. - [How to Order Results by Multiple Columns in SQL](https://www.baeldung.com/sql/order-by-several-columns) - Learn how to sort the results of an SQL query by multiple columns in the ORDER BY clause. - [Understanding the Distinction Between EXISTS and IN in SQL](https://www.baeldung.com/sql/in-vs-exists) - Learn about the differences between the EXISTS and IN operators in SQL queries. - [How Does Database Indexing Work?](https://www.baeldung.com/sql/databases-indexing) - Learn why database indexing is vital in optimizing query performance and enhancing the overall efficiency of data retrieval operations. - [Statements and Queries in SQL](https://www.baeldung.com/sql/sql-statements-queries) - Learn more about the differences between statements and queries in SQL. - [Getting Started With TimescaleDB](https://www.baeldung.com/sql/timescaledb) - Learn about TimescaleDB, an open-source time-series database built on top of PostgreSQL. - [Understanding NewSQL Databases](https://www.baeldung.com/sql/database-newsql-intro) - Explore the evolution of data storage and retrieval from traditional SQL to NoSQL databases and then to NewSQL databases. - [Fix the PSQLException: "FATAL: sorry, too many clients already"](https://www.baeldung.com/sql/psqlexception-fatal-sorry-too-many-clients-already-solution) - Learn about the PostgreSQL exception, FATAL: sorry, too many clients already - [Multiple Indexes vs. Multi-Column Indexes](https://www.baeldung.com/sql/multiple-indexes-vs-multi-column-indexes) - Explore database indexes, focusing on the differences between individual and composite indexes. - [Calculating Running Totals in SQL](https://www.baeldung.com/sql/compute-running-totals) - Learn several methods for calculating running totals in SQL - [Understanding the Execution Order of SQL Statements](https://www.baeldung.com/sql/execution-order) - Explore the logical execution order of SQL statements, from FROM to TOP, and learn how this order affects the outcome of a query. - [How to Check if a Column Exists in a Table in SQL](https://www.baeldung.com/sql/table-check-column-exists) - Learn ways to find out whether a column is present in a table using different database management systems. - [Fixing the MySQL Error “Specified key was too long”](https://www.baeldung.com/sql/mysql-fix-key-length-error) - Explore three different ways to solve the "Specified key was too long" error in MySQL. - [Obtaining Multiple Counts Using a Single SQL Query](https://www.baeldung.com/sql/multiple-counts-single-query) - Learn how to do multiple counts with a single query. ## Pages - [Write for Baeldung](https://www.baeldung.com/sql/contribution-guidelines) - SQL Contribution Guidelines - [Apply as an SQL Author](https://www.baeldung.com/sql/author-contact) - Apply to become an author, on Baeldung. - [Our SQL Authors](https://www.baeldung.com/sql/authors) - A quick list of the SQL authors on Baeldung. - [Full Archive](https://www.baeldung.com/sql/full_archive) - Find the full list of SQL posts on Baeldung. ## Categories - [SQL Basics](https://www.baeldung.com/sql/category/sql-basics) - [SQL Queries](https://www.baeldung.com/sql/category/sql-queries) - Explore the guides below to learn some of the most common use cases for both basic and advanced queries in SQL. - [DDL](https://www.baeldung.com/sql/category/ddl) - [SQL Tables](https://www.baeldung.com/sql/category/sql-tables) - [SQL Joins](https://www.baeldung.com/sql/category/sql-joins) - [SQL Functions](https://www.baeldung.com/sql/category/sql-functions) - [SQL Operators](https://www.baeldung.com/sql/category/sql-operators) - [SQL Views](https://www.baeldung.com/sql/category/sql-views) - [SQL Constraints](https://www.baeldung.com/sql/category/sql-constraints) - [Database Access](https://www.baeldung.com/sql/category/database-access) - [DML](https://www.baeldung.com/sql/category/dml) - [Database Concepts](https://www.baeldung.com/sql/category/database-concepts) - [Databases](https://www.baeldung.com/sql/category/databases) - [Security](https://www.baeldung.com/sql/category/security) - [SQL Programming](https://www.baeldung.com/sql/category/sql-programming) - [database-manipulation](https://www.baeldung.com/sql/category/database-manipulation) ## Tags - [no-optins](https://www.baeldung.com/sql/tag/no-optins) - [no-ads](https://www.baeldung.com/sql/tag/no-ads) - [Indexes](https://www.baeldung.com/sql/tag/indexes) - [Transactions](https://www.baeldung.com/sql/tag/transactions) - [Stored Procedures](https://www.baeldung.com/sql/tag/stored-procedures) - [DDL](https://www.baeldung.com/sql/tag/ddl) - [Aggregate Functions](https://www.baeldung.com/sql/tag/aggregate-functions) - [Primary Key](https://www.baeldung.com/sql/tag/primary-key) - [Foreign Key](https://www.baeldung.com/sql/tag/foreign-key) - [Database Trigger](https://www.baeldung.com/sql/tag/database-trigger) - [Exception](https://www.baeldung.com/sql/tag/exception) - [SELECT](https://www.baeldung.com/sql/tag/select) - [INSERT](https://www.baeldung.com/sql/tag/insert) - [UPDATE](https://www.baeldung.com/sql/tag/update) - [DELETE](https://www.baeldung.com/sql/tag/delete) - [COMMIT](https://www.baeldung.com/sql/tag/commit) - [Subquery](https://www.baeldung.com/sql/tag/subquery) - [PostgreSQL](https://www.baeldung.com/sql/tag/postgresql) - [MySQL](https://www.baeldung.com/sql/tag/mysql) - MySQL is a relational database management system based on SQL. It is widely used for storing, managing, and retrieving structured data. Learn about the basic CRUD operations in MySQL besides more complicated topics like storage engines such as InnoDB, indexing, and error handling. - [Lock](https://www.baeldung.com/sql/tag/lock) - [popular](https://www.baeldung.com/sql/tag/popular) - Keep up with the most popular features and technologies through the guides below. - [LIMIT](https://www.baeldung.com/sql/tag/limit) - [COUNT](https://www.baeldung.com/sql/tag/count) - [MAX](https://www.baeldung.com/sql/tag/max) - [SUM](https://www.baeldung.com/sql/tag/sum) - [ORDER BY](https://www.baeldung.com/sql/tag/order-by) - [WHERE](https://www.baeldung.com/sql/tag/where) - [GROUP BY](https://www.baeldung.com/sql/tag/group-by) - [HAVING](https://www.baeldung.com/sql/tag/having) - [LIKE](https://www.baeldung.com/sql/tag/like) - [DISTINCT](https://www.baeldung.com/sql/tag/distinct) - [INNER JOIN](https://www.baeldung.com/sql/tag/inner-join) - [NULL](https://www.baeldung.com/sql/tag/null) - [LEFT JOIN](https://www.baeldung.com/sql/tag/left-join) - [RIGHT JOIN](https://www.baeldung.com/sql/tag/right-join) - [ROWNUM](https://www.baeldung.com/sql/tag/rownum) - [TOP](https://www.baeldung.com/sql/tag/top) - [UNIQUE](https://www.baeldung.com/sql/tag/unique) - [UNION](https://www.baeldung.com/sql/tag/union) - [EXISTS](https://www.baeldung.com/sql/tag/exists) - [Dates](https://www.baeldung.com/sql/tag/dates) - [Strings](https://www.baeldung.com/sql/tag/strings) - [CASE](https://www.baeldung.com/sql/tag/case) - [COALESCE](https://www.baeldung.com/sql/tag/coalesce) - [Numeric Data Types](https://www.baeldung.com/sql/tag/numeric-data-types) - [SQL Server](https://www.baeldung.com/sql/tag/sql-server) - [OFFSET](https://www.baeldung.com/sql/tag/offset) - [ALTER](https://www.baeldung.com/sql/tag/alter) - [CONCAT](https://www.baeldung.com/sql/tag/concat) - [Information Schema](https://www.baeldung.com/sql/tag/information-schema) - [OUTER JOIN](https://www.baeldung.com/sql/tag/outer-join) - [Autocommit](https://www.baeldung.com/sql/tag/autocommit) - [CTE](https://www.baeldung.com/sql/tag/cte) - [UPDATE JOIN](https://www.baeldung.com/sql/tag/update-join) - [OVER](https://www.baeldung.com/sql/tag/over) - [MERGE](https://www.baeldung.com/sql/tag/merge) - [DB Dumps](https://www.baeldung.com/sql/tag/db-dumps) - [Entity Diagram](https://www.baeldung.com/sql/tag/entity-diagram) - [psql](https://www.baeldung.com/sql/tag/psql) - [comment](https://www.baeldung.com/sql/tag/comment) - [Cursors](https://www.baeldung.com/sql/tag/cursors) - [GRANT](https://www.baeldung.com/sql/tag/grant) - [LEN](https://www.baeldung.com/sql/tag/len) - [LENGTH](https://www.baeldung.com/sql/tag/length) - [CHAR_LENGTH](https://www.baeldung.com/sql/tag/char_length) - [JSON](https://www.baeldung.com/sql/tag/json) - [OID](https://www.baeldung.com/sql/tag/oid) - [CSV](https://www.baeldung.com/sql/tag/csv) - [System Catalog](https://www.baeldung.com/sql/tag/system-catalog) - [Boolean](https://www.baeldung.com/sql/tag/boolean) - [reference](https://www.baeldung.com/sql/tag/reference)