Advertisement
barbos01

Untitled

Apr 1st, 2022
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. #1
  2.  
  3. select nume, nr_telefon
  4.  
  5. from `client`, `client_telefon`
  6.  
  7. where client.id=client_telefon.client_id;
  8.  
  9. #2
  10.  
  11. select nume
  12.  
  13. from `client`, `client_email`
  14.  
  15. where client.id=client_email.client_id;
  16.  
  17. #3
  18.  
  19. select nume, email
  20.  
  21. from `client`, `client_email`
  22.  
  23. where client.id=client_email.client_id;
  24.  
  25. #4
  26.  
  27. select count(email)
  28.  
  29. from `client_email`;
  30.  
  31. #5
  32.  
  33. select distinct nume
  34.  
  35. from `client`, `client_telefon`
  36.  
  37. where client.id=client_telefon.client_id;
  38.  
  39. #6
  40.  
  41. select client.nume, produs.nume, comanda.cantitate, factura_produse.cantitate,sku
  42.  
  43. from `client`, `produs`, `comanda`, `factura`, `factura_produse`
  44.  
  45. where client.id=comanda.id_client
  46.  
  47. and comanda.id_factura=factura.id
  48.  
  49. and client.id=factura.client_id
  50.  
  51. and factura_produse.factura_id= factura.id
  52.  
  53. and factura_produse.produs_id=produs.id;
  54.  
  55. #7
  56.  
  57. select client.nume, produs.nume, sku, cantitate * (pret_unitar + (pret_unitar * tva))
  58.  
  59. from `client`, `factura`, `factura_produse`, `produs`
  60.  
  61. where client.id=factura.client_id
  62.  
  63. and factura_produse.factura_id= factura.id
  64.  
  65. and factura_produse.produs_id=produs.id;
  66.  
  67. #8
  68.  
  69. select sum(cantitate * (pret_unitar + (pret_unitar * tva)))
  70.  
  71. from `client`, `factura`, `factura_produse`, `produs`
  72.  
  73. where client.id=factura.client_id
  74.  
  75. and factura_produse.factura_id= factura.id
  76.  
  77. and factura_produse.produs_id=produs.id
  78.  
  79. group by factura.id;
  80.  
  81. #9
  82.  
  83. select nume, stoc
  84.  
  85. from `furnizor`, `furnizor_stoc`
  86.  
  87. where furnizor.id = furnizor_stoc.furnizor_id;
  88.  
  89. #10
  90.  
  91. select nume, email
  92.  
  93. from `client`, `client_email`, `factura`
  94.  
  95. where client.id = client_email.client_id
  96.  
  97. and client.id = factura.client_id
  98.  
  99. and factura.nota = "redus";
  100.  
  101. #11
  102.  
  103. select nume, nr_telefon
  104.  
  105. from `client`, `client_telefon`, `factura`
  106.  
  107. where client.id = client_telefon.client_id
  108.  
  109. and client.id = factura.client_id
  110.  
  111. group by factura.client_id;
  112.  
  113. #12
  114.  
  115. select sku, atribut
  116.  
  117. from `produs`, `produs_atribute`
  118.  
  119. where produs.id = produs_atribute.produs_id
  120.  
  121. group by produs.sku;
  122.  
  123. #13
  124.  
  125. select nume, stoc
  126.  
  127. from `produs`, `produs_atribute`, `produs_stoc`
  128.  
  129. where produs.id = produs_atribute.produs_id
  130.  
  131. and produs.id = produs_stoc.produs_id
  132.  
  133. and produs_atribute.atribut is not null
  134.  
  135. and produs_atribute.valoare is not null
  136.  
  137. #14
  138.  
  139. select nume
  140.  
  141. from `client`, `factura`
  142.  
  143. where client.id = factura.client_id
  144.  
  145. and client.tip_client = "juridic"
  146.  
  147. group by factura.client_id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement