Skip to content

Instantly share code, notes, and snippets.

View amartinezg's full-sized avatar

Andres Martinez Gutierrez amartinezg

View GitHub Profile
@amartinezg
amartinezg / tablas.sql
Last active October 17, 2019 12:17
Creación de tablas
CREATE TABLE ESTADOS_PRESTADORES (
ID
NOMBRE
CONSTRAINT
);
CREATE TABLE MODALIDADES (
ID
NOMBRE
);
@amartinezg
amartinezg / docker-cleanup-resources.md
Created January 27, 2019 23:58 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@amartinezg
amartinezg / gist:46e85c5d5497e41e8ac3ee6762888d93
Created October 7, 2018 04:25
Ejercicio práctico parcial
Instrucciones
1. Cree un tablespace con un espacio pequeño (50M está bien) y un usuario con permisos de conexión, dba y con espacio ilimitado en ese tablespace
2. Conéctese con ese usuario
3. Al final exporte como se indica en la imagen https://media.giphy.com/media/3ohs7N8c20knoGif84/giphy.gif
- Paso 1: http://oi64.tinypic.com/161z5vk.jpg
- Paso 2: http://oi64.tinypic.com/28rd5bm.jpg
La alcaldía de Medellín ha decidido lanzar un programa para tapar los huecos de las calles mediante su programa
"HuecosMed" y por esa razón tiene una base de datos donde relaciona los huecos con su ubicación, el estado y un
@amartinezg
amartinezg / data.sql
Last active February 19, 2019 12:26
Practical assignment
insert into employees (id, manager_id, date_of_joining, name, last_name, salary) values (1, null, TO_DATE('31/08/1992', 'dd/mm/yyyy'), 'Pip', 'Vaines', 91508);
insert into employees (id, manager_id, date_of_joining, name, last_name, salary) values (2, 1 , TO_DATE('15/05/1994', 'dd/mm/yyyy'), 'Marco', 'Prosch', 161821);
insert into employees (id, manager_id, date_of_joining, name, last_name, salary) values (3, 1 , TO_DATE('18/06/2018', 'dd/mm/yyyy'), 'Gleda', 'Shears', 199997);
insert into employees (id, manager_id, date_of_joining, name, last_name, salary) values (4, 3 , TO_DATE('12/04/1999', 'dd/mm/yyyy'), 'Hephzibah', 'Alvarado', 104144);
insert into employees (id, manager_id, date_of_joining, name, last_name, salary) values (5, 2 , TO_DATE('18/09/2007', 'dd/mm/yyyy'), 'Jaye', 'Harber', 163140);
insert into employees (id, manager_id, date_of_joining, name, last_name, salary) values (6, 1 , TO_DATE('14/09/2000', 'dd/mm/yyyy'), 'Townie', 'Quinion', 184692);
insert into employees (id, manager_id, date_of_joini
@amartinezg
amartinezg / practice.txt
Created August 16, 2018 01:09
Github practice
Prerequisites:
- Make sure that both have users in github or gitlab (Same repo for both students)
- Make sure you have Git installed in your machine
STUDENT 1
1. Create a new public repository in Github: https://github.com/new
2. Create a new folder in your computer
create table productos (
id INT,
nombre VARCHAR(50),
departamento VARCHAR(9),
precio DECIMAL(4,2)
);
insert into productos (id, nombre, departamento, precio) values (1, 'Bulgar', 'farmacia', 5.5);
insert into productos (id, nombre, departamento, precio) values (2, 'Beef - Salted', 'granos', 11.16);
insert into productos (id, nombre, departamento, precio) values (3, 'Bread Ww Cluster', 'vehiculos', 38.51);
insert into productos (id, nombre, departamento, precio) values (4, '7up Diet, 355 Ml', 'granos', 14.0);
@amartinezg
amartinezg / gist:822b4b603e23401e0d4b0d93eee05dd9
Created February 15, 2018 02:14
Github practice Step by step
2 - 3 people
1. Choose main person / project
2. Clone the project of the main person
3. The main person should add the others as collaborators:
- https://stackoverflow.com/questions/7920320/adding-a-collaborator-to-my-free-github-account
4. Person 1:
- Create a new file
- Add content
- Create a commit
@amartinezg
amartinezg / sequences.txt
Last active February 26, 2018 02:47
Practice assignment
CREATE TABLES
CUSTOMERS (id, first_name, last_name, email, address, phone, rut)
LOCATIONS (id, city, manager_first_name, manager_last_name)
ACCOUNTS (id, type, aperture_date, balance, customer_id, location_id)
* Use primary keys and not null constraints
* For accounts, type column should only accept values: savings, credit_card and loan
* Balance column in account's table is DECIMAL(15,2)
* Use sequences, customers starting in 1, locations starting in 5000, accounts 20000
SELECT * FROM DBA_ROLES;
CREATE TABLESPACE ITMBD datafile size 1G
AUTOEXTEND ON NEXT 200K MAXSIZE 2000M
EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO
ONLINE;
SELECT TABLESPACE_NAME,FILE_NAME,ONLINE_STATUS --Para verificar
FROM DBA_DATA_FILES;
@amartinezg
amartinezg / gist:c870777ae3c8cfdf20cce4b0cb04a26b
Created October 11, 2016 02:38
Clase 2 procedimientos, PL/SQL, funciones, cursores implícitos y explícitos.
/*
Take an integer n (n >= 0) and a digit d (0 <= d <= 9) as an integer.
Square all numbers k (0 <= k <= n) between 0 and n.
Count the numbers of digits d used in the writing of all the k**2
n = 10, d = 1, the k*k are 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100
We are using the digit 1 in 1, 16, 81, 100. The total count is then 4.
n = 25, d=1 there are 11 digits `1` for the squares of numbers between 0 and 25.
*/
DECLARE