TRUNCATE TABLE Statement in MySQL

TRUNCATE TABLE statement empties a table completely. Logically, it is similar to a DELETE statement that deletes all rows, or a sequence of DROP TABLE and CREATE TABLE statements. Syntax Following is the syntax of TRUNCATE TABLE statement: TRUNCATE [TABLE] table_name; It will delete all data in a table table_name. [...]

By |2020-09-29T17:09:25+05:30September 29th, 2020|Categories: Programming|Tags: |

Create Database in MySQL

A database is a directory that contains all files which correspond to tables in the database. To create a new database in MySQL, use following syntax: CREATE DATABASE [IF NOT EXISTS] database_name [CHARACTER SET charset_name] [COLLATE collation_name] It will create a new database, where database_name : Name of the database. [...]

By |2020-09-29T15:24:30+05:30September 29th, 2020|Categories: Programming|Tags: , |

Views in SQL

Views in SQL are the virtual tables. They have rows and columns like they are present in the normal database tables. But it fetches selective portion of the data from one or more tables. A view is a named query stored in the database catalog. Creating View To create a [...]

By |2020-09-29T13:31:47+05:30September 29th, 2020|Categories: Programming|Tags: |

Mathematical Functions in MySQL

MySQL provides various built-in functions for numerical operations. Commonly used functions are ABS()CEIL()FLOOR()ROUND()MOD()RAND()POW()TRUNCATE()DIV ABS() It returns the absolute (positive) value of a number. Following shows the syntax of the ABS() function ABS(number) number is a literal number or an expression that evaluates to a number. In case number is zero [...]

By |2020-10-01T10:42:00+05:30April 28th, 2020|Categories: Programming|Tags: , |

SOUNDEX and DIFFERENCE Function in MySql

SOUNDEX() This function accepts a string and converts it to a four-character code based on how the string sounds when it is spoken. The first character is the first letter of the phrase. Vowels are omitted unless the first letter of the phrase is a vowel and the other three [...]

By |2020-04-28T21:11:59+05:30April 27th, 2020|Categories: Programming|Tags: , |

Numeric Base Conversion in MySQL

Introduction MySql provides various function to convert a number from one base to other base. Commonly used function for base conversion are BIN()OCT()HEX()CONV() BIN() This function is used for converting from decimal to binary. Syntax of the function is BIN(number) number is the decimal number you want to convert to [...]

By |2020-04-27T22:07:21+05:30April 27th, 2020|Categories: Programming|Tags: , |
Go to Top