Posts tagged sql
How to list all MySQL databases on a server
SHOW databases;
How to delete all rows in a MySQL or Oracle table
There are two methods:
DELETE FROM table_name
or
TRUNCATE TABLE table_name
The latter is more efficient, because it does not reference each row before deleting; it is a bulk operation. The former is expanded into DELETE * FROM table_name
, which works on one row at a time. Therefore, use the latter.
How to open the database's CLI in Ruby on Rails
rails dbconsole
Should I use MySQL or PostgreSQL with Ruby on Rails?
PostgreSQL.
(Updated for 2015.)
How to delete a database in SQL
DROP DATABASE name_of_database_goes_here;