Apunts de l'assignatura DABD a la UPC. LAB + TEO.
SQLite3 | MySQL | PostgreSQL | |
---|---|---|---|
Iniciar sessió: | sqlite3 filename.db | mysql -u est_username -p | psql -h ubiwan.epsevg.upc.edu -U est_username -W |
Ajuda: | .help | \h | \h (Sintaxis SQL) i ? (Comandes CLI) |
Sortir: | .quit / .exit | \q | \q |
Llistar db: | - | show databases; | \l |
Canviar de bd: | - | \u | \c |
Llistar taules/vistes: | .tables | show tables; | \d |
Veure esquema taula/vista: | .schema tablename | desc table/view; | \d table/view |
Importar SQL: | - | mysql -u username -p databasename < data.sql | psql -U username databasename < data.sql |
Exportar SQL: | - | mysqldump -u username -p databasename [tablename] > data.sql (Si vols poder importar-la en altres SGBD pot ser convenient usar l’opcio --compatible=ansi) | pg dump -U username databasename [-t tablename] > data.sql (Format mes compatible afegint opcions: --no-tablespaces --no-owner --no-acl --column-inserts) |
S1 | S2 | S3 | S4 | S5 | S6 | S7 | S8 | S9 | S10 | S11 | S12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Link |
Sessions | S1 | S2 | S3 | S4 | S5 | S6 |
---|---|---|---|---|---|---|
Nota (entre 0 i 5) | 5 | 3 | 5 | 4.5 | 4 | 5 |
Errors | Bé | MySQL taula movies no existeix. | Bé | Host havia de ser ubiwan.epsevg.upc.edu. | No es poden editar/eliminar usuaris que tenen caràcter ". | Bé |
Total LABS 1ª Part |
---|
8.6 |
Sessions | S7 | S8 | S9 | S10 | S11 | S12 |
---|---|---|---|---|---|---|
Nota (entre 0 i 5) | - | - | - | - | - | - |
Errors | - | - | - | - | - | - |
aprovats.db | registre_parelles.db | linies_factura.db | |
---|---|---|---|
Link |
- dabd-apunts-artuaragon/
- ├── Exemples Activitat 1/
- ├── Activitat1-apunts-aprovats.md
- ├── Activitat1-apunts-linies_factura.md
- ├── Activitat1-apunts-registre_parelles.md
- ├── aprovats1.txt
- ├── aprovats2.txt
- ├── aprovats3.txt
- ├── aprovats.db
- ├── linies_factura.db
- ├── linies_factura_v1.txt
- ├── linies_factura_v2.txt
- ├── registre_parelles.db
- ├── registre_parelles_v1.txt
- └── registre_parelles_v2.txt
- ├── LABS/
- ├── Sessio 1/
- ├── Sessio 10/
- ├── Sessio 12/
- ├── Sessio 2/
- ├── Sessio 3/
- ├── Sessio 4/
- ├── Sessio 5/
- ├── 05mysql_php/
- ├── add_users.html
- ├── add_users.php
- ├── crud-php-mysql-artuaragon/
- ├── add_edit.php
- ├── b_drop.png
- ├── b_edit.png
- ├── config.php
- ├── delete.php
- └── index.php
- ├── crud-php-mysql-simple-inicial/
- ├── add_edit.php
- ├── b_drop.png
- ├── b_edit.png
- ├── config.php
- └── index.php
- ├── list_users.html
- ├── list_users.php
- ├── users.html
- └── users.php
- └── s5-apunts.md
- ├── Sessio 6/
- └── s6-apunts.md
- ├── Sessio 7/
- ├── Sessio 8/
- └── Sessio 9/
- ├── Practiques (Sessions 1, 2, 3 i 4).pdf
- ├── README.md
- └── TEO/
- ├── Exemples Activitat 1/