SQL questions - Medium difficulty -


i working through link , stuck on q7 , q8 on website: http://sqlzoo.net/a3m.htm

my attempt q7 is:

select tprod.dscr, sum(qnty), max(tpurcd.recv) tprod, tpurcd tprod.code = tpurcd.prod group tprod.dscr, tpurcd.recv 

q8 attempt:

select tpurcd.cust, tpurcd.recv, qnty tpurcd, tprod tprod.code = tpurcd.prod , tpurcd.qnty * tprod.pric 

table info listed here: http://sqlzoo.net/a3.htm

any appreciated!

using mysql

7

select tprod.dscr description, sum(tpurcd.qnty) quantity, max(tpurcd.recv) 'most recent order' tprod inner join tpurcd on tprod.code = tpurcd.prod group tprod.dscr 

8

select tpurcd.cust 'customer code', tpurcd.recv 'received date', sum(tpurcd.qnty * tprod.pric) 'total value' tprod inner join tpurcd on tprod.code = tpurcd.prod  group tpurcd.cust, tpurcd.recv having sum(tpurcd.qnty * tprod.pric) > 475 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -