This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#instalar NVM | |
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh -o install_nvm.sh | |
bash install_nvm.sh | |
#Listar las versiones de node que se pueden instalar | |
nvm ls-remote |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table accounts( | |
id integer, | |
name varchar, | |
amount integer | |
); | |
insert into accounts (id, name, amount) values | |
(1, 'Beth', 100), | |
(2,'Troy', 200), | |
(3,'Pinal',300); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Conversion de datos | |
--No hay conversion | |
select * from rental | |
where inventory_id = 2346; | |
--conversion explicita vs implicita : es mejor la explicita | |
-- portabilidad | |
--legilibidad |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Consultas basicas postgresql | |
-- where release_year is 2006 and rental_duration is 6 days | |
select * from film | |
where release_year = 2006 | |
and rental_duration = 6; | |
-- where release_year is 2006 or rental_duration is 6 days |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Crear database local | |
createdb 'dbname' -U 'dbuser' | |
#Crear database remota | |
createdb 'dbname' -h 'hostnameServer' -p 'serverPort'-U 'dbuser' | |
#Restaurar database |