Oracle Database Interview Questions & Answers Set-17

«« Previous
Next »»

1. What are the security alerts while using MySQL?

  • Install antivirus and configure the operating system's firewall.
  • Never use the MySQL Server as the UNIX root user.
  • Change root username and password
  • Restrict or disable remote access.

2. How to change a password for an existing user via Mysqladmin?

Ans: Mysqladmin -u root -p password "newpassword".

3. What is the difference between Unix timestamps and MySQL timestamps?
Ans: Actually both Unix timestamp and MySQL timestamp are stored as 32-bit integers but MySQL timestamp is represented in readable format of YYYY-MM-DD HH:MM:SS format.

4. How to display Nth highest salary from a table in a MySQL query?
Ans: Let us take a table named employee.

To find Nth highest salary is:
select distinct(salary) from employee order by salary desc limit n-1,1

if you want to find 3rd largest salary:
select distinct(salary) from employee order by salary desc limit 2,1

5. What is MySQL default port number?
Ans: MySQL default port number is 3306.

6. What is REGEXP?
Ans: REGEXP is a pattern match using regular expression. Regular expression is a powerful way of specifying a pattern for a complex search.

7. How many columns can you create for an index?
Ans: You can create maximum of 16 indexed columns for a standard table.

8. What is the difference between NOW() and CURRENT_DATE()?
Ans: NOW() command is used to show current year, month, date with hours, minutes and seconds while CURRENT_DATE() shows the current year with month and date only.

9. What is the query to display top 20 rows?
Ans: SELECT * FROM table_name LIMIT 0,20;

10. Write a query to display current date and time?
Ans: If you want to display current date and time, use -

If you want to display current date only, use -

11. What is save point in MySQL?
Ans: A defined point in any transaction is known as savepoint.

SAVEPOINT is a statement in MySQL which is used to set a named transaction save point with a name of identifier.

12. What is SQLyog?
Ans: SQLyog program is the most popular GUI tool for admin. It is the most popular MySQL manager and admin tool. It combines the features of MySQL administrator, phpMyadmin and others MySQL front ends and MySQL GUI tools.

13. How do you backup a database in MySQl?
Ans: It is easy to backing up data with phpMyAdmin. Select the database you want to backup by clicking the database name in the left hand navigation bar. Then click the export button and make sure that all tables are highlighted that you want to backup. Then specify the option you want under export and save the output.

14. What is SQL Server?
Ans: SQL Server is DBMS system provided by Microsoft. Sometimes it is mistakenly referred as SQL but both are totally different, as SQL is a language whereas SQL Server is a Microsoft product that supports SQL.

15. What is normalization?
Ans: In RDBMS, the process of organizing data to minimize redundancy is called normalization. In normalization database is divided in two or more tables and a relationship is defined among the tables.

«« Previous
Next »»