Tag: insert()
Insert into a MySQL table or update if exists
While inserting rows into a table, there are times when the requirement is to insert the rows into a table, but if the key already exists, then update the value. This concept is also known as UPSERT, which is combining UPDATE with INSERT. In this article, we will be looking into : Insert or Update …
INSERT record if NOT EXISTS in MySQL
This article will discuss how to insert a record IF NOT EXISTS in MySQL. We will be using MySQL subqueries with NOT EXISTS clause to fulfill the purpose. Table of Contents INSERT NOT EXISTS Syntax INSERT single record if NOT EXISTS in MySQL INSERT multiple record if NOT EXISTS in MySQL INSERT record or UPDATE …
MySQL: Insert in a loop
This article will discuss how to insert rows in a MySQL table using a loop. Apart from integer and string data types, we will also cover how to insert dates in a loop and control loops with date-specific conditions. Table of Contents MySQL Insert Rows in a Loop MySQL Insert Date Loop MySQL Insert Rows …
MySQL trigger example after insert
In this article, we will see how to create the AFTER INSERT trigger with a practical example. Table of Contents:- Syntax of AFTER INSERT trigger Example of AFTER INSERT trigger READ MORE ABOUT TRIGGERS: What are triggers in MySQL Advertisements Let us get started by making the sample data. We will be creating two tables sale_details and total_sales. …
MySQL trigger example before insert
In this article, we will see how to create the BEFORE INSERT trigger with a practical example. READ MORE ABOUT TRIGGERS: What are triggers in MySQL Table of Contents:- Advertisements Syntax of BEFORE INSERT trigger Example of BEFORE INSERT trigger Let us get started by making the sample data. We will be creating two tables, emp_rating …
MySQL Insert with Join
This article will look into how to insert rows to a MySQL table using the JOINs. JOINs help us retrieve records from more than one table that is logically related to each other. Let us get started by making the sample data. We will be creating three tables employee_designation, employee_rating, and employee_details, followed by inserting a few rows …
Javascript: Insert an item to array at specific index
While working with javascript arrays, often there is a requirement to insert an item at a specific index in javascript. This article will discuss adding an element to an array at a particular index. Table of Contents:- Insert element in array at specific position using splice() Insert element in array at specific position using reduce() …
Javascript: Insert an item to array at specific indexRead More
Insert an element at the beginning of NumPy Array
In this article, we will learn how to add an element to the front of NumPy Array in Python. Given a NumPy array, we need to add an element to the front of NumPy Array i.e. insert an element at the 0th index position of the array. Example: Given array: [1, 3, 5, 8, 9] …
Python List insert()
In this article, we will learn about the insert() method of List in Python. Table Of Contents Introduction Syntax of insert() method of List Parameters of insert() method Return value of insert() method Examples of List insert() Insert a string at a specific position in the List of strings Insert an integer at a specific …