1. A realational database management system (RDBMS) is a program that allows you to create, update, and administer a relaitonal database. 2. Structured Query Language (SQL) is a programming language that allows interaction with the data stored in a relational database management system. The syntax for SQL is similar to English, which makes it easy to write, read, and interpret. 3. An ER model is a set of entities which classify data and specifies relationships that can exist between entities. 4. A one-to-one relationship is a link between two entities where an entity can be linked by only one element. An example of a 1:1 relationship is 1 country has only 1 capital. A one-to-many relationship is a link between two entities where an element in one entity can have multiple links to another entity. An example of a 1:M relationship is 1 student may be enrolloed in many courses. A many-to-many relationship is a link between two entities where an element in both entities can have multiple relationships. An example of this is a books entity can have many authors and vice versa. 5. The purpose of a primary key is to uniquely identify the referenced entitiy. It should be unique to eliminate redundancy in a database. 6. CREATE TABLE IF NOT EXISTS customers { id INTEGER NOT NULL AUTO_INCREMENT, firstName VARCHAR(255) NOT NULL, lastName VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, city VARCHAR(255) NOT NULL, state VARCHAR(2) NOT NULL, zip VARCHAR(5) NOT NULL, email VARCHAR(255) NOT NULL, PRIMARY KEY(id) }; 7. ALTER TABLE customers ADD age INTEGER UNSIGNED NOT NULL; 8. INSERT INTO customers(id, firstName, lastName, address, city, state, zip, email) VALUES (1, 'Rudy', 'Martinez', '10000 Ming Ave', 'Bakersfield', 'Ca', '93312', 'rmartinez87@csub.edu'), (2, 'Will', 'Sparks', '204 Old River Rd', 'Bakersfield', 'Ca', '93311', 'wsparks@csub.edu'), (3, 'Isaac', 'Lara', '3000 Canyon Way', 'Bakersfield', 'Ca', '93306', 'ilara@csub.edu'); 9. SELECT * FROM customers; 10. CREATE TABLE IF NOT EXISTS products { id INTEGER NOT NULL AUTO_INCREMENT, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, price DOUBLE(5, 2) UNSIGNED NOT NULL }; 11. INSERT INTO products(id, title, description, price) VALUES (1, 'Phone', 'Samsung Galaxy', 899.00), (2, 'Tablet', 'Apple iPad', 499.00), (3, 'Laptop', 'Surface Laptop 3', '999.00'); 12. SELECT * FROM products; 13. UPDATE products SET price = 49.99 WHERE id = 1; 14. SELECT * FROM products p WHERE p.price < 100.00; 15. DELETE FROM products WHERE id = 3; 16. CREATE TABLE IF NOT EXISTS orders { id INTEGER NOT NULL AUTO_INCREMENT, cid INTEGER UNSIGNED NOT NULL, amount DOUBLE(5, 2) UNSIGNED NOT NULL, date DATETIME DEFAULT, PRIMARY KEY(id), FOREIGN KEY(cid) REFERENCES customers(id) }; 17. 18. SELECT * FROM orders WHERE customer.id = 1; 19. SELECT * FROM orders o WHERE o.amount > 100.00; 20. DROP TABLE orders;