Using the Online SQL Editor, answer the following questions with screenshots. Link: https://www.programiz.com/sql/online-compiler/ 1. Show all columns from Order table then add a new column titled “Lowest Price”, where such column flags or labels all amounts less than or equal to 300 as “Items 300 and below”. Answer(screenshot of code & output from SQL Editor) 2. Show last name, first name, and age columns from Customers table then add a new column titled “Age Label”, where such column flags or labels all ages 25 and above as “Tigulang na” and ages below 25 as “Bata pa ah”. Answer(screenshot of code & output from SQL Editor) 3. Provide the order id, item and sum (amount) of all items with a total (sum) amount greater than 400; rename the sum (amount) column as “Total Amount”; then group the result by order_id. Answer(screenshot of code & output from SQL Editor) 4. Show the customer id, last name, and first name of all customers who ordered items with an amount greater than 400. Answer(screenshot of code & output from SQL Editor) 5. Show the customer id, last name, and first name of all customers who did not have any orders from the order table list. Answer(screenshot of code & output from SQL Editor)
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
Using the Online SQL Editor, answer the following questions with screenshots.
Link: https://www.programiz.com/sql/online-compiler/
1. Show all columns from Order table then add a new column titled “Lowest Price”, where such column flags or labels all amounts less than or equal to 300 as “Items 300 and below”. Answer(screenshot of code & output from SQL Editor)
2. Show last name, first name, and age columns from Customers table then add a new column titled “Age Label”,
where such column flags or labels all ages 25 and above as “Tigulang na” and ages below 25 as “Bata pa ah”. Answer(screenshot of code & output from SQL Editor)
3. Provide the order id, item and sum (amount) of all items with a total (sum) amount greater than 400; rename the sum (amount) column as “Total Amount”; then group the result by order_id. Answer(screenshot of code & output from SQL Editor)
4. Show the customer id, last name, and first name of all customers who ordered items with an amount greater than 400. Answer(screenshot of code & output from SQL Editor)
5. Show the customer id, last name, and first name of all customers who did not have any orders from the order table list. Answer(screenshot of code & output from SQL Editor)

Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 5 images









