Final_Project notes: CREATE TABLE Cart (c_id INTEGER NOT NULL AUTO_INCREMENT, c_userid INTEGER NOT NULL , c_productid INTEGER NOT NULL, c_qnty INTEGER NOT NULL, PRIMARY KEY (c_id)); ALTER TABLE Users ADD u_address VARCHAR(255); ALTER TABLE Users ADD u_state VARCHAR(10); ALTER TABLE Users ADD u_zip VARCHAR(15); Q11) Write the SQL command that would create a table called 'Customers' that has attributes for 'c_id', 'c_firstName', 'c_lastName','c_address', 'c_city', 'c_state', 'c_zip', and 'c_email'. List the 'c_id' as an integer non null auto incrementing primary key attribute. A11) CREATE TABLE Customers (c_id INTEGER NOT NULL AUTO_INCREMENT, c_firstName CHAR(50), c_lastName CHAR(50), c_address CHAR(100), c_city CHAR(50), c_state CHAR(50), c_zip CHAR(15), c_email CHAR(75), PRIMARY KEY (c_id)); Q12) Write the SQL command that would alter the 'Customers' table by adding a new column for 'c_age' unsigned tiny integer. A12) ALTER TABLE Customers ADD c_age TINYINT UNSIGNED; Q13) Write the SQL command that would create a table called 'Products' that has attributes for 'p_id', 'p_title', 'p_description', 'p_price'. List the 'p_id' as an integer non null auto incrementing primary key attribute. Set the data type of 'p_price' to decimal(13,4). A13) CREATE TABLE Products (p_id INTEGER NOT NULL AUTO_INCREMENT, p_title CHAR(50), p_description CHAR(150), p_price DECIMAL(13,4), PRIMARY KEY (p_id)); Q14) Write the SQL command that would add at least 3 records to the 'Customers' table A14) INSERT INTO Customers (c_firstName, c_lastName, c_address, c_city, c_state, c_zip, c_email ) VALUES ('John' ,'Crossley' ,'114 A Street', 'Bakersfield', 'CA', '93304', 'jbc@email.com'), ('Brad' ,'Whitley' ,'222 F Street', 'Bakersfield', 'CA', '93301', 'bw@email.com'), ('George' ,'Benson' ,'444 So Union Ave', 'Bakersfield', 'CA', '93302', 'gbenson@email.com') ; Q15) Write the SQL command that would add at least 3 records to the 'Products' table. A15) INSERT INTO Products (p_title, p_description, p_price ) VALUES ('2005 Toyota Camry Wheel' ,'Used 2005 Toyota Camry Wheel in Like-new condition', '200.80'), ('Rock-em Sock-em Robots' ,'New Rock-em Sock-em Robots Game with plastic wrap intact', '145.32'), ('Double Bubble Gum' ,'UnOpened Double Bubble Gum bucket with 180 pieces', '15.16') ; Q16) Write the SQL command that would create a table called 'Orders' that has attributes for 'o_id', 'o_cid', 'o_amount', 'o_date'. List the 'o_id' as an integer non null auto incrementing primary key attribute. Set the data type of 'o_amount' to decimal(13,4). Set the 'o_date' to an 8 byte data type that holds the format YYYY-MM-DD HH:MM:SS A16) CREATE TABLE Orders (o_id INTEGER NOT NULL AUTO_INCREMENT, o_cid INTEGER NOT NULL, o_amount DECIMAL(13,4) NOT NULL, o_date DATETIME NOT NULL, PRIMARY KEY (o_id)); Q17) Using the data you've provided for your Customers and Products table, write the SQL command to add at least 3 records to the 'Orders' table. A17) INSERT INTO Orders (o_cid, o_amount, o_date ) VALUES ('3' ,'200.80', '2018-03-22 08:30:55'), ('2' ,'145.32', '2018-01-02 10:45:16'), ('1' ,'200.80', '2018-01-15 13:15:19'), ('2' ,'49.99', '2018-01-15 06:18:36') ; Q18) Write the SQL command that would select all of your Customers. A18) SELECT * FROM Customers; Q19) Write the SQL command that would select all of your Products. A19) SELECT * FROM Products; Q20) Write the SQL command that would update one of your Products price to 49.99. A20) UPDATE Products SET p_price='49.99' WHERE p_price='145.32'; Q21) Write the SQL command that would select all of your Products that are less than $100. A21) SELECT * FROM Products WHERE p_price < '100'; Q22) Write the SQL command that would select all Orders where the order customer id is that of your first Customer. A22) SELECT * FROM Orders WHERE o_cid = '1'; (assuming there have been no deletions... OTherwise it would be something like "DELETE FROM Orders ORDER BY c_id ASC LIMIT 1; Q23) Write the SQL command that would select all Orders above $100. A23) SELECT * FROM Orders WHERE o_amount > '100'; Q24) Write the SQL command that would delete your last Product record. A24) DELETE FROM Products ORDER BY p_id DESC LIMIT 1; Q25) Assume there is a table called DropThisTable_GoneForever, write the SQL command that would drop that table. A25) DROP TABLE DropThisTable_GoneForever;