How to remove all non-alphanumeric characters from a string in MySQL?

Chandu yadav
Published on 23-Nov-2018 09:37:14
Non-alphanumeric characters are as follows − @, !, #, &, (), ?, / There is no inbuilt function to remove non-alphanumeric characters from a string in MySQL. Therefore, we create a function which removes all non-alphanumeric characters. The function declaration and definition is as follows. mysql> delimiter ... Read More

How to delete all the duplicate records in a MySQL table?

Arjun Thakur
Published on 22-Nov-2018 17:39:51
To delete duplicate records from a table, we can use the DELETE command. Let us now create a table. mysql> create table DuplicateDeleteDemo -> ( -> id int, -> name varchar(100) -> ); Query OK, 0 rows ... Read More

Dunder or magic methods in python

karthikeya Boyini
Published on 22-Nov-2018 17:31:50
magic methods that allow us to do some pretty neat tricks in object oriented programming. These methods are identified by a two underscores (__) used as prefix and suffix. As example, function as interceptors that are automatically called when certain conditions are met. In python __repr__ is a built-in function ... Read More

MySQL select query to select rows from a table that are not in another table?

Chandu yadav
Published on 22-Nov-2018 17:31:59
For our example, we will create two tables and apply Natural Left Join to get the rows from a table not present in the second table. Creating the first table. mysql> create table FirstTableDemo -> ( -> id int, -> ... Read More

How to get the next auto-increment id in MySQL?

Arjun Thakur
Published on 22-Nov-2018 17:26:55
MySQL has the AUTO_INCREMENT keyword to perform auto-increment. The starting value for AUTO_INCREMENT is 1, which is the default. It will get increment by 1 for each new record. To get the next auto increment id in MySQL, we can use the function last_insert_id() from MySQL or auto_increment with SELECT. ... Read More

Reading an image using Python OpenCv module

Samual Sam
Published on 22-Nov-2018 17:25:57
In OpenCv module, we can use the function cv2.imread() to read an image. When inputting the image path, the image should be in the working directory or a full path of image should be given. cv2.IMREAD_COLOR − This function loads a color image and any transparency of image will be ... Read More

Draw geometric shapes on images using Python OpenCv module

karthikeya Boyini
Published on 22-Nov-2018 16:58:10
The basic operations of OpenCV is to draw over images. The ability to add different geometric shapes just like lines, circles and rectangle etc. Often working with image analysis, we want to highlight a portion of the image, for example by adding a rectangle that defines that portion. Also as ... Read More

How can I get enum possible values in a MySQL database?

George John
Published on 22-Nov-2018 16:58:18
We can achieve possible enum value with the help of ‘enum’. The following is the syntax. yourColumnName ENUM(value1, value2, ........................N) Let us first create a table. mysql> create table EnumDemo -> ( -> Light int, -> IsONOrOff ENUM('ON', ... Read More

Rename multiple files using Python

Samual Sam
Published on 22-Nov-2018 16:51:46
rename() method is used to rename a file or directory in Python3. The rename() method is a part of the os module. Syntax for os.rename() os.rename(src, dst) The first argument is src which is source address of file to be renamed and second argument dstwhich is the destination ... Read More

How to quit/ exit from MySQL stored procedure?

Chandu yadav
Published on 22-Nov-2018 16:51:15
We can quit/ exit from MySQL stored procedure with the help of the LEAVE command. The following is the syntax. Leave yourLabelName; The following is an example. Here, we are creating a new procedure. mysql> delimiter // mysql> CREATE PROCEDURE ExitQuitDemo2(IN Var1 VARCHAR(20)) -> ... Read More
Advertisements