1. Basically, RDBMS is the basis of sql. Its a program that allows us to create/ update databases 2. SQL is a language used to communicate the data stored in RDBMS. 3. ER model is entity-Relationship model. It is used to defin the data elements and relationships for a system. 4. One-to-one relationship is the idea that one record in a tableis associated with one and only one record in another table. One-to-one many relationships is similar to one to one in that in many relationship one record in a table can be associated with one or more records in another table. Many-to-many is the idea that many records in a table can be associated to many other records in other tables. 5. The purpose of a primary key is to uniquely identify each record in a table. It needs to be unique because it needs to represent a single record in the table. 1. create table Customertest ( id int 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 int(5) NOT NULL, email varchar(255) NOT NULL, PRIMARY KEY(id) ); 2. ALTER TABLE Customertest ADD age int NOT NULL; 3. INSERT INTO Customertest ( firstName, lastName, address, city, state, zip, email, age) VALUES ( 'First', 'joe', '2323 duncan st', 'Bakersfield', 'CA', '93302', 'firstjoe@gmail.com', '30'); INSERT INTO Customertest ( firstName, lastName, address, city, state, zip, email, age) VALUES ('Second', 'joe', '3465 Face st', 'Bakersfield', 'CA', '93302', 'secondjoe@gmail.com', '35'); INSERT INTO Customertest ( firstName, lastName, address, city, state, zip, email, age) VALUES ( 'third', 'joe', '3986 will st', 'Bakersfield', 'CA', '93305', 'thirdjoe@gmail.com', '29'); 4. SELECT * FROM Customertest 5. create table Producttest ( id int NOT NULL AUTO_INCREMENT, title varchar(255) NOT NULL, description varchar(255) NOT NULL, price decimal(5,2) UNSIGNED NOT NULL ); 6. INSERT INTO Producttest (title,description,price) VALUES ( 'Camera', 'Amazing camera', '500'); INSERT INTO Producttest (title,description,price) VALUES ('Tripod', 'Ultra sturdy tripod', '200'); INSERT INTO Producttest (title,description,price) VALUES ( 'SD Card', 'Reliable SD Card', '40'); 7. SELECT * FROM Producttest 8. UPDATE Producttest SET price ='45' WHERE id=3; 9. SELECT * FROM producttest WHERE price < '100'; 10. DELETE FROM Producttest WHERE id='3'; 11. create table Ordertest ( id int NOT NULL, cid int NON NULL, amount decimal (5,2) NOT NULL, date TIMESTAMP NOT NULL DEFAULT(GETDATE()), FOREIGN KEY(cid) REFERENCES Customertest ); 12. INSERT INTO Ordertest (cid, amount, date) //coulnt get it to compile VALUES(1, 40); INSERT INTO Ordertest (cid, amount, date) VALUES(2, 50); INSERT INTO Ordertest (cid, amount, date) VALUES(3, 60); 13. SELECT * FROM Ordertest WHERE cid = 1; 14. SELECT * FROM Ordertest WHERE amount > 100.00; 15. DROP Table Ordertest;