George John has Published 1167 Articles

How to conduct an Accent Sensitive search in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:24

209 Views

To conduct an Accent sensitive search in MySQL, we can use collation with utf8_bin. Here is the syntax to conduct accent sensitive search −yourColumName dataType collate utf8_bin;Apply the above syntax to conduct accent sensitive search. First, let us create a table −mysql> create table AccentSearchDemo -> ( ... Read More

Trace or track Python statement execution (trace)

George John

George John

Updated on 30-Jul-2019 22:30:24

4K+ Views

Function in the 'trace' module in Python library generates trace of program execution, and annotated statement coverage. It also has functions to list functions called during run by generating caller relationships.Following two Python scripts are used as an example to demonstrate features of trace module.#myfunctions.py import math def area(x): ... Read More

What are some good tools to visualize MySQL database schema?

George John

George John

Updated on 30-Jul-2019 22:30:24

191 Views

There are many tools to visualize MySQL database schema. Let us see some of them −SchemaSpyThis tool is based on java and can be used to analyze the metadata of MySQL database schema. Also use it to generate a visual representation of schema. A type of command line tool.The following ... Read More

MySQL ALTER column to remove primary key and auto_increment?

George John

George John

Updated on 30-Jul-2019 22:30:24

2K+ Views

You can use ALTER command to remove primary key and auto_increment. The syntax is as follows −ALTER TABLE yourTableName DROP PRIMARY KEY, change yourColumnName yourColumnName data type;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table removePrimaryKey   ... Read More

Abstract Base Classes in Python (abc)

George John

George John

Updated on 30-Jul-2019 22:30:24

11K+ Views

A class is called an Abstract class if it contains one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and its abstract methods must be implemented by its subclasses.Abstract base classes provide a way to ... Read More

MySQL CAST as DATE?

George John

George John

Updated on 30-Jul-2019 22:30:24

363 Views

There is no difference between cast as Date and date() function in MySQL.The syntax of both cast() and date() is as follows −cast(yourDateTimeColumnName as Date) date(yourDateTimeColumnName)Both functions internally call Item_date_typecast. To check both the functions, let us create a table. The query to create a table is as follows −mysql> ... Read More

Python Garbage Collector interface (gc)

George John

George John

Updated on 30-Jul-2019 22:30:24

154 Views

Automatic garbage collection is one of the important features of Python. Garbage collector mechanism attempts to reclaim memory occupied by objects that are no longer in use by the program.Python uses reference counting mechanism for garbage collection. Python interpreter keeps count of number of times an object is referenced by ... Read More

Sum values of a single row in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:24

1K+ Views

You can use below syntax to sum values of a single row −Case 1 − The following is the syntax if your column does not have NULL value −SELECT yourColumnName1+yourColumnName2+yourColumnName3+.......+N as anyVariableName FROM yourTableName;Case 2 − If your column has NULL value then use this syntax −SELECT IFNULL(yourColumnName1, 0)+ IFNULL(yourColumnName2, ... Read More

MySQL's now() +1 day?

George John

George John

Updated on 30-Jul-2019 22:30:24

4K+ Views

The statement now()+1 day itself states that we need to add a day to the current datetime. You can write the above logic like this −now()+interval 1 day;Or you can write same logic with date_add() function from MySQL like this −date_add(now(), interval 1 day);Let us use the above concept with ... Read More

How to resolve the MySQL error “You have an error in your SQL syntax; check the manualthat corresponds to your MySQL server version for the right syntax to use near?”

George John

George John

Updated on 30-Jul-2019 22:30:24

4K+ Views

To avoid this type of error in MySQL stored procedure, you need to change the delimiter ; to //.Suppose if you are using stored procedure or triggers or even function then you need to change the delimiter. The syntax is as follows.DELIMITER // CREATE PROCEDURE yourProcedureName() ... Read More

Advertisements