some sql & bash script