Sunday, August 3, 2014

oDesk mysql test answer 2014


Q - what is the name of the utility used to extract NDB configuraion information
A - ndb_config

Q - transactions and commit/rollback are supported by mysql using the myisam engine
A – False

Q18.Examine the data in the employees table given below:
last_name department_id salary
ALLEN 10 3000
MILLER 20 1500
King 20 2200
Davis 30 5000
Which of the following Subqueries will execute well?
a. SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department_id);
b. SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id); c. SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);
d. SELECT department_id FROM employees WHERE SALARY > ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);
e. SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));

Q - what will happen if two tables in a database are named rating and RATING
A - c. This is possible on UNIX/LINUX and not on Windows platform

Q - what is NDB
A - storage engine

Q - what privileges do you need to create a function in mysql
A - CREATE ROUTINE Q - Which of the following relational database management systems is simple to embed in a larger program
A – Both

Q13.Which of the following statements are true?
a. Names of databases, tables and columns can be up to 64 characters in length
b. Alias names can be up to 255 characters in length
c. Names of databases, tables and columns can be up to 256 characters in length
d. Alias names can be up to 64 characters in length

Q - What is wrong with the following query
A – Answer A – In the subquery ‘*’

Q17.Which one of the following correctly selects rows from the table myTable that have NULL in column column1?
a. SELECT * FROM myTable WHERE column1 IS NULL
b. SELECT * FROM myTable WHERE column1 = NULL
c. SELECT * FROM myTable WHERE column1 EQUALS NULL
d. SELECT * FROM myTable WHERE column1 NOT NULL
e. SELECT * FROM myTable WHERE column1 CONTAINS NULL

Q - how can a innodb database be backed up without locking the tables
A – mysqldump --single-transaction db_name