Setting UTF-8 as the default encoding for MySQL

Edit the MySQL configuration file from the following path /etc/mysql/my.cnf and set the below configuration: #/etc/mysql/my.cnf [client] default-character-set = utf8   [mysql] default-character-set = utf8   [mysqld] collation-server = utf8_unicode_ci init-connect = ‘SET NAMES utf8’ character-set-server = utf8 Restart the mysql server using the following command /etc/init.d/mysql restart
Continue reading…

Enjoyed this post? Share it!

 
 

what are DDL, DML and DQL?

DDL (Data Definition Language) refers to the CREATE, ALTER and DROP TABLE statements DML (Data Manipulation Language) refers to the INSERT, UPDATE and DELETE statements DQL (Data Query Language) refers to the SELECT statements DCL (Data Control Language) refers to the GRANT and Coconut new you might does. I http://viagraonline-avoided.com/ Research. doesn’t these less want […]
Continue reading…

Enjoyed this post? Share it!

 
 

SQL string function REPLACE()

SQL string function REPLACE() Syntax: REPLACE(column_name, Find, Replace) Description: Used to replace an occurence of string/character in column data Parameters: Column_name – specifies the column to be manipulated Find – string to be matched Replace – string to replace the matched string Example: SELECT name, REPLACE (name, ‘m’, ‘M’) FROM product;
Continue reading…

Enjoyed this post? Share it!

 
 

SQL string function SUBSTRING()

SQL string function SUBSTRING() Syntax: SUBSTRING(column_name, Start, Length). Description: Find the SUBSTRING from column data Parameters: Column_name – specifies the column to be manipulated Start – Offset on the column Length – Number of characters to be extracted Example: SELECT SUBSTRING(name,3,5) FROM product;
Continue reading…

Enjoyed this post? Share it!

 
 

MySQL String Functions

BINARY string1=BINARY(string2) Returns the binary representation of a string. This function can be used to force case-sensitive comparisons when they would otherwise not occur. BIT_LENGTH bits=BIT_LENGTH(string) Returns the number of bits in a string. CHAR_LENGTH length=CHAR_LENGTH(string) Returns the number of characters in a string. Like LENGTH, except that it returns the number of characters, rather […]
Continue reading…

Enjoyed this post? Share it!

 
 

MySQL ASCII Function

The ASCII function in MySQL returns the ASCII character code corresponding to the first character in the provided input string. Example for using the ASCII function CREATE FUNCTION ascii_string (in_string VARCHAR(80) ) RETURNS VARCHAR(256) DETERMINISTIC BEGIN DECLARE i INT DEFAULT 1; DECLARE string_len INT; DECLARE out_string VARCHAR(256) DEFAULT ”;   SET string_len=LENGTH(in_string); WHILE (i<string_len) DO […]
Continue reading…

Enjoyed this post? Share it!

 
 

Advantages of using stored procedures

The use of stored programs can lead to a more secure database. Stored programs offer a mechanism to abstract data access routines, which can improve the maintainability of your code as underlying data structures evolve. Stored programs can reduce network traffic, because the program can work on the data from within the server, rather than […]
Continue reading…

Enjoyed this post? Share it!