Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE IF NOT EXISTS users (
- username TEXT PRIMARY KEY NOT NULL,
- password TEXT NOT NULL
- );
- CREATE TABLE IF NOT EXISTS elections (
- candidate TEXT NOT NULL,
- election_date DATE NOT NULL DEFAULT CURRENT_DATE,
- FOREIGN KEY (candidate) REFERENCES users(username)
- );
- CREATE TABLE IF NOT EXISTS user_votes (
- voted_user TEXT NOT NULL UNIQUE REFERENCES elections(candidate),
- user_who_voted TEXT NOT NULL REFERENCES users(username),
- date_voted DATE NOT NULL DEFAULT CURRENT_DATE
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement