-- Consultas

SELECT * FROM noqopenbank.`user` u where name LIKE '%Comercial%';

SELECT * FROM noqopenbank.appointment a
WHERE DATE(appointment_date) = DATE('2022-04-01') AND appointment_in_time = '12:00:00' AND user_id IN (55, 56, 57, 58, 69, 83)
order by  a.appointment_date, a.appointment_in_time, user_id;


SELECT a.id, a.appointment_date, a.appointment_in_time, a.appointment_out_time, a.queue_id, a.service_id, a.user_id, a.ticket_id, agd.valor, agd.generic_id
FROM noqopenbank.appointment a
LEFT JOIN noqopenbank.appointment_generic_data agd ON a.id = agd.appointment_id 
where user_id = 83 AND DATE(appointment_date) = DATE('2022-04-01') AND appointment_in_time = '10:30:00' 
order by a.appointment_date, a.appointment_in_time;

-- Modificaciones
UPDATE `noqopenbank`.`appointment` SET `user_id` = '69' WHERE (`id` = '80880');
UPDATE `noqopenbank`.`appointment` SET `user_id` = '57' WHERE (`id` = '80881');