Section 1

Preview this deck

How do I name the table?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

7 years ago

Date created

Mar 1, 2020

Cards (18)

Section 1

(18 cards)

How do I name the table?

Front

Put the name after the create table function Ex. CREATE TABLE groceries ( );

Back

How do I order results?

Front

SELECT * FROM customers WHERE age > 21 ORDER BY age DESC;

Back

How do you create a table with many data types?

Front

Use the CREATE function CREATE TABLE customers (id INTEGER PRIMARY KEY, name TEXT, age INTEGER, weight REAL);

Back

How do I delete data?

Front

DELETE FROM customers WHERE id = 73;

Back

How do I insert data into named columns?

Front

INSERT INTO customers (name, age) VALUES ("Brian", 33);

Back

How do I filter using an aggregate functions?

Front

SELECT MAX(age) FROM customers;

Back

How do I select everything?

Front

SELECT * FROM customers;

Back

How do I filter with multiple conditions?

Front

Using the AND command SELECT * FROM customers WHERE age < 21 AND state = "NY";

Back

How do I inner join tables?

Front

SELECT customers.name, orders.item FROM customers JOIN orders ON customers.id = orders.customer_id;

Back

How do I filter using groups?

Front

SELECT gender, COUNT(*) FROM students GROUP BY gender;

Back

How do applications store data?

Front

They use a database which is a program that helps store data and provides functionality for adding, modifying and querying that data

Back

How do I update data?

Front

UPDATE customers SET age = 33 WHERE id = 73;

Back

How do I filter with conditions?

Front

Using the WHERE clause SELECT * FROM customers WHERE age > 21;

Back

How do I select a specific column?

Front

SELECT name, age FROM customers;

Back

How do I outer join?

Front

SELECT customers.name, orders.item FROM customers LEFT OUTER JOIN orders ON customers.id = orders.customer_id;

Back

How do you transform a query with CASE?

Front

SELECT name, CASE WHEN age > 18 THEN "adult" ELSE "minor" END "type" FROM customers;

Back

How do I create a table using primary keys?

Front

CREATE TABLE customers (id INTEGER PRIMARY KEY, age INTEGER);

Back

How do I insert data?

Front

Use the INSERT INTO function followed by the table name and then the function VALUES INSERT INTO customers VALUES (73, "Brian", 33);

Back