SQL development
If you're new to SQL, you can learn more from this course: SQL.
Creating tables
- CREATE TABLE customers (id INTEGER PRIMARY KEY, name TEXT, age INTEGER, weight REAL);
- CREATE TABLE customers (id INTEGER PRIMARY KEY, age INTEGER);
Inserting data
- INSERT INTO customers VALUES (73, "Brian", 33);
- INSERT INTO customers (name, age) VALUES ("Brian", 33);
Querying data
- SELECT * FROM customers;
- SELECT * FROM customers WHERE age > 21;
- SELECT * FROM customers WHERE age < 21 AND state = "NY";
- SELECT * FROM customers WHERE plan IN ("free", "basic");
- SELECT name, age FROM customers;
- SELECT * FROM customers WHERE age > 21 ORDER BY age DESC;
- SELECT name, CASE WHEN age > 18 THEN "adult" ELSE "minor" END "type" FROM customers;
Aggregating data
- SELECT MAX(age) FROM customers;
- SELECT gender, COUNT(*) FROM students GROUP BY gender;
Updating and deleting data
- UPDATE customers SET age = 33 WHERE id = 73;
- DELETE FROM customers WHERE id = 73;
Our implementation of SQL is based on a popular dialect of SQL known as SQLite.
To run SQL in the browser, we make use of these technologies:
To run SQL in the browser, we make use of these technologies:
No comments:
Post a Comment