Pages

Sunday, 27 January 2013

DBMS Interview Questions

  1. http://tuandao.info/html/career/SQL.pdf
  2. http://www.techinterviews.com/sql-interview-questions-and-answers
  3. create table branch
           
    (branch_name  char(15),
            
    branch_city  char(30) not null,
            
    assets  integer,
            
    primary key (branch_name))
  4. insert into account
     
    values ('A-9732', 'Perryridge
    ', 1200)
  5. delete from account
  6. select distinct branchname from loan
  7. select all branchname from loan
  8. Rename operation :
    select customer_name, borrower.loan_number as loan_id, amount
    from borrower, loan
    where borrower.loan_number = loan.loan_number
  9. select distinct customer_name
     
    from    borrower, loan
     
    where borrower loan_number = loan.loan_number and
                  branch_name = 'Perryridge'
     
    order by customer_name
  10. Aggregate functions 
  11. select branch_name, count (distinct customer_name)
              
    from depositor, account
              
    where depositor.account_number = account.account_number
              
    group by branch_name
  12. Attributes in select clause outside aggregate functions must appear in group by clause
  13. Having clause
  14. select branch_name, avg (balance)
              
    from account
              
    group by branch_name
              
    having avg (balance) > 1200
  15. Predicates in the having clause are applied before forming groups and predicates in the where clause are applied before forming groups
  16. sd
  17. sd
  18. as

  • select avg (balance)
     
    from account  where branch_name = 'Perryridge'
  • select count (distinct customer_name)
     
    from depositor






  1. sd

No comments:

Post a Comment