1. A relational database is a database that uses rows and columns to access data. 2. SQL is a language designed to send commands to a database to retrieve and edit data. 3. An ER model describes an abstract data type in terms of entities and their relationship to one another as opposed to entities such as students existing in a vaccuum. An entity like a student exists in relationships with other entities like a student id number or a grade. 4. A one to one relationship means that an entity exists in a relationship with one other entity like a person's name to a person's social security number. A one to many relationship is when one entity is a parent entity to children entities. The children entities depend on the existence of the parent entity. A many to many relationship is when both entities depend on each other - A teacher can have many students and a student can have many teachers. 5. A primary key is important because it allows rows to remain unique and it allows tables to be linked to other tables. 6. CREATE TABLE IF NOT EXISTS Customers ( id INTEGER NOT NULL AUTO_INCREMENT, firstName CHAR(255) NOT NULL, lastName CHAR(255) NOT NULL, address CHAR(255) NOT NULL, city CHAR(255) NOT NULL, state CHAR(2) NOT NULL, zip INTEGER UNSIGNED NOT NULL, PRIMARY KEY (id) ); 7. ALTER TABLE Customers ADD age INTEGER UNSIGNED NOT NULL; 8. INSERT INTO Customers VALUES (1, 'Bob', 'Smith', '5012 Street', 'Town', 'CA', 93306), (2, 'Tom', 'Jones', '888 Lane', 'Town', 'CA', 93305), (3, 'Jane', 'Doe', '555 Wallabe Lane', 'City', 'CA', 93301); 9. SELECT * FROM Customers; 10. CREATE TABLE IF NOT EXISTS Products ( id INTEGER NOT NULL AUTO_INCREMENT, title CHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, price DECIMAL(99999, 2) UNSIGNED NOT NULL PRIMARY KEY (id) ); 11. INSERT INTO Products VALUES (1, 'Violin', 'An instrument', 200.00), (2, 'GTX 1080ti', 'A graphics card', 999.99), (3, 'hand sanitizer', 'Something to wash your hands', 200.99); 12. SELECT * FROM Products; 13. UPDATE Products SET price=49.99 WHERE id=3; 14. SELECT * FROM Products WHERE id=3; 15. DELETE FROM Products WHERE id=3; 16. CREATE TABLE IF NOT EXISTS Orders ( id INTEGER NOT NULL AUTO_INCREMENT, cid INTEGER NOT NULL, amount DECIMAL(10000, 2) UNSIGNED, date TIMESTAMP(DEFAULT CURRENT_TIMESTAMP) PRIMARY KEY (id), FOREIGN KEY (cid) REFERENCES Customers(id) ); 17. INSERT INTO Orders VALUES (1, 2, 1249.98, DEFAULT CURRENT_TIMESTAMP), (2, 1, 49.99, DEFAULT CURRENT_TIMESTAMP), (3, 3, 200.00, DEFAULT CURRENT_TIMESTAMP); 18. SELECT * FROM Orders WHERE cid=2; 19. SELECT * FROM Orders WHERE amount>100; 20. DROP TABLE IF EXISTS Orders;