M4.2 Bonus SQL problems

M4.2: Practice Problems

Name:

Instructions:

These SQL practice problems are designed as a skill-building journey, progressing from foundational queries to more advanced problems that will help you prepare for the Final Exam. When using Generative AItools, you are required to follow this e on how to use GenAI tools to learn SQL coding responsibly.

Each SQL practice problem is worth 1 bonus point.

For each problem:

    • Write and execute an SQL query in Oracle Live SQL.
    • Execute the following command: SELECT sysdate, ‘your name’ FROM dual; where your_name is substituted with your name.
    • Take a screenshot that includes both SQL statements and all results.
    • Copy and paste the screenshot into a Word file containing your solutions.

In addition, after completing this assignment, include a short overall reflection on your experience using ChatGPT (or another generative AI tool) to support your SQL learning. Answer the following questions:

  • When was AI most useful or effective, and when did you find it less helpful or potentially misleading?
  • How did you decide whether to trust, revise, or reject AI-generated SQL?
  • What would you do differently the next time you use AI to support your SQL work?

Practice Problems: Basic SQL SELECT Statements

    1. Display all data contained in one of the tables in the JustLee Books database.
    2. Retrieve two columns from one of the tables in the JustLee Books database.
    3. Retrieve several columns from one of the tables in the JustLee Books database. Use an alias for one of the columns.
    4. Retrieve several columns from one of the tables in the JustLee Books database. Use an alias that contains blank space(s) for one of the columns.
    5. Find a table in the JustLe Books database that contains duplicate values in one of the columns. Retrieve that column but list each value only once.
    6. Retrieve data from two character columns from one of the tables in the JustLee Books database and display the result in a single column with a descriptive heading. Values in the output should be separated by a comma and a blank space.
    7. Find a table in the JustLe Books database that contains numerical values in one of the columns. Retrieve that column and perform a basic arithmetic operation on data.
    8. Find a table in the JustLe Books database that contains numerical values in one of the columns. Retrieve that column and increase each value by 10%. Display the original value and the new value with descriptive headings in the output.
    9. Create a mailing list of all customers stored in the CUSTOMERS table. Create a mailing list from the CUSTOMERS table. The mailing list should display the name, address, city, state, and zip code for each customer. Each customers name should be listed in order of last name followed by first name, separated with a comma, and have the column header Name. The city and state should be listed as one column of output, with the values separated by a comma and the column header Location.
    10. Calculate a list of the percentage of profit generated by each book in the BOOKS table. To determine the percentage of profit for a particular item, subtract the items cost from the retail price to calculate the dollar amount of profit, and then divide the profit by the items cost. The solution is then multiplied by 100 to determine the profit percentage for each book. Use a SELECT statement to display each books title and percentage of profit. For the column displaying the percentage markup, use Profit % as the column heading.

Requirements: Just follow each parts

WRITE MY PAPER