vencinachev

UKTC-SQL

Nov 30th, 2020
708
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE DATABASE uktc;
  2.  
  3. USE uktc;
  4.  
  5. CREATE TABLE students(
  6. id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
  7. firstname VARCHAR(100) NOT NULL,
  8. lastname VARCHAR(100),
  9. age INT,
  10. class INT,
  11. city VARCHAR(100),
  12. email VARCHAR(200)
  13. );
  14.  
  15. INSERT INTO students
  16. VALUES (1, 'Slavi', 'Trifinov', 32, 171, 'Kaspichan', 'slavkata@uktc.com');
  17.  
  18. INSERT INTO students (id, firstname, lastname, age, class, city, email)
  19. VALUES (2, 'Kiro', 'Breika', 45, 171, 'V.T.', 'kiro@uktc.com');
  20.  
  21. INSERT INTO students (firstname, lastname, age)
  22. VALUES ('Ani', 'Borisova', 45);
  23.  
  24. DELETE FROM students WHERE id = 4;
  25.  
  26. UPDATE students SET city = 'Novi Pazar' WHERE firstname = 'Slavi';
  27.  
  28. SELECT * FROM students;
  29.  
RAW Paste Data