Database Interview Questions

DBA Interview Questions II

  1. To display the page number for each page on a report, what would be the source & logical page number or physical page number?
  2. It is possible to use raw devices as data files and what is the advantages over file system files? - Yes. The advantages over file system files. I/O will be improved because Oracle is bypassing the kernel when writing to disk. Disk Corruption will decrease.
  3. What are disadvantages of having raw devices? - We should depend on export/import utility for backup/recovery (fully reliable) The tar command cannot be used for physical file backup, instead we can use dd command which is less flexible and has limited recoveries.

Database Developer Interview Questions

  1. Which of the following has the highest order of precedence?
    1. Functions and Parenthesis
    2. Multiplication, Division and Exponents
    3. Addition and Subtraction
    4. Logical Operations
  2. When designing a database table, how do you avoid missing column values for non-primary key columns?
    1. Use UNIQUE constraints
    2. Use PRIMARY KEY constraints
    3. Use DEFAULT and NOT NULL constraints
    4. Use FOREIGN KEY constraints
    5. Use SET constraints
  3. Which of the following is the syntax for creating an Index?
    1. CREATE [UNIQUE] INDEX index_name OF tbl_name (index_columns)
    2. CREATE [UNIQUE] INDEX OF tbl_name (index_columns)
    3. CREATE [UNIQUE] INDEX ON tbl_name (index_columns)

MySQL Interview Questions

  1. How do you start and stop MySQL on Windows? - net start MySQL, net stop MySQL
  2. How do you start MySQL on Linux? - /etc/init.d/mysql start
  3. Explain the difference between mysql and mysqli interfaces in PHP? - mysqli is the object-oriented version of mysql library functions.
  4. What’s the default port for MySQL Server? - 3306
  5. What does tee command do in MySQL? - tee followed by a filename turns on MySQL logging to a specified file. It can be stopped by command notee.

MySQL Interview Questions II

  1. Explain the difference between MyISAM Static and MyISAM Dynamic. - In MyISAM static all the fields have fixed width. The Dynamic MyISAM table would include fields such as TEXT, BLOB, etc. to accommodate the data types with various lengths. MyISAM Static would be easier to restore in case of corruption, since even though you might lose some data, you know exactly where to look for the beginning of the next record.
  2. What does myisamchk do? - It compressed the MyISAM tables, which reduces their disk usage.
  3. Explain advantages of InnoDB over MyISAM? - Row-level locking, transactions, foreign key constraints and crash recovery.

MySQL Questions II

  1. On executing the DELETE statement I keep getting the error about foreign key constraint failing. What do I do? - What it means is that so of the data that you’re trying to delete is still alive in another table. Like if you have a table for universities and a table for students, which contains the ID of the university they go to, running a delete on a university table will fail if the students table still contains people enrolled at that university. Proper way to do it would be to delete the offending data first, and then delete the university in question. Quick way would involve running SET foreign_key_checks=0 before the DELETE command, and setting the parameter back to 1 after the DELETE is done. If your foreign key was formulated with ON DELETE CASCADE, the data in dependent tables will be removed automatically.

Pages (14): « First ... « 7 8 9 [10] 11 12 13 » ... Last »