Skip to content

Instantly share code, notes, and snippets.

@vipassanaecon
Last active December 30, 2021 22:33
Show Gist options
  • Save vipassanaecon/9014182811d2a89130652ee9b57c075f to your computer and use it in GitHub Desktop.
Save vipassanaecon/9014182811d2a89130652ee9b57c075f to your computer and use it in GitHub Desktop.
SQL for medium article 1
CREATE TABLE IF NOT EXISTS red_wine
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
fixed_acidity REAL NOT NULL,
volatile_acidity REAL NOT NULL,
citric_acid REAL NOT NULL,
residual_sugar REAL NOT NULL,
chlorides REAL NOT NULL,
free_sulfur_dioxide INTEGER NOT NULL,
total_sulfur_dioxide INTEGER NOT NULL,
density REAL NOT NULL,
pH REAL NOT NULL,
sulphates REAL NOT NULL,
alcohol REAL NOT NULL,
quality INTEGER NOT NULL,
type TEXT NOT NULL
);
INSERT INTO red_wine
(
fixed_acidity,
volatile_acidity,
citric_acid,
residual_sugar,
chlorides,
free_sulfur_dioxide,
total_sulfur_dioxide,
density,
pH,
sulphates,
alcohol,
quality,
type
)
VALUES
(7.4, 0.7, 0, 1.9, 0.076, 11, 34, 0.9978, 3.51, 0.56, 9.4, 5, 'RED');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment