ola12

an anonymous user · July 22, 2021 · SQL
-- create a table
CREATE TABLE customers (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  city TEXT ,
--   grade INTEGER,
  commision INTEGER NOT NULL
);

-- insert some values
INSERT INTO customers VALUES (5001, 'James Hoog', 'New York', 0.15);
INSERT INTO customers VALUES (5002, 'Nail Knite', 'Knite', 0.13);
INSERT INTO customers VALUES (5005, 'Pit Alex', 'Alex', 0.14);
INSERT INTO customers VALUES (5006, 'Mc Lyon', 'Lyon', 0.11);
INSERT INTO customers VALUES (5003, 'Lauson Hen', null, 0.12);
INSERT INTO customers VALUES (5007, 'Paul Adam', 'Rome', 0.15);
-- fetch some values

SELECT AVG (commision) 
FROM customers
WHERE name NOT LIKE 'A%' AND name NOT LIKE 'L%';

Comments

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