Skip to content

Instantly share code, notes, and snippets.

@Piyush3dB
Last active February 27, 2019 07:43
Show Gist options
  • Save Piyush3dB/726bf7012785d6e0fd691c3655c92654 to your computer and use it in GitHub Desktop.
Save Piyush3dB/726bf7012785d6e0fd691c3655c92654 to your computer and use it in GitHub Desktop.
Sqlite sakila database
sqlite3
.read schema.sql
.read insert.sql
.tables
.schema
.save sakila.db
.quit
SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;
.mode line
.mode column
.headers on
PRAGMA table_info(table_name);
#
# Creating Tables
#
CREATE TABLE account(
user_id serial PRIMARY KEY,
username VARCHAR(50) UNIQUE NOT NULL,
password VARCHAR(50) NOT NULL,
email VARCHAR(355) UNIQUE NOT NULL,
created_on TIMESTAMP NOT NULL,
last_login TIMESTAMP
);
CREATE TABLE role(
role_id serial PRIMARY KEY,
role_name VARCHAR(255) UNIQUE NOT NULL
);
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment