I need help with some SQL questions, specifically MySQL . Hope somebody can help
ID: 3720983 • Letter: I
Question
I need help with some SQL questions, specifically MySQL . Hope somebody can help answer all of these.
Schema EMPLOYEE (employee_id, store_id, last_name, first_name, phone, email, salary) PRODUCT (product id, category_id, product_code, product_name, description, list_price, discount_percent, dateadded, vendor_id) CUSTOMER (customer id, emailaddress, password, first_name, last_name, shipping_address_id, billing_address_id) CATEGORY (category_id, category_name) ORDERS (order id, customer_id, employee_id, store_id, order_date, ship_amount, tax_amount, ship_date, shipping_address_id, cardt_ype, card_number, card_expires, billing_address_id) ORDERITEMS (item_id, order id, product id, item_price, discount_amount, quantity) VENDOR (vendor id. company_name, contact_Iname, contact_fname, address, city, state, zip, phone, fax, email) ADDRESS (Address ldd, Customer_ld, Linel, Line2, City, State, Zip_Code, Phone, Disabled) STORE (store_id, store_id, region_id, region_name) ADMINISTRATORS (admin_id, email_address, password, first_name, last_name)Explanation / Answer
Query 5:
Select product_id,product_name,list_price from Product where list_price>30 and list_price <900;
Query 6:
Select order_id,order_date,ship_date from Orders where month(order_date) = 3 and year(order_date) = 2015;
Select order_id,order_date,ship_date from Orders where order_date between '2015-Mar-01' and '2015-Mar-31';
Select order_id,order_date,ship_date from Orders where order_date LIKE '%2015-Mar%;
Query 7:
Select product_id,product_code,product_name from Product where product_name LIKE '_E_L%' order by product_code;
Query 8:
Select product_id,category_id,vendor_id,list_price from Product where category_id = 11 or category_id = 61 and vendor_id = 2 or vendor_id = 3 and list_price >= 100;
Query 9:
Select order_id,customer_id,order_date from Orders where ship_date IS NOT NULL;
Query 10:
Insert into Category values(71,'Video Game');
Update Category set category_name = 'Camera' where category_id = 71;
Query 11:
Insert into Product(product_id,category_id,product_code,product_name,description,list_price,discount_percent,date_added,vendor_id) values(17234,71,'Camera640','Canon',Canon EOS Rebel T5 DSLR Camera',755.99,0,'2015-04-30 13:14:15',2);
Query 12:
Delete from Product where category_id = 71;
Delete from Category where category_id = 71;
Query 13:
Update Orders set cardt_ype = 'American Express' where order_id = 9;
Query 14:
Update Employee set salary = 6500 where salary = 6000;
Query 15:
Insert into Customer(customer_id,email_address,password,first_name,last_name) values(99999,'rick@raven.com'," ",'Rick','Raven');
Query 16:
Rename Table ADMINISTRATORS to ADMINISTRATORS_BACKUP:
Show Tables;
Do ask if any doubt. Please upvote.