Few MySQL commands

1)employee and books are tow tables. Common fields are department.
need information from 2 tables.

Answer : # select employee.id, employee.name, books.bookname from employee, books where employee.dept=books.dept;

2)Print Name of the employee who can use bookname=’orgonic’
employee table has name and department, books table has dept and booknames
Answer: this we can do by select in select command.
#select employee.name, employee.salary from employee where employee.dept=(select dept from books where bookname=’orgonic’)

3)how to clear the mysql command line screen 

Ans: 1) ctrl+l 2) system clear;

4) Reset the MySQL Root Password in Ubuntu

Answer : #dpkg-reconfigure mysql-server-5.5 <–menu based

5) Reset the MySQL Root Password in Cent OS  –> command based

Answer : #/usr/bin/mysql_secure_installation

#/usr/bin/mysqladmin -u root password ‘new-password’