database
Top 5 Free Database Systems
MySQL Community Edition MySQL Community Edition is the freely downloadable version of the world’s most popular open source database. It is available under the GPL license and is supported by a huge and active community of open source developers. Get it from here. Microsoft SQL Server Microsoft® SQL Server® 2012 Express is a powerful [...]
Get Field Name and Type of Database Table
Today we will see how we can retrieve table’s columns’ names and types. USE mydatabase GO SELECT column_name, data_type FROM information_schema.COLUMNS WHERE TABLE_NAME = ‘mytable’;
Calculate MySQL Database size
Today we will see how we can retrieve MySQL database size. All databases: SELECT table_schema "Database", SUM( data_length + index_length) / 1024 / 1024 "size in MB" FROM information_schema.TABLES GROUP BY table_schema ; Specific database: SELECT table_schema "Database", SUM( data_length + index_length) / 1024 / 1024 "size in MB" FROM information_schema.TABLES WHERE table_schema=’information_schema’;
Backup SQL Server Database
To create a Full Database Backup using transact sql is simple. The following sql code does the trick: USE database_name; GO BACKUP DATABASE database_name TO DISK = ‘D:\DatabaseBackups\database_name.bak’ WITH FORMAT, MEDIANAME = ‘D_Backups’, NAME = ‘Full Backup of database_name‘; GO
Backup MySQL Database
If you would like to take a mysql database backup from the terminal, all you have to do is to type the command below: mysqldump –opt -h localhost –user=root –password=your_password database_name > database_name_backup.sql that’s it!