Advertisement
darkman110697

mysql logowanie

Apr 4th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. mysql -u root -p
  2. sprawdzenie jakie sa bazy
  3. show database;
  4.  
  5. dodanie do aktywnych baz
  6. use nazwa;
  7.  
  8.  
  9. create table klient( imie varchar(35), nazwisko varchar(35), telefon decimak(10,0), email char(30), kID int not null Auto_Incerment, primary kay(kID));
  10. wyjscie z tabeli
  11. \c
  12.  
  13. dodanie wartosci do tabeli
  14. insert into [nazwa]
  15. values([dane], [dane]);
  16.  
  17.  
  18. konkretna wartos
  19. insert into [nazwa] set [kolumna='wartosc'];
  20.  
  21. wyswetlenie tabeli
  22. select *from [tabela];
  23.  
  24. show tables;
  25.  
  26. dodanie 1 kolumny
  27. alter table klient add wiek int;
  28.  
  29. dodanie kilka kolumny
  30. alter table klient add (wysokosc int,
  31. koczu verchar(35) );
  32.  
  33. dodanie kolumny w oktreslonej pozycji
  34. alter table klient add waga int alter wysokosc;
  35.  
  36. modyfikacja istniejacej kolumny kolumn
  37. alter table klient modify koczu int;
  38.  
  39. zmiana nazw kolumn
  40. alter table klient change wysokosc wzrost int;
  41.  
  42. usuniecie kolumny
  43. alter table klient drop column wiek,
  44. drop column wzrost, drop column waga,
  45. drop column koczu;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement