Jump to content
LegendKiller

Ajutor SQL

Recommended Posts

Salutare, am nevoie de ajutorul vostru cat mai repede posibil pentru un examen la baze de date.

Nu-mi sariti in cap ca nu am facut niciun curs, proful are vreo 80 de ani si nu a venit deloc la facultate ... si maine am examen cu alt prof care vrea si luna de pe cer. :)

1) Se d? schema:

factur?= (nr_factura, data_factura, cod_beneficiar, denum_beneficiar, cod_produs, denumire_produs, cantitate_prod_pe_fact, pret_produs)

2) S? se scrie în SQL cererile:

Produsele facturate de beneficiarul “S.R.L.”

Beneficiarii care nu au cump?rat “sapun”

To?i beneficiarii cu valorile facturilor totalizate.

Multumesc anticipat. :)

Link to comment
Share on other sites

select denumire_produs

from factura

where denumire_beneficiar like '%S.R.L.'

---------------------------------

select denum_beneficiar

from factura

where denum_produs != 'sapun'

---------------------------------

select denum_beneficiar, pret_produs*cantitate_prod_pe_fact as total

from factura

group by denum_beneficiar

ultima e ambigua. sigur asa e formulata ?

la not equal nu mai stiu daca e != sau <> operatorul

//recomand cu caldura http://sqlzoo.net/ aici inveti cel mai rapid SQL.

Edited by begood
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...