Tag Archives: database

Count occurrences both greater than, less than, or equal in MySQL

  SELECT COUNT(recycled) AS “Total”, SUM(CASE WHEN recycled = 1 THEN 1 ELSE 0 END) AS “New”, SUM(CASE WHEN recycled > 1 THEN 1 ELSE 0 END) AS “Recycled” FROM (a SELECT phone_number, count(*) AS recycled, sale_date FROM ( SELECT DISTINCT * FROM ( SELECT customers.phone_number, customers.sale_date FROM customers INNER JOIN ( SELECT customers.phone_number FROM customers WHERE sale_date BETWEEN ‘2014-05-23’ AND ‘2014-05-30’) list on customers.phone_number = list.phone_number ORDER BY phone_number DESC, sale_date DESC ) AS multiple_sales ) AS sale_dates_analysis GROUP

Evaluating a RAM disk as a MySQL data store

DDR3 Memory

I have a situation with a relatively small set of MySQL data (5GB) and a decently large set of available ECC DDR2 memory (32GB). Therefore, I am evaluating storing the entire MySQL data directory on a ramdisk. Along those lines, here are some initial resources: 12 RAM Disk Software Benchmarked for Fastest Read and Write Speed • Raymond.CChttp://www.raymond.cc/blog/12-ram-disk-software-benchmarked-for-fastest-read-and-write-speed/Memory or RAM is much faster speed than a traditional hard drive. If you require to run a software that is database intensive,

How to dump specific tables using mysqldump?

I had forgotten how to dump a specific table using mysqldumb (normally I just dump the entire DB) but thankfully RolandoMySQLDBA had the simple answer! Thanks for the help 🙂 “If you are dumping tables t1, t2, and t3 from mydb” mysqldump -u… -p… mydb t1 t2 t3 > mydb_tables.sql via mysql – How do you mysqldump specific table(s)? – Database Administrators. Rating 5/5 stars, easy and intuitive!

ProFTPd MySQL configuration / Linux free space check / setting Gentoo static IP

Links and info that were useful during a recent database server move: #1 Setting (or changing) a static IP address on Gentoo: Gentoo Forums :: View topic – Switching to a static IP (within your network)http://forums.gentoo.org/viewtopic-t-747458-start-0.html #2 Find out how much disk space is left in Linux, or what the disk size is Linux Command To Find How Much Disk Space Is Being Used Show Displayhttp://www.wallpaperama.com/forums/linux-command-to-find-how-much-disk-space-is-being-used-show-display-t713.htmla simple linux shell command to show you how much space a directory is using

Google Refine / Freebase

It’s always fun to come across awesome new sites! I found Jeff Foster’s site Fatvat when I was searching for some info about Oracle and Larry, Prince Of Darkness… after reading about it on Engadget. Anyway, after all that, here’s some really cool stuff that should be very helpful to some of my database projects: Google Refine, an intro by Jess Foster http://www.fatvat.co.uk/Google Refine is a toy for playing with data, originally developed by the team behind Freebase. It’s a