NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

=============================================DDL================================================
1.mysql -u root -p - logowanie root zsswitnica
2.show databases; - pokazuje bazy
3.create database <nazwa> ; - tworzy baze
4.create table uczniowie (id int auto_increment primary key, imie varchar(20), nazwisko varchar(30), wiek int) (PRZYKŁAD TWORZENIA TABELI)
5.use <nazwa>; - używa baze danych
6.show tables; - pokazuje tabele w bazie
7.desc <nazwa tablicy> - struktura tablicy
8. quit - wylogowanie
9. Source c:BAZAkomis.sql - importuje ( source + scieżka do pliku)
==*PARAMETRY*==
*parametry są do modyfikacji/tworzenia*
<nazwa>
<typ zpisu(int , varchar)>
<ilość znaków w nawiasie>
=====*===*=====
*alter table <nazwa> - modyfikuje
-drop table/database/column <nazwa> -usuniecie tabeli/bazy danych/kolumny
-add table/database/column <nazwa> -dodaje tabeli/baze danych/kolumne
-change table/database/column <nazwa>=<nowa nazwa> -zmienia tabeli/baze danych/kolumne
=============================================DML================================================

1.*WIERSZE*
-insert into <nazwa tabeli> values(liczba porządkowa, "dane tekstowe w cudzysłowiu", "dalsze dane ile tylko można"); -dodaj rekord do bazy
-delete from <nazwa tabeli> where idklienta= np.5 -usuniecie rekordu z bazy
-truncate klienci - usuwa wszystkie rekordy
-update <nazwa tabeli> set <wybierasz pole> where <podajesz id>; - modyfikuje rekord

=======================================DQL======================================================
=============================Zapytania do bazy danych===========================================
1. Select * from <nazwa> - projekcja danych.( moze byc select marka,model from auta)
- select *from auta order by np.rocznik (desc-malejąco)(asc - rosnące); -sortowanie
- select *from auta where rocznik>2010; -selekcja danych (kaluzula where tzw. zawężenie)
- select *from uczen where id between 1 and 10; (pomiędzy)
- select *from uczen where id in (1,5,10); LUB select *from uczen where id="1" or id="5" or id="10";
|----------------------------|
|!= - różny |
|<=> - mniejszy,większy,równy|
|< - mniejszy |
|> - większy |
|= - równy |
|----------------------------|
=WHERE Z OPERATORAMI LOGICZNYMI=
- select *from auta where kolor="yellow" and rocznik>2009; -where z operatorami logicznymi
- select *from auta where where rocznik between 2007 and 2010; - przedział domkniety
=PREDYKAT LIKE=
select *from klienci where adres like "Rolna%" ;
=============================Łączenia tabel===========================================
select klienci.imie klienci.nazwisko wyp.id_klienta from klienci INNER JOIN wyp ON klienci.idklienta=wyp.idklienta

select klienci.imie klienci.nazwisko auta.marka from klienci INNER JOIN wyp ON klienci.idklienta=wyp.idklienta AND wyp.id_wyp=auta.id_auta

1)SELECT pracownicy.NAZWISKO , pracownicy.ETAT , pracownicy.ID_ZESP , zespoly.NAZWA FROM pracownicy INNER JOIN zespoly ON zespoly.ID_ZESP=pracownicy.ID_ZESP ORDER BY nazwisko ASC;

2)SELECT pracownicy.NAZWISKO , zespoly.ADRES , zespoly.ID_ZESP , pracownicy.ETAT FROM pracownicy INNER JOIN zespoly ON zespoly.ID_ZESP=pracownicy.ID_ZESP WHERE zespoly.ADRES= "PIOTROWO 3A" ORDER BY pracownicy.NAZWISKO;
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.