Created
November 24, 2021 19:21
-
-
Save rahulinux/3d40e89473e46fd8bfc9330f169d8cbe to your computer and use it in GitHub Desktop.
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 database assignment | |
SELECT 'CREATE DATABASE assignment' | |
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'assignment')\gexec | |
-- Switch DATABASE | |
\c assignment | |
-- | |
-- Name: categories; Type: TABLE; Owner: -; Tablespace: | |
-- | |
CREATE TABLE rides ( | |
ride_id character varying(32) not null, | |
driver_id integer not null, | |
passenger_id integer not null, | |
started_at timestamp not null, | |
PRIMARY KEY (ride_id) | |
); | |
COPY rides(ride_id, driver_id, passenger_id, started_at) | |
FROM '/tmp/corrected_data.csv' | |
DELIMITER ',' | |
CSV HEADER; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment