Tag: multiple
Python Set: Remove single or multiple elements from a set?
In this article we will discuss different ways to remove single or multiple elements from a set in python. Remove a single element from a set Suppose we have a set of numbers in python, Advertisements # Create a set of numbers set_of_num = {1, 2, 11, 6, 7, 4, 5} print(‘Original Set: ‘) print(set_of_num) …
Python Set: Remove single or multiple elements from a set?Read More
Python: Dictionary with multiple values per key
In this article, we will discuss how to create and manage a dictionary in which keys can have multiple values. In python, if we want a dictionary in which one key has multiple values, then we need to associate an object with each key as value. This value object should be capable of having various …
Python: Replace multiple characters in a string
In this article, we will discuss different ways to replace multiple characters in a string in Python. Table of Contents: Replace multiple characters in a string using the replace() Replace multiple characters in a string using the translate () Replace multiple characters in a string using regex Replace multiple characters in a string using for …
How to get multiple counts in single MySQL query
This article will be taking an example table customer_data and will try to get multiple counts from this table within a single query. Topics covered: COUNT(*) GROUP BY COUNT(DISTINCT) BASED ON CONDITION Let us get started by creating the table customer_data and inserting the data into it. CREATE TABLE customer_data ( customer_id INT , customer_name VARCHAR(255), customer_address VARCHAR(255), customer_level …
Select from multiple tables MySQL
This article will be looking into queries to select from multiple tables through different ways for different requirements. Table of Contents Select from multiple tables MySQL using JOINS Select from multiple tables MySQL using UNIONS Select from multiple tables MySQL using Subqueries Select from multiple tables MySQL with IN() Before moving into each section, let …
MySQL- Add multiple columns after a specific column
This article will be looking into how to add multiple columns after the last or a specific column in MySQL. Table of Contents MySQL- how to add multiple columns after the last column MySQL -how to add multiple columns after a specific column MySQL -how to add multiple columns after different specific columns MySQL -how …
MySQL- Add multiple columns after a specific columnRead More
Pandas: Select multiple columns of dataframe by name
In this article, we will discuss different ways to select multiple columns of dataframe by name in pandas. Table of Contents Select multiple columns by name in pandas dataframe using [] Select multiple columns by name in pandas dataframe using loc[] Overview of df.loc[] Example of selecting multiple columns using loc[] Suppose we have a …
Pandas: Select multiple columns of dataframe by nameRead More
MySQL Select Multiple Values
This article will see how to select multiple values using the IN and OR operators in MySQL WHERE clause. Table of Contents:- MySQL select multiple values using IN operator MySQL select multiple values using OR operator MySQL select multiple values using combination of IN and OR operator Let us get started by making the sample …
Concatenate multiple MySQL rows to one field
This article will see how to concatenate the MySQL query results from multiple rows into a single field through many examples. We can also say that we want to see the results from the MySQL query into a single-row column. We will be using the GROUP_CONCAT() function of MySQL in the below examples. GROUP_CONCAT(expression) will …
Mysql update set multiple rows
This article will see how to update multiple rows with different values of a MySQL table in a single query. We will be illustrating the concept with various examples. Let us get started by making the sample data. We will be creating a table, sale_person_data, followed by inserting a few rows to it. # create the …