IT2351 Assignment1 Solved

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

Rate this product

Assignment 1:

For those of you who created a GitHub account in IT1025 I recommend that you continue and add an IT2351 repo.  This will provide for the continuation of your portfolio which you may choose to connect to your LinkedIn profile.  Although a recommended practice, it is optional for our class.  For those of you who are new to GitHub and would like to use this technology, you can find instructions to get started at:  An Introduction to GitHub).

  • MySQL Workbench: Review the options and directions under “Instructor Tutorials / Accessing MySQL Workbench / Loading Textbook Files / Publisher PDFs” to gain access to MySQL Workbench. Once you have completed your chosen process, take a screenshot of MySQL Workbench open on your computer or VM and name the image Assignment1Part1.
  • Textbook files and databases (if you loaded the textbook and database files without issue you can skip b-c) :
  1. Check out the “create_databases” script file (this is a text file with an .sql file extension which associates it with MySQLWorkbench.) If you open the file in notepad you will see that it looks like this (you can also open it in MySQL Workbench):

Note that the first group of lines are comments.  You will be commenting your scripts in a similar manor for your assignment submission.

  1. Use the steps detailed at the end of each appendix and then followed-up in chapter two to load the textbook files on your computer and databases into MySQL Workbench. The zip file with all these files can be found under the “Instructor Tutorials” link once again. A few things to keep in mind particularly if you are using the VM:
    1. If you are asked for a password use: password unless you changed it along the way.
    2. The directions indicate to open the create_databases script in MySQL Workbench however, if you see “fetching data” messages in the “Schemas” window you may need to load the databases one at a time. There is a script in the folder for each individual database. The issue may also be solved by closing and re-opening MySQL Workbench.
  • If you open a sql file by double-clicking on it which will open it in MySQL Workbench. It is likely that your run button and other will be greyed out.  To fix this select the “Reconnect to DBMS” button which is directly below the “Tools” menu choice.  To avoid another connection (you will see another tab at the top) select “File / Open SQL script” from the menu to open your files in Workbench.
  1. After running a database creation script, you may not see it in the “Schemas” window.

Select the refresh button:

  1. Once you load and run the script the “schema” window in MySQL Workbench will look like:
  2. Edit the comment line that starts with “used for IT2351” with your name and the current semester. Take a screen shot and name the image:  
  • Queries using the OM database.

Double-click on the om database so that it is bold (be sure to go through chapters 2 and 3 to prepare for the exercises).  This means that it is the database currently being used.  You can also issue the command “use om;” in the SQL window.

  1. Create a query to select customer_first_name, customer_last_name, customer_city and customer_state from the customers table sorted in ascending order by state and then city. Be sure to add comment lines at the top with your name and the purpose of the query. Take a screen shot of the result (be sure to include the entire query code – you can put it on multiple lines if necessary) as well as the portion of output that shows in the window.  Name your image IT2351Assignment1Part3A.  Here is an example:

It is never too early to check out the “Action Output” at the bottom.  If you have issues with your code it may have squigly lines under to indicate syntax errors or, you may see an error message in the output window.  If you have a problem and would like assistance from me be sure to include a screenshot as above as well as the saved sql (use the save script file button second from the left in the sql window.)

  1. Create a query to show the title, artist, and unit_price from the items table where the unit_price is > 16 sorted by unit_price. Be sure to include comments as in part a, take a screen shot and name the image Assignment1Part3B.
  2. Using aliases: Create a query showing: customer_first_name as “First Name”, customer_last_name as “Last Name”, customer_city as “City” and customer_state as “State” from the customers table. Sort by last name and then first name. Be sure to include comments as in part a, take a screen shot and name the image Assignment1Part3C.
  3. Arithmetic expressions: Create a query showing customer_id, order_date, shipped_date and the difference between these two dates from the orders table (adjust your calculation so that you output is positive numbers). Provide an alias for each column naming the difference column: “Days_to_Ship” (the significance of the underscore is to use the alias in sorting).  Sort your output by customer_id and then by Days_to_Ship, take a screen shot, include comments, and name your image: Assignment1Part3D. Keep this query on your screen for the next part.
  4. As you can see queries start to get a bit lengthy, so it is good practice to save them either by saving the script file or creating a snippet. Following the steps on page 57 / Figure 2-8 create a snippet of your part d query. Take a screen shot showing the snippet and name the image Assignment1Part3E.
  5. Next, save the script using the save button and name the sql file sql. As you continue to develop queries you will often want to save the script file and/or create a snippet so that you can revisit and edit the code.
  6. Concat function: Use the concat function to show customer names as “Name” sorted by last name and then first name (fields from the listed table do not need to be included in a select statement to use them in sorting. Include comments, take a screen shot and name your file Assignment1PartG.
  7. Date_Format function: Edit your query in part d to format the three date fields m/d/y. Include comments, take a screen shot and name your file Assignment1PartH.
  • Assignment1-qyaxbc.zip