Pentru inceput sa va invat cum accesam "consola" sql-ului.
Pentru a accesa consola tot ce trebuie sa faceti este sa intrati in ce tabel doriti si sa apasati tastele CTRL+Q.
Ba mai mult nu aveti nevoie sa intrati in vreun tabel pentru a folosi aceasta comanda, eu v-am dat exemplul cu tabel pentru ca ma gandesc ca in acel tabel doriti sa modificati.
Acum ca stim ce este o consola, sa vedem cum o putem folosi.
Pentru moment am sa va arat o comanda simpla si am sa incerc sa va explic cat de mult posibil ceea ce face ea.
Aceasta comanda va SELECTA toate row-urile DIN item_proto unde Vnumul itemului este mai mare de 10 dar este mai mic de 20.
[*] - Toate
[SELECT] - Selecteaza
[FROM] - Din
[WHERE] - UNDE
[AND] - Si
Rezultatul arata cam asa:
Practic ne-a selectat toate randurile unde vnumul itemului nu era mai mic de 10 sau mai mare de 20.
O alta comanda ar fi:
Aceasta comanda face exact ce este mai sus doar ca in loc sa selecteze tot randul selecteaza doar vnumul obiectelor.
Rezultatul arata cam asa:
Alte doua comenzi care va vor ajuta destul de mult sunt acestea:
Prima comanda va selecteaza si va sorteaza obiectele Ascendent adica:
A doua comanda va selecteaza si va sorteaza obiectele Descendent adica:
O ultima comanda inainte de a va spune cu ce va ajuta aceste comenzi si cum le putem folosii practic si usor.
Aceasta comanda este alcatuita din doua randuri si arata cam asa:
Ce face? Pai acum folosim doua noi variabile si aceastea sunt numite UPDATE, SET.
Ele sunt folosite pentru a schimba ceva in tabel direct din comanda, in cazul nostru va schimba randul de exp actual cu 1 la vnumurile mobilor 2493, 2492.
In final a doua comanda dupa cum am invatat mai sus ne selecteaza ce am modificat si ne arata pentru a putea vedea fara sa mai cautam in tabel, arata cam asa:
Acestea sunt cateva comenzi pe care eu le recomand sa le aveti si poate sa le folositi.
Comenzile au fost create pentru a va usura munca, poate unii dintre voi aveti nevoie sa stergeti obiecte din tabelul item dar din pacate sunt prea multe iteme si serverul sta prea mult in mentenanta, folosind o comanda este mult mai usor, practic si aveti gandul ca 100% nu ati uitat nimic in proces sau alte lucruri.
Tin sa mentionez ca acest tutorial l-am creat pentru cei la inceput, aceste comenzi va ajuta si va fac viata mai usoara, evident sunt multe alte comenzi dar sustin ca odata ce ai invatat "Basic-ul" restul devine doar poveste .
Reset parola mysql
In ultimul timp am vazut multi detinatori de servere care nu stiu sa reseteze parola mysql din...