MYSQL

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. [...]

2020-09-29T17:09:25+05:30Categories: 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. [...]

2020-09-29T15:24:30+05:30Categories: 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 [...]

2020-09-29T13:31:47+05:30Categories: 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 [...]

2020-10-01T10:42:00+05:30Categories: 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 [...]

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