This document contains SQL scripts that:
1. Execute a SQL script and show tables before and after.
2. Run queries on the customer and part tables including finding largest balance, average price, and rows between certain values.
3. Update and delete rows from tables based on certain criteria.
4. Insert new rows into tables.
This document contains SQL scripts that:
1. Execute a SQL script and show tables before and after.
2. Run queries on the customer and part tables including finding largest balance, average price, and rows between certain values.
3. Update and delete rows from tables based on certain criteria.
4. Insert new rows into tables.
This document contains SQL scripts that:
1. Execute a SQL script and show tables before and after.
2. Run queries on the customer and part tables including finding largest balance, average price, and rows between certain values.
3. Update and delete rows from tables based on certain criteria.
4. Insert new rows into tables.
This document contains SQL scripts that:
1. Execute a SQL script and show tables before and after.
2. Run queries on the customer and part tables including finding largest balance, average price, and rows between certain values.
3. Update and delete rows from tables based on certain criteria.
4. Insert new rows into tables.
Then show tables;p Describe customer; 1. select max(balance) as 'largest balance' from customer; # largest balance '1817.50' describe part; 2. select format (avg(unit_price), 2) as average price from part; # average price '135.57' 3. select part_number, part_description, unit_price from part where unit_price between 30 and 300; # part_number, part_description, unit_price 'BT04', 'Gas Grill', '149.99' 'CA14', 'Griddle', '39.99' 'CB03', 'Bike', '299.99' 4. delete from orders where order_number between 12491 and 12498; 5. Update customer Set credit_limit=2000 Where balance<=800; 6. insert into order_line (order_number, part_number, number_ordered, quoted_price) values (12489, 'AZ52', 10, 24.99), (12491, 'AZ52', 5, 19.99), (12494, 'BA74', 3, 14.99); 1. select first, last, concat('$', format(balance, 2)) as 'balance' from customer
2. select customer_number, last, first, min(balance)
from customer; 3. delete from customer where slsrep_number='03' and credit_limit>'1500'; 4. update part 5. insert into extra credit: select concat(last, ', ', first) as 'name', concat(street, ', ', city, ', ', state, ', ', zip_code) as 'address' from customer order by zip_code;