Prepend a String to a Column Value in MySQL

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

5K+ Views

To prepend a string to a column value in MySQL, we can use the function CONCAT. The CONCAT function can be used with UPDATE statement. Creating a table. mysql> create table PrependStringOnCOlumnName   -> (   -> Id int,   -> Name varchar(200)   -> ); Query OK, 0 rows affected (1.35 sec) Inserting some records. mysql> insert into PrependStringOnCOlumnName values(1, 'John'); Query OK, 1 row affected (0.12 sec) mysql> insert into PrependStringOnCOlumnName values(2, 'Carol'); Query OK, 1 row affected (0.18 sec) mysql> insert into PrependStringOnCOlumnName values(3, 'Johnson'); Query OK, 1 row affected (0.45 sec) ... Read More

Enable LOAD DATA LOCAL INFILE in My.cnf in MySQL

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

2K+ Views

We can enable it with the help of the SET command with GLOBAL. The first time, local infile will be off. The following is the syntax. mysql> SHOW GLOBAL VARIABLES LIKE 'local_infile'; Here is the output. +---------------+-------+ | Variable_name | Value | +---------------+-------+ | local_infile  | OFF | +---------------+-------+ 1 row in set (0.01 sec) We can enable the local infile with the help of ON or boolean value true or numeric value 1. The following is the syntax to enable the local infile. mysql> SET GLOBAL local_infile = 'ON'; Query OK, 0 ... Read More

Take Backup of a Single Table in MySQL Database

George John
Updated on 30-Jul-2019 22:30:23

639 Views

The backup of a table can be made with the help of backup table as well as mysqldump utility. The backup table concept was used in MySQL version 5.0 and its earlier version. Here, I am performing backup with the help of mysqldump. Firstly, we will open cmd with the help of shortcut key. The mysqldump will run at the cmd. Therefore, firstly open cmd with the help of shortcut key − windowskey+R; Here is the snapshot − Now, cmd will open − In this, the MySQL bin folder is present at the following location − ... Read More

Data Link Layer Design Issues

Samual Sam
Updated on 30-Jul-2019 22:30:23

67K+ Views

The data link layer in the OSI (Open System Interconnections) Model, is in between the physical layer and the network layer. This layer converts the raw transmission facility provided by the physical layer to a reliable and error-free link. The main functions and the design issues of this layer are Providing services to the network layer Framing Error Control Flow Control Services to the Network Layer In the OSI Model, each layer uses the services of the layer below it and provides services to the layer above it. The data link layer uses the services offered by the ... Read More

Make an Object Eligible for Garbage Collection in Java

Fendadis John
Updated on 30-Jul-2019 22:30:23

245 Views

Java Garbage collector tracks the live object and objects which are no more need are marked for garbage collection. It relieves developers to think of memory allocation/deallocation issues. JVM uses the heap, for dynamic allocation. In most of the cases, the operating systems allocate the heap in advance which is then to be managed by the JVM while the program is running. It helps in following ways:  Faster object creation as Operating system level synchronization is no more needed for each object. Object Allocation takes some memory and increases the offset. When an object is not required, garbage collector ... Read More

Data Link Layer Services Provided to the Network Layer

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

10K+ Views

In the OSI (Open System Interconnections) Model, each layer uses the services of the layer below it and provides services to the layer above it. The primary function of the data link layer is to provide a well-defined service interface to the network layer above it. Virtual Communication versus Actual Communication The main service provided is to transfer data packets from the network layer on the sending machine to the network layer on the receiving machine. Data link layer of the sending machine transmits accepts data from the network layer and sends them to the data link layer of ... Read More

Passing an Array to a Query Using WHERE Clause in MySQL

George John
Updated on 30-Jul-2019 22:30:23

7K+ Views

We can pass an array with the help of where IN clause. Let us first create a new table for our example. mysql> create table PassingAnArrayDemo   -> (   -> id int,   -> Firstname varchar(100)   -> ); Query OK, 0 rows affected (1.60 sec) Let us now insert records. mysql> insert into PassingAnArrayDemo values(1, 'John'), (2, 'Carol'), (3, 'Smith'), (4, 'Bob'), (5, 'Johnson'), (6, 'David'), (7, 'Sam'), (8, 'Jessica'); Query OK, 8 rows affected (0.32 sec) Records: 8  Duplicates: 0  Warnings: 0 To display all records. mysql> select *from PassingAnArrayDemo; The ... Read More

Introduction to Backtracking Algorithms

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

1K+ Views

The Backtracking is an algorithmic-technique to solve a problem by an incremental way. It uses recursive approach to solve the problems. We can say that the backtracking is used to find all possible combination to solve an optimization problem. In this Section We are going to cover Hamiltonian Cycle M-Coloring Problem N Queen Problem Rat in Maze Problem Cryptarithmetic Puzzle Subset Sum Problem Sudoku Solving Algorithm Knight-Tour Problem Tug-Of-War Problem Word Break Algorithm Maximum number by swapping problem

Operator Functions in Python

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

821 Views

In Python there are some additional standard library methods for mathematical operations, like arithmetic, logical, relational, bitwise etc. operations. These methods can be found under the operator module. To use it at first we need to import it the operator standard library module. import operator In this section we will see some operator functions for bitwise operations and container operations. Arithmetic Operations At first we will see the arithmetic operating functions. These are like below. Sr.No Functions & Description 1 add(x, y) The add() method is used to add two numbers x and y. ... Read More

Type Conversion in Python

Samual Sam
Updated on 30-Jul-2019 22:30:23

1K+ Views

Using Python, we can easily convert data into different types. There are different functions for Type Conversion. We can convert string type objects to numeric values, perform conversion between different container types etc. In this section we will see how the conversions can be done using Python. Converting String to Numeric Types To convert from String type objects to Numeric Objects, there are different methods like int(), float() etc. Using the int() method we can convert any number as string to integer value (base 10). It takes the string type argument, default base is 10, We can also specify the ... Read More

Advertisements