Skip to content

Instantly share code, notes, and snippets.

@aleksandar-babic
Created January 29, 2018 12:23
Show Gist options
  • Save aleksandar-babic/5070954537689024e7f2e70481c9d274 to your computer and use it in GitHub Desktop.
Save aleksandar-babic/5070954537689024e7f2e70481c9d274 to your computer and use it in GitHub Desktop.
Vivify Ideas - Vezba 4
-- Create table users with all needed fields
CREATE TABLE IF NOT EXISTS users (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(50) UNIQUE,
password VARCHAR(50),
firstname VARCHAR(30),
lastname VARCHAR(30),
company VARCHAR(30),
country VARCHAR(30)
);
-- Insert new user
INSERT INTO users (email, password, firstname, lastname, company, country)
VALUES ('user@user.com', '123456', 'Name', 'Lastname', 'Vivify', 'Serbia');
-- Update user
UPDATE users
SET firstname='Aleksandar', lastname='Babic'
WHERE email='user@user.com';
-- Delete user
DELETE FROM users
WHERE email='user@user.com';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment