Created
January 29, 2018 12:23
-
-
Save aleksandar-babic/5070954537689024e7f2e70481c9d274 to your computer and use it in GitHub Desktop.
Vivify Ideas - Vezba 4
This file contains 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 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