studentDetails

Aveena · updated November 27, 2021 · SQL
-- create a table
CREATE TABLE students (
  id INTEGER PRIMARY KEY,
  f_name TEXT NOT NULL,
  l_name TEXT NOT NULL,
  gender TEXT NOT NULL,
  age INTEGER,
  dob date
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'George', 'M', 16, "12/01/05");
INSERT INTO students VALUES (2, 'Joanna', 'Pattrick', 'F', 17, "23/09/04");
INSERT INTO students VALUES (3, 'Issa', 'SaintJohns', 'F', 16, "04/04/05");
INSERT INTO students VALUES (4, 'Henry', 'James', 'M', 16, "03/07/05");
INSERT INTO students VALUES (5, 'Mary', 'Dugs', 'F', 17, "25/06/04");
INSERT INTO students VALUES (6, 'Jannice', 'Larrison', 'F', 16, "17/05/05");
INSERT INTO students VALUES (7, 'Elena', 'Gilbert', 'F', 17, "18/06/05");
INSERT INTO students VALUES (8, 'Jeremy', 'Gilbert', 'M', 17, "18/06/05");
INSERT INTO students VALUES (9, 'Mason', 'Lockwood', 'M', 17, "30/30/04");
INSERT INTO students VALUES (10, 'Charles', 'Peralta', 'M', 16, "10/11/04");
-- fetch some value
SELECT 18000+20000+22000;
SELECT 20000-3000;
SELECT 3000*2000;
SELECT 20000/2000;
SELECT 5000%2000;


-- INSERT INTO students VALUES (11, 'Ambika', 'Dange', 'F', 25, "25/05/21");
-- SELECT *FROM students;
-- DELETE FROM students WHERE id=11;
-- SELECT * FROM students;

Comments

Please sign up or log in to contribute to the discussion.