Skip to content

Instantly share code, notes, and snippets.

@isaacbatst
Created July 4, 2023 23:01
Show Gist options
  • Save isaacbatst/e4894ba13c4b869f1498b737ee2c4d68 to your computer and use it in GitHub Desktop.
Save isaacbatst/e4894ba13c4b869f1498b737ee2c4d68 to your computer and use it in GitHub Desktop.
-- Cadastrar uma nova loja
-- Necessário criar um endereço
-- Endereço: Rua dos Alfeneiros, Little Whinging
-- INSERT INTO sakila.address (district, address, city_id, phone, location)
-- VALUES (
-- 'Little Whinging',
-- 'Rua dos Alfeneiros',
-- 26,
-- '12345678901234567890',
-- POINT(-48.9494566, -16.3333469)
-- );
-- Necessário criar um staff responsável
-- INSERT INTO sakila.staff
-- (address_id, first_name, last_name, store_id, username)
-- VALUES (606, 'Isaac', 'Batista', 1, 'isaacbatst')
-- O staff precisa estar vinculado a uma loja
-- vinculamos à loja 1 provisoriamente
-- Criamos a loja de fato
-- INSERT INTO sakila.store
-- (address_id, manager_staff_id)
-- VALUES (606, 6)
-- Corrigir id da loja no staff isaac
-- UPDATE sakila.staff
-- SET store_id = 1
-- WHERE staff_id = 6
-- Demitir Isaac
-- UPDATE sakila.staff
-- SET active = 0
-- WHERE staff_id = 6
DELETE FROM sakila.staff
WHERE staff_id = 6;
-- DELETE FROM sakila.store
-- WHERE store_id = 4;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment