oracle - Two Table SQL review -


!(http://imgur.com/rglmvue)

a pic of tables above.

  1. list youngest customer.
  2. list orders (ordereid, order date, amount) along customer details.

i struggling these 2 questions.

can't see table name pic?

  1. list youngest customer. try replact [top table pic] name of actual table.

    select custfname, custlname, min(date)  (select  *, cast(dateofbirth date) date customers) group 1,2; 

or

select top 1 * customers order dateofbirth asc 

4.list orders (ordereid, order date, amount) along customer details.

select a.*, b.custlname, b.custfname, b.dateofbirth, b.custcity orders  left join customers b on b.custid = a.custid 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -