1. A RDMS stands for relational database management system, its responsible for organizing data into tables based on their relationship 2. SQL (Structured Query Language) is a programming language built specifically for databases and used to do set operations. 3. An Entity Relationship model (ER) is used to relate several items in a table with common information. 4. 1:1, one record in a table is associated with one and only one record in another table. 1:many, one record in a table is associated with more than one record in other tables. many:many, multiple records in one table are associated with multiple records in another table. 5. The purpose of a primary key is to be used to identify a unique record within a table, it should be unique that way it can be used to identify one and only one record in the table. 1. CREATE TABLE Customers ( id int NOT NULL UNIQUE AUTO_INCREMENT, firstName varchar(255) NOT NULL, lastName varchar(255) NOT NULL, address varchar(255) NOT NULL, city varchar(255) NOT NULL, state char(2) NOT NULL, zip int(5) ZEROFILL NOT NULL UNSIGNED, email varchar(255) NOT NULL, PRIMARY KEY (id) ); 2. ALTER TABLE Customers ADD age int UNSIGNED NOT NULL; 3. INSERT INTO Customers (id, firstName, lastName, address, city, state, zip, email, age) VALUES ('Chad', 'M', '2001 road', 'Bakersfield', 'CA', 93309, 'c@gmail.com', 200); INSERT INTO Customers (id, firstName, lastName, address, city, state, zip, email, age) VALUES ('Chase', 'S', '2031 road', 'Bakersfield', 'CA', 93309, 'chase@gmail.com', 100); INSERT INTO Customers (id, firstName, lastName, address, city, state, zip, email, age) VALUES ('Susan', 'B', '221 road', 'Compton', 'CA', 93341, 'sue@gmail.com', 20); 4. SELECT * FROM Customers; 5. CREATE TABLE Products ( id int NOT NULL AUTO_INCREMENT, title varchar(255) NOT NULL, description varchar(255) NOT NULL, price decimal(4, 2) NOT NULL UNSIGNED, PRIMARY KEY (id) ); 6. INSERT INTO Products (title, description, price) VALUES ('Ham', 'Ham', 2.99); INSERT INTO Products (title, description, price) VALUES ('Bologne', 'Bologne', 3.99); INSERT INTO Products (title, description, price) VALUES ('Turkey', 'Its meat', 99.99); 7. SELECT * FROM Products; 8. UPDATE Products SET price = 49.99 WHERE id = 1; 9. SELECT * FROM Products WHERE price < 100.00; 10. DELETE FROM Products ORDER BY id DESC LIMIT 1; 11. CREATE TABLE Orders ( id int NOT NULL AUTO_INCREMENT, cid int NOT NULL, amount decimal NOT NULL UNSIGNED, date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), FOREIGN KEY (cid) REFERENCES Products(id) ); 12. INSERT INTO Orders (cid, amount) VALUES (1, 20); INSERT INTO Orders (cid, amount) VALUES (2, 37); INSERT INTO Orders (cid, amount) VALUES (1, 35); 13. SELECT * FROM Orders WHERE cid=1; 14. SELECT * FROM Orders WHERE amount > 100; 15. DROP TABLE Orders;