Top DB Development Interview Questions :: ALLInterview.com http://www.allinterview.com Top DB Development Interview Questions en-us Define candidate key, alternate key, composite key? http://www.allinterview.com/showanswers/11457.html A composite Key can be either Primay or Unique Key More then One Key columns are said to be composite keys Candidate Key(Primary Key) is a Key which Maintains the Row Uniue .Can be defined based on the Entity Alternate Key or Unique Key is What is denormalization and when would you go for it? http://www.allinterview.com/showanswers/11455.html Denormalization is introcution of controlled redundancy in the database. Use denormalization generally to optimize performace of select query. to minimize joins used in the query. What is a self join? Explain it with an example? http://www.allinterview.com/showanswers/11452.html CREATE TABLE candytest (kidId char(2), candycolor varchar(10) ) GO INSERT INTO candytest SELECT 'K1', 'Yellow' INSERT INTO candytest SELECT 'K1', 'Red' INSERT INTO candytest SELECT 'K2', What are cursors? Explain different types of cursors? http://www.allinterview.com/showanswers/11442.html Implicit Cursors --Occurs on behalf of every sql statement Explicit Cursors --Named Cursors used in Plsql Paramaeteried Cursors --Pass Paramters to a Named Cursor Cheers, Ramesh How do you implement one-to-one, one-to-many and many-to- many relati http://www.allinterview.com/showanswers/11456.html One to one Parent Entity does have one Corresponding record in Child Entity ex : Employee and his CV One to many Parent Entity does have many Corresponding records in Child Entity ex : Employee and his Projects many to many What is normalization? Explain different levels of normalization? http://www.allinterview.com/showanswers/11454.html The task of a database designer is to structure the data in a way that eliminates unnecessary duplication and provides a rapid search path to all necessary information. The process of refining tables, keys, columns, and relationships to create an What is bit datatype and what&#039;s the information that can be sto http://www.allinterview.com/showanswers/11459.html Float Binary Data Given an employee table, how would you find out the second highest s http://www.allinterview.com/showanswers/11453.html select * from emp where n-1 = (select count(*) from emp e where emp.salary<e.salary) in place of n-1 you can keep zero for first hight salary and 1 for second hightest salary.....etc What is an extended stored procedure? http://www.allinterview.com/showanswers/11447.html An extended stored procedure is simply a procedure that is implemented in a dynamic link library (DLL) — a library that is called by an application at runtime. Extended stored procedures can be used in much the same way as database stored pro What are defaults? Is there a column to which a default can&#039;t b http://www.allinterview.com/showanswers/11458.html Defaults are used to assign some defalut values to columns . These values are used if user doen to specify a column value. Timestamp canot have default clause attached to it What is the system function to get the current user&#039;s user id? http://www.allinterview.com/showanswers/11449.html select User_Id() What are the disadvantages of cursors? How can you avoid cursors? http://www.allinterview.com/showanswers/11443.html A) In cursors each time you fetch a new row it does a round trip with the database thereby increase network use and time. B) There is also restriction on select statements that can be used in cursors C) It also uses more resources and tempo Explain the general syntax for a SELECT statements covering all the http://www.allinterview.com/showanswers/11444.html select * from tablename(select all fields of the tables) select f1,f2 from tablename (select selected fields(like f1,f2) select f1,f2,2 [f3] from tablename(select selected fields plus one fields having default value is 2) what is Normalization? http://www.allinterview.com/showanswers/71749.html Normalization is a design technique to develop table structures. Purpose of normalization is to eliminate redundant data. how will I find the duplicate rows count from employees tablein orac http://www.allinterview.com/showanswers/74518.html select employee_id, count(*) from employees group by employee_id having count(*) > 1