04-default.sql 436 B

123456789101112131415161718
  1. CREATE TABLE students (
  2. id INT,
  3. name VARCHAR(25),
  4. major VARCHAR(25) DEFAULT 'Undecided',
  5. PRIMARY KEY(id)
  6. );
  7. .mode table
  8. .nullvalue NULL
  9. INSERT INTO students(id, name) VALUES(1, 'Jack');
  10. INSERT INTO students VALUES(2, 'Kate', 'Sociology');
  11. INSERT INTO students VALUES(3, NULL, 'Chemistry');
  12. INSERT INTO students VALUES(4, 'Jack', 'Biology');
  13. INSERT INTO students VALUES(5, 'Mike', 'Computer Science');
  14. SELECT * FROM students;