5 Jun 2023 LearnSQL.com Team MySQL Cheat Sheet Welcome to the MySQL cheat sheet! Whether you're just starting out with MySQL or you're a seasoned professional looking for a quick reference, this guide is tailor-made for you. This MySQL Cheat Sheet provides a concise and handy reference to the most commonly used MySQL commands and functionalities. It spans a range of topics, from connecting to a MySQL server and managing database contents, to the basic syntax for table creation and modification. Read more 5 Feb 2024 Martyna Sławińska MySQL Practice: Best Exercises for Beginners These 15 MySQL exercises are especially designed for beginners. They cover essential topics like selecting data from one table, ordering and grouping data, and joining data from multiple tables This article showcases beginner-level MySQL practice exercises, including solutions and comprehensive explanations. If you need to practice … Selecting data from one table Ordering and grouping data Joining data from multiple tables … these 15 tasks are just for you! Read more 13 Sep 2022 Tihomir Babic Top 10 MySQL Interview Questions And Answers You learned SQL and now you want to use this valuable skill to get a better job. Now it’s time to prepare for the job interview. We’ve got ten MySQL interview questions and answers to help you with that. In today's hyperconnected world, knowing how to deal with it has become a necessary skill. That’s why you probably learned (or want to learn) SQL: either your job requires it or you realized that you need SQL to get a better job. Read more Latest Articles 10 Sep 2024 Gustavo du Mortier The MySQL CTE and How to Use It Common table expressions (CTEs) in MySQL give even more versatility to this popular database management system. Find out how to use CTEs to simplify complex queries and implement recursion. All programming languages have ways of simplifying problems by breaking them down into parts that can be solved individually. Users can unify the partial results to obtain a single final result. Thanks to something called common table expressions (CTEs), MySQL is now exception. Read more 9 Jul 2024 Maria Durkin SQL vs. MySQL: What’s the Difference? Are SQL and MySQL the same thing? In this beginner-friendly guide, we'll explain the ddifferences of SQL and MySQL – and how they fit into the larger picture of relational database management systems. When you’re getting started with databases, it’s easy to feel overwhelmed by the terminology. SQL, MySQL, other acronyms… It can be a lot. And sometimes – like SQL and MySQL – the terminology can seem more similar than different. Read more 18 Jun 2024 Kamila Ostrowska Mastering MySQL for Data Analysis Mastering MySQL can significantly benefit anyone looking to advance in data science or database management. If you develop your data analysis skills in MySQL, you’re on the right path to positively influence your career. In this article, you’ll learn how to practice MySQL effectively and what kind of learning sources to choose. You’ll see for yourself that MySQL is not rocket science and that using it can be easy and intuitive. Read more 14 Mar 2024 Kamila Ostrowska How to Install MySQL on Ubuntu Looking to install MySQL on Ubuntu? Delve into the world of efficient data management with this comprehensive guide. From updating your package list to securing your installation and ensuring smooth configurations, these step-by-step instructions will help you seamlessly set up MySQL on your Ubuntu system. If you’re reading this article, you’re seriously interested in working with data. What you need is a suitable tool to make it happen. If you’re considering installing MySQL on an Ubuntu Linux system, you may wonder if this combination is a good choice. Read more 20 Feb 2024 Gustavo du Mortier MySQL Date Functions: Complete Analyst’s Guide Master MySQL date functions and acquire a powerful tool to work with date and time information in your data analyses. Working with date and time data is an essential part of data analysis. Here are just three examples: Analyzing historical time series data is crucial for discovering trends and making reliable forecasts based on chronological information. Stock market analysis examines time series data extensively, especially when automated trading algorithms are employed. Read more 13 Feb 2024 Jill Thornhill Integrating SQL with Python for Data Analysis Integrating SQL with Python isn’t difficult. The two tools work together to combine the information-processing power of relational databases with the flexibility of a programming language. In this article, I will discuss the benefits of data analysis using SQL and Python, with real-world coding examples. Why do most of the best data analysis tools on the market – such as Tableau and Power BI – include both SQL and Python in their toolboxes? Read more 15 Jun 2023 Dominika Florczykowska An Overview of MySQL Window Functions MySQL window functions are very helpful when you want to create meaningful reports with SQL. In this article, we’ll demonstrate the most common window functions in MySQL and explain how to use them. MySQL 8.0 introduced a new feature: window functions. These functions are very useful to data analysts and anyone who creates reports using MySQL. Using them, you can easily compute moving averages, cumulative sums, and other calculations over specified subsets of your data. Read more 1 May 2023 How to Divide one Column by Another in MySQL or Oracle Problem You want to divide one column by another in MySQL or Oracle. Example An online store has an orders table with data in the columns order_id, total_order_payment, and item_count. order_idtotal_order_paymentitem_count 124 2154 3562 Let’s say we want to extract the average cost per item for each order, i.e., the total payment for the order divided by the item count. Read more 28 Apr 2023 Jakub Romanowski MySQL Crash Course - An Interview With Rick Silva If you've read my articles before, you probably already know that I love reading. What's more, I also collect SQL books. It may sound weird, but I enjoy comparing different approaches and ways of writing about databases. The best ones end up in our recommended books lists, like The Best SQL Books. One of those books, MySQL Crash Course, has just been released. I was able to talk to its author, Rick Silva, and this is what he told me. Read more 21 Mar 2023 Kamila Ostrowska Best MySQL Courses for Beginners SQL is among the most important languages when it comes to dealing with huge amounts of data. If your job includes analyzing or collecting data and you feel that an Excel file is not enough, you need to learn or develop your SQL skills. And if you learn SQL, you also need to know one of its most popular dialects - MySQL. If you've made the decision to learn SQL, you've come to the right place. Read more 22 Nov 2022 Martyna Sławińska How to Export Data from MySQL into a CSV File A database is a primary platform for working with data and storing data. But often, you must take your data out of the database. Read on to find out how to export data from MySQL database into a CSV file. In this article, we’ll demonstrate how to export data into a CSV file. We’ll start by introducing what a CSV file is and why we use it. Then, we’ll export data from a MySQL database into a CSV file. Read more 24 Oct 2022 How to Compare two Strings in MySQL Problem You have two strings to compare alphabetically in MySQL. Solution 1 The most straightforward method to compare two strings in MySQL is to use standard comparison operators (<, , =): SELECT 'Michael' 'Mike'; And here is the result: 'Michael' 'Mike' 0 The result of 0 means 'false'. A result of 'true' would show a 1. Read more 15 Sep 2022 Martyna Sławińska How to Import a CSV File to a MySQL Database CSV files store and transfer data between databases. Read on to find out how easy it is to work with CSV files in a MySQL database. CSV files are one of the oldest data exchange formats and are still heavily used by IT professionals from various domains. It is common for online data resources and different database software to offer their data uploads and downloads in CSV format. In this article, we’ll briefly review what a CSV file is and how to work with it. Read more 11 Sep 2022 How to Group by Month in MySQL Problem You'd like to group records by month in a MySQL database. Example Our database has a table named hoodie with data in the columns id, color, and production_timestamp. idcolorproduction_timestamp 1Celestial Blue2022-02-01 11:45:23 2Pearled Ivory2022-02-01 11:46:13 3Blush2022-01-22 17:22:05 Solution You can use the MONTH() and YEAR() functions to group records in a table by month. Read more 16 Aug 2022 Alexandre Bruffa PostgreSQL vs. MySQL: Is It Difficult to Switch? So you know PostgreSQL, but the boss has decided to switch to MySQL. What are the differences between these two SQL dialects? We discuss PostgreSQL vs. MySQL in this article. PostgreSQL has gained popularity in the last decade, and many developers and database specialists learned PostgreSQL as their first SQL dialect. But PostgreSQL is not the only relational database; during your IT career, you will probably be asked to use another SQL dialect – like MySQL. Read more 7 Jul 2022 Tihomir Babic An Overview of SQL Text Functions in MySQL Do you work in MySQL as a data analyst? Then you should know how to use its text functions – data analysts don’t work only with numbers. Reporting requires computations, data classification, and label creation, and you can do all of that in MySQL. In this article, I’ll explain several of the most common and useful MySQL text functions by discussing what they do and showing how they do it. Read more 31 May 2022 Dorota Wdzięczna How to Install a MySQL Database on a Windows PC Do you want to install a MySQL database on your Windows computer? And maybe find out how to start using a MySQL database? In this article, we’ll cover the installation process. MySQL is one of the most popular relational database servers. This is one reason to start using a MySQL database. Among the various editions of MySQL delivered by Oracle, the Community edition is available for free. You can download it from the MySQL website. Read more 22 May 2022 How to Get Day Names in MySQL Problem: You want to extract the name of the day of the week from a date in MySQL. Solution 1: Extracting day name using DAYNAME() function To extract the day name from a date in MySQL database, use the DAYNAME() function. It only has one argument: the date itself. Let’s see how it works: SELECT DAYNAME('2022-01-01'); The result is 'Saturday'. Solution 2: Extracting day name using DATE_FORMAT() function There is also an alternative to this function: DATE_FORMAT(). Read more 26 Apr 2022 Kamila Ostrowska Top 5 MySQL Query Tools (Updated for 2024) Are you on the hunt for a MySQL query tool that will make your database management a breeze? Let's dive into five of the best tools out there that promise to boost your productivity and make handling databases feel less like a chore. These tools come packed with features aimed at slashing the time you need to spend managing your data. Whether you're a developer, a database administrator, or just someone eager to get more out of your data management efforts, these MySQL query tools could be just what you need. Read more 22 Feb 2022 Dominika Florczykowska An Overview of MySQL Data Types What data types are available in a MySQL database? In this article, you’ll learn about numeric data types, text data types, and much more! You may have seen our article about data types in SQL. Here, we focus on the MySQL data types. We will discuss the most commonly used ones: numeric, text, and date and time. If you are interested in the topic, be sure to check out our Data Types in SQL course. Read more 21 Nov 2021 How to Limit Results in MySQL, PostgreSQL and SQLite Problem You want to limit the number of rows resulting from a query in MySQL, PostgreSQL, or SQLite. Example In the exam table, there are names of the students with the results of the exam. nameexam_result Janet Morgen9 Taya Bain11 Anne Johnson11 Josh Kaur10 Ellen Thornton8 You want to get the three rows with the best exam results. Read more 27 Oct 2021 Kateryna Koidan SQL Date and Time Functions in 5 Popular SQL Dialects Are you confused by all the date and time functions used across different SQL dialects? In this article, I summarize the date and time data types used in PostgreSQL, Oracle, SQLite, MySQL, and T-SQL. I also provide examples with the key SQL date and time functions used across these dialects. It’s time to become date and time gurus! Do you want to calculate how often employees are running late for work? Read more 24 Oct 2021 How to Find the Name of a Constraint in MySQL Problem You want to find the names of the constraints in a table in MySQL. Example We want to display the names of the constraints in the table student. Solution SELECT TABLE_NAME, CONSTRAINT_TYPE, CONSTRAINT_NAME FROM information_schema.table_constraints WHERE table_name='student'; Here is the result: TABLE_NAMECONSTRAINT_TYPECONSTRAINT_NAME studentPRIMARY KEYPRIMARY studentUNIQUEpersonal_number studentFOREIGN KEYstudent_ibfk_1 studentCHECKstudent_chk_1 Discussion Use the view table_constraints in the information_schema schema. Read more 19 Oct 2021 How to Remove Spaces From a String in MySQL Problem: You want to remove all spaces from a string in MySQL database. Example: Our database has a table named customer_information with data in the columns id, first_name, last_name, and email_address. The email addresses were filled out by the users manually, and some were entered with unnecessary spaces by accident. You want to remove the spaces from the email addresses. idfirst_namelast_nameemail_address 1CalvinRiosrios. Read more 19 Oct 2021 How to Get the Time From a String in MySQL Problem You want to extract the time from a string value in MySQL. Example You have a string value that looks like this: 'Wednesday, 10 February 2021, 12:30:20'. You want to extract only the time part, '12:30:20'. Solution Here’s the query: SELECT DATE_FORMAT( STR_TO_DATE('Wednesday, 10 February 2021, 12:30:20', '%W, %d-%m-%Y, %T'), '%T'); Discussion To illustrate the process more clearly, we will explain this in two parts. First, we have to convert the string to a date value. Read more 29 Aug 2021 How to Split a String in MySQL Problem: You’d like to split a string in MySQL. Example: Our database has a table named Student with data in the columns id and name. idname 1Ann Smith 2Mark Twain 3Brad Green Let’s fetch the data from the column name and split it into firstname and lastname. Solution: We’ll use the SUBSTRING_INDEX() function. Here’s the query: Read more 29 Aug 2021 How to Order by Month Name in MySQL Problem: In a MySQL database, you want to sort the rows by month number, given month names (you want January to be shown first, December last). Example: The birthday table contains two columns: name and birthday_month. The months are given in names, not in numbers. namebirthday_month Ronan TishaNULL Angie JuliaApril Narelle DillanApril Purdie CaseyJanuary Donna NellNULL Blaze GraemeOctober You want to sort the rows by birthday_month. Read more 29 Aug 2021 How to Get the Year and the Month From a Date in MySQL Problem You want to get the year and the month from a given date in a MySQL database. Example Our database has a table named dates with data in the columns id and date. iddate 12008-04-21 21987-12-14 Let’s extract the year and the month from the date. Solution 1 SELECT EXTRACT(YEAR FROM date) AS year, EXTRACT(MONTH FROM date) AS month FROM dates; The result is: Read more 29 Aug 2021 How to Get the Current Date in MySQL Problem You’d like to get the current date in MySQL. Solution Use the CURDATE() function. Here’s the query: SELECT CURDATE(); Here’s the result of the query: 2024-11-03 Discussion Use the CURDATE() function to get the current date. The date can be displayed in two different formats: 'YYYY-MM-DD' (if it is used as a string) or YYYYMMDD (if it is used as a numeric). What does it mean to be used in a string or numeric context? Read more 29 Aug 2021 How to Avoid Dividing by Zero in MySQL Problem You’d like to avoid the division-by-zero error. Example Our database has a table named numbers with data in the columns id, number_a, and number_b. idnumber_anumber_b 140 257-5 3-756 4-670 52355 6-8-4 Let’s divide number_a by number_b and show the table with a new column, divided, with the result of the division. Read more 27 Aug 2021 How to Order by Date in MySQL Problem: You want to sort the rows by date in MySQL. Example 1: The exam table has two columns, subject and exam_date. subjectexam_date Mathematics2019-12-19 English2020-01-08 Science2020-01-05 Health2020-01-05 ArtNULL You want to sort the rows by exam_date. Solution: SELECT * FROM exam ORDER BY exam_date; The result looks like this (the rows are sorted in ascending order by exam_date): Read more 22 Jul 2021 How to Extract Substrings in PostgreSQL and MySQL Problem You'd like to extract a substring from a string in a PostgreSQL or MySQL database. Example 1 In the emails table, there is an email column. You'd like to display the first seven characters of each email. The table looks like this: email jake99@gmail.com tamarablack@zoho.com notine@yahoo.fr jessica1995@onet.pl Solution 1 SELECT email, SUBSTRING(email, 1, 7) AS substring FROM emails; Another syntax: Read more 16 Feb 2021 How to Calculate Timestamp Difference in MySQL Problem You have two columns of the type timestamp and you want to calculate the difference between them. Example In the travel table, there are three columns: id, departure, and arrival. You'd like to calculate the difference between the arrival and the departure. The travel table looks like this: iddeparturearrival 12018-03-25 12:00:002018-04-05 07:30:00 22019-09-12 15:50:002019-10-23 10:30:30 32018-07-14 16:15:002018-07-14 20:40:30 42018-01-05 08:35:002019-01-08 14:00:00 Solution 1: Difference in Days, Hours, Minutes, or Seconds SELECT id, departure, arrival, TIMESTAMPDIFF(SECOND, departure, arrival) AS difference FROM travel; The result is: Read more 24 Jan 2021 How to Calculate the Difference Between Two Dates in MySQL Problem You have two columns of the date type and you want to calculate the difference between them. Example In the travel table, there are three columns: id, departure, and arrival. You'd like to calculate the difference between arrival and departure, or the number of days from arrival to departure inclusively. The travel table looks like this: iddeparturearrival 12018-03-252018-04-05 22019-09-122019-09-23 32018-07-142018-07-14 42018-01-052018-01-08 Solution SELECT id, departure, arrival, DATEDIFF(arrival, departure) AS date_difference, DATEDIFF(arrival, departure) + 1 AS days_inclusive FROM travel; The result is: Read more 6 Nov 2020 How to Get a Remainder Using MOD() in PostgreSQL, MS SQL Server, and MySQL Problem You want to find the (non-negative) remainder. Example In the table numbers, you have two columns of integers: a and b. ab 93 53 23 03 -23 -53 -93 5-3 -5-3 50 00 You want to compute the remainders from dividing a by b. Read more 9 Oct 2020 How to Get Yesterday’s Date in MySQL Problem You would like to display yesterday's date (without time) in a MySQL database. Solution SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS yesterday_date; Assuming today is 2020-09-24, the result is: yesterday_date 2020-09-23 Discussion To get yesterday's date, you need to subtract one day from today's date. Use CURDATE() to get today's date. In MySQL, you can subtract any date interval using the DATE_SUB() function. Read more 24 Sep 2020 Ignacio L. Bisso What Is the MySQL OVER Clause? If you want to learn window functions in MySQL, you need to understand the OVER clause. In this article, we use real-world examples to explain what the MySQL OVER clause is, how it works, and why it’s so awesome. In 2018, MySQL introduced a new feature: window functions. Window functions are a powerful SQL feature that perform a specific calculation (e.g. sum, count, average, etc.) on a set of rows; this set of rows is called a “window” and is defined with the OVER clause. Read more 8 Sep 2020 Dorota Wdzięczna Seven Examples Using MySQL Window Functions Window functions are an advanced SQL feature available in most popular databases. MySQL had not supported them for a long time, but that changed in Version 8.0. They are helpful not only for analysts and people who create reports, but also for other professionals who use databases to select data needed. In this article, we explain the syntax of some popular window functions with practical examples. What Is a Window Function? Read more 27 Apr 2020 How to Remove Leading Characters from a String in MySQL Problem: You’d like to remove a sequence of characters at the beginning of a string in MySQL database. Example: Our database has a table named product with data in three columns: id, name, and model. idnamemodel 1watchLx0A123 2smartwatchLx0W34 3clock photoLx0G100 Let’s trim the model code of each new product, removing the unnecessary characters (Lx0) at its beginning. Read more 21 Mar 2020 How to Replace Part of a String in MySQL Problem: You’d like to replace part of a string with another string in MySQL. Example: Our database has a table named motorbike_sale with data in the id, name, and part_number columns. idnamepart_number 1Harley Davidson x1245-AC2-25 2Honda CB750-x012-GK8-A8 3Suzuki Hayabusa X798-25-28 We’d like to change the motorbikes’ part numbers by replacing all hyphen characters (-) with forward slashes (/). Read more 21 Mar 2020 How to Limit Rows in a MySQL Result Set Problem You’d like to limit the number of rows in a result set in MySQL. Example Our database has a table named student with data in the columns id, first_name, last_name, and age. idfirst_namelast_nameage 1StevenWatson25 2LisaAnderson19 3AliceMiller19 4MaryBrown25 5LucyWatson25 6MichaelJackson22 Let’s select students’ full names and ages, but limit the rows returned to three. Read more 1 Mar 2020 How to Get the Year from a Datetime Column in MySQL Problem You’d like to get the year from a date/datetime column in a MySQL database. Example Our database has a table named conference with data in the columns id, name, and start_datetime. idnamestart_datetime 1Social Media World2019-02-20 14:15:34 2Mobile World 20172017-08-31 20:10:14 3Electronics Show2018-04-03 10:05:45 4Tech Asia 20192019-01-01 12:47:54 For each conference, let’s get its name and year. Read more 1 Mar 2020 How to Get the Month from a Date in MySQL Problem You’d like to get the month from a date/datetime column in a MySQL database. Example Our database has a table named apartment_rental with data in the columns id, address, floor, and start_date. idaddressfloorstart_date 1700 Oak Street22019-03-20 2295 Main Street32019-05-31 3506 State Road12019-01-03 43949 Route 3112019-02-01 For each available apartment, get the address, the floor, and the month when it’s available. Read more 1 Mar 2020 How to Get the Date from a Datetime Column in MySQL Problem You’d like to get the date from a date and time column in a MySQL database. Example Our database has a table named travel with data in the columns id, first_name, last_name, and timestamp_of_booking. idfirst_namelast_nametimestamp_of_booking 1LisaWatson2019-04-20 14:15:34 2TomSmith2019-03-31 20:10:14 3AndyMarkus2019-08-03 10:05:45 4AliceBrown2019-07-01 12:47:54 For each traveler, let’s get their first and last name and the booking date only. Read more 1 Mar 2020 How to Get the Current Date and Time in MySQL Problem You’d like to get the current date and time for a MySQL database. Solution We’ll use one of two functions, CURRENT_TIMESTAMP or NOW(), to get the current date and time. SELECT CURRENT_TIMESTAMP ; Here’s the result of the query: 2023-08-15 11:13:17 Discussion The CURRENT_TIMESTAMP function in the MySQL database returns the current date and time (i.e. the time for the machine running that instance of MySQL). It is given as a value in the YYYY-MM-DD hh:mm:ss format. Read more 1 Mar 2020 How to Find the Number of Days Between Two Dates in MySQL Problem You’d like to get the difference, in days, between two dates in a MySQL database. Example Our database has a table named food with data in the columns id, name, purchase_date, and expiration_date. idnamepurchase_dateexpiration_date 1bread 2019-07-202019-08-22 2butter2018-07-302019-08-10 3milk 2019-01-122019-01-13 4yogurt2019-02-252019-02-24 For each food product, let’s get the name of the product and the number of days between its expiration and purchase dates. Solution We’ll use the DATEDIFF() function. Read more 1 Mar 2020 How to Find the Last Day of a Month in MySQL Problem You’d like to get the date of the last day of the month for a date in a MySQL database. Example Our database has a table named car_sales with data in the columns id, make, model, and sale_date. idmakemodelsale_date 1FordKa2019-02-01 2ToyotaYaris2019-08-15 3OpelCorsa2019-06-22 For each car, let’s get the make and model and the last day of the month in which the car was sold. Read more 1 Mar 2020 How to Change Seconds to a Time Value in MySQL Problem You’d like to display a number of seconds as a time value in hours, minutes, and seconds in MySQL. Example Our database has a table named athlete_score with data in the columns id, first_name, last_name, and score_seconds. idfirst_namelast_namescore_seconds 1EmilyWatson1124 2TomGarcia987 3GaryMartinez1003 4JamesAnderson1233 For each athlete, let’s get their first and last names and their record time from the seconds_record column. Read more 1 Mar 2020 How to Change Datetime Formats in MySQL Problem You’d like to change the format of date and time data in a MySQL database. Example Our database has a table named student_platform with data in the columns id, first_name, last_name, and registration_datetime. idfirst_namelast_nameregistration_datetime 1LoraLorens2019-02-23 12:04:23 2AnneSmith2018-07-10 10:12:15 3TomJackson2019-03-09 08:20:33 4RichardWilliams2018-09-30 06:07:34 For each student, let’s get their first name, last name, and registration date and time. Read more 1 Mar 2020 How to Add Time to a Datetime Value in MySQL Problem You’d like to add a certain amount of time to a datetime value in a MySQL database. Example Our database has a table named flight_schedule with data in the columns flight, aircraft, and arrival_datetime. flightaircraftarrival_datetime EK10L12012019-04-20 15:15:00 AY12K20012019-03-31 20:10:00 LA105F2052019-08-03 11:15:00 LH30K2562019-07-01 12:47:00 For each flight, let’s get the flight code, aircraft code, and a new arrival date and time. Read more 1 Mar 2020 How to Add Days to a Date in MySQL Problem You’d like to add days to a date in a MySQL database. Example Our database has a table named trip with data in the columns id, city, and start_date. idcitystart_date 1Chicago2023-06-22 2Houston2023-07-15 3Dallas2023-08-30 4Austin2023-09-23 Let’s add two days to the start dates and get the trip cities with the new start dates. Read more 17 Aug 2017 Francisco Claria Referential Constraints and Foreign Keys in MySQL Foreign keys and referential constraints allow you to set relationships between tables and modify some of the database engine’s actions. This beginner’s guide explains referential integrity and foreign key use in MySQL. One of the most important aspects of database usage is being able to trust the information you store. Database engines provide several features that help you maintain the quality of your data, like defining required columns as NOT NULL and setting an exact data type for each column. Read more 31 Dec 2014 Agnieszka Kozubek-Krycuń MySQL Collations List Collations To list all collations available in MySQL, use SHOW COLLATION; +-------------------+----------+-----+---------+----------+---------+ | Collation | Charset | Id | Default | Compiled | Sortlen | +-------------------+----------+-----+---------+----------+---------+ | big5_chinese_ci | big5 | 1 | Yes | Yes | 1 | | big5_bin | big5 | 84 | | Yes | 1 | | dec8_swedish_ci | dec8 | 3 | Yes | Yes | 1 | | dec8_bin | dec8 | 69 | | Yes | 1 | | cp850_general_ci | cp850 | 4 | Yes | Yes | 1 | | cp850_bin | cp850 | 80 | | Yes | 1 | | hp8_english_ci | hp8 | 6 | Yes | Yes | 1 | | hp8_bin | hp8 | 72 | | Yes | 1 | | koi8r_general_ci | koi8r | 7 | Yes | Yes | 1 | | koi8r_bin | koi8r | 74 | | Yes | 1 | | latin1_german1_ci | latin1 | 5 | | Yes | 1 | | latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 | | latin1_danish_ci | latin1 | 15 | | Yes | 1 | | latin1_german2_ci | latin1 | 31 | | Yes | 2 | | latin1_bin | latin1 | 47 | | Yes | 1 | | latin1_general_ci | latin1 | 48 | | Yes | 1 | . Read more 26 Aug 2014 Patrycja Dybka SQL vs. Mongo query In recent times, NoSQL databases have become a hot topic and have gained a crowd of advocates. Indeed, when NoSQL database started to arise, SQL-to-NoSQL converters arose with them as well. But unfortunately, thanks to the code conversion possibility, SQL supporters gained unquestionable evidence that in many cases the good, old SQL is much easier to use. Especially when it comes to queries. I performed a quick Google search and found plenty of nice converter tools. Read more 7 Jan 2014 Agnieszka Kozubek-Krycuń MySQL's group_concat Equivalents in PostgreSQL, Oracle, DB2, HSQLDB, and SQLite The GROUP_CONCAT() function in MySQL MySQL has a very handy function which concatenates strings from a group into one string. For example, let's take a look at the children table with data about parents' and children's names. if (typeof VertabeloEmbededObject === 'undefined') {var VertabeloEmbededObject = "loading";var s=document.createElement("script");s.setAttribute("type","text/javascript");s.setAttribute("src", "https://my.vertabelo.com/js/public-model/v1/api.js");(document.getElementsByTagName("head")[0] || document.documentElement ).appendChild(s);} parent_name child_name John Tom Michael Sylvie John Anna Michael Sophie To get the names of children of each person as a comma-separated string, you use the GROUP_CONCAT() function as follows: Read more