Question
/* 5. Write a select statement that returns the customer_id, and one column from the customers table named full_name that combines the last name, and
/* 5. Write a select statement that returns the customer_id, and one column from the customers table named full_name that combines the last name, and the first name of each customer SELETC customer_id, Format this column using a comma and space so that it looks like this: Doe, John */ /* 6. Write a select statement that lists every column from the customers table, but only include rows of customers whose last name contains an "n". */ /* 7. Write a select statement that returns all columns from the customers table but only returns rows where the customer's last name starts with "G" */ /* 8. Write a select statement that returns the product_name, list_price, and date_added from the Products table. Only return rows where the list price is greater than 500 and less than 2000. Remember there is a distinct difference in the these two sql operators 1. BETWEEN 2. >< */ /* 9. For each row in the orders table return the order_id, customer_id, and order_date. Format the order_date so that it displays like this '01/01/99'. Only include orders that don't have a ship_date. */ /* 10. Write a select statement that displays each credit card type in the orders table, only display the card type once */ /* 11. Write a select statement that returns the customer_id, line1, line2, and phone_number columns from the addresses table for any customer located in the state of New Jersey or the city of New York. Rename the customer_id column as "NY Area Call List". */ /* 12. Write a select statement that returns the product_name and discount percent from the products table. Only return rows with a discount percent greater than or equal to 25 and less than or equal to 30. Don't use <> operators to do this. */ /* 13. Write a query that returns the 3 most expensive products in the products table as indicated by list price of the products. */ /* 14. Write a select statement that returns the product_id, the product_name, and the first 50 characters of the description from the products table. */ /* 15. Write a select statement that returns the product_id, product_name, discount_percent, and list_price columns from the products table, round the discount_percent to one decimal place and the list_price to 0 decimal places */ /* 16. Write a select statement that returns all columns from the orders table, but only returns the five newest (most recent) orders in the orders table as shown by the order_date column */ /* 17. Write a select statement that returns all columns from the addresses table for customers NOT located in Colorado, California, or Oregon. Use the IN operator to accomplish this */ /* 18. List all of the orders in the orders table. Only list orders that have a card type of Visa, a tax amount of 0, and a shipping amount of 5.00 or less */ /* 19. Use the REGEXP operator to return all columns and all rows from the addresses table where where the street address (line1) column ends in 'Rd.' */ /*20. List only the orders in the orders table that have not been shipped as indicated in the ship_date column */
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started