Fragen im Vorstellungsgespräch bei Sapphire Digital: 9. You have decided to delete... | Glassdoor.de

Frage im Vorstellungsgespräch

Data Analyst-Vorstellungsgespräch Lyndhurst, NJ (Vereinigte Staaten von Amerika)

9. You have decided to delete doctors that contained the

  name ‘John’ in their name. You have a function in the lib schema called item_remove where the first item in the function is the table and the second item is the provider_id. Write a shell script that will connect to the database and loop through the provider_id into the function.
Antwort

Antwort im Vorstellungsgespräch

1 Antwort

0

CREATE TEMP TABLE csvfile(provider_id);
COPY csvfile(provider_id)
FROM 'C:\file.csv'
DELIMITER ','
CSV HEADER
;

SELECT Provider.provider_id,Provider.provider_name
FROM Provider
LEFT JOIN csvfile
    ON Provider.provider_id = csvfile.provider_id
    AND csvfile.provider_id IS NULL
;
##assuming we're looking for one's that don't exist in the .csv

Bewerber im Vorstellungsgespräch am 13.11.2020

Antwort oder Kommentar posten

Um dies zu kommentieren, bitte anmelden oder Konto anlegen.