Interview Question

Interview San Francisco, CA

One guy asked a really hard SQL question. I feel that if

  you have that question and get it right, you will probably get a position. He first asked a sorta easy sql question. The question is that you have a list of portfolios. You also have a list of portGroups (basically a group of protfolios). If firsts asks you to create a table to hold some data for both these values. Make sure you don't create two separate tables with keys! He wants to see that you can create one table and use both the portfolio number AND the portGroup number as the primary key. Next (the hard part), he asked you to pretend that a portGroup is a 'parent' of a portfolio (the child). He asked for me to write some sql joins that would return the parent of the grandparents of a specific portfolio. I honestly still don't understand it. It makes a lot more sense if you right out an example with numbers. You could also try and search online for something similar to this. I guess the key takeaway is to know how to do an innerjoin (and other types of joins)
Answer

Add Answers or Comments

To comment on this, Sign In or Sign Up.