CIS111 Chapter 5 Lab ProblemsThis Lab sheet is worth 100 points for complete queries. Only fully completed and documented solutions will receive maximum points. The queries are due per the...

y


CIS111 Chapter 5 Lab Problems This Lab sheet is worth 100 points for complete queries. Only fully completed and documented solutions will receive maximum points. The queries are due per the timeline in Moodle. The queries in this assignment will use the Northwind database. Create an SQL query to solve the problem. Don’t forget to include all of the following. 1. The database used “USE” 2. Comment with the assignment name, query number, your name and date. 3. The SQL code, in a readable, programmatic format. 4. Add a brief comment for each of the main segments, what the operation will accomplish 5. The output of the messages tab, to include the full “Completion time” or “Total Execution Time” line. 6. Should only have one row in the output for each query. Follow the instructions in the Lab Lecture, complete the following queries. 1. Create a query that will find the total number of orders from the orders table. 2. Create a query that will find the total value of all items in the products table. 3. Create a query that will find the most expensive single item in the order details table. Just need to report the items value 4. Create a query that will find the last name of the oldest employee. You will need a sub query. CIS111 Chapter 6 Lab Problems This Lab sheet is worth 100 points for complete queries. Only fully completed and documented solutions will receive maximum points. The queries are due per the timeline in Moodle. The queries in this homework assignment will use the Northwind database. Create an SQL query to solve the problem. Don’t forget to include all of the following. 1. The database used “USE” 2. Comment with the assignment name, query number, your name and date. 3. The SQL code, in a readable, programmatic format. 4. Add a brief comment for each of the main segments, what the operation will accomplish 5. The output of the messages tab, to include the full “Completion time” or “Total Execution Time” line. 6. First 5 lines of the “Results” output. Points will be deducted if missing, more than 5, or using the TOP command. Follow the instructions in the Lab Lecture, complete the following queries. Query 1 Write a statement, with a subquery, that returns the same result set as the statement below. Substitute a subquery in the WHERE clause to replace the inner join, and using only the Customers table in the FROM line. USE CIS111_NorthWind SELECT DISTINCT CompanyName FROM Customers JOIN Orders ON Customers.CustomerID = Orders.customerID ORDER by CompanyName Query 2 Display the Customer Names for those customers that have NOT submitted an Order. Use a subquery. CIS111 Chapter 7 Lab This Lab sheet is worth 100 points for complete queries. Only fully completed and documented solutions will receive maximum points. The queries are due per the timeline in Moodle. The queries in this homework assignment will use the GuitarShop database. Create an SQL query to solve the problem. Don’t forget to include all of the following. 1. The database used “USE” 2. Comment with the assignment name, query number, your name and date. Also include the answers to any questions to the comments. 3. The SQL code, in a readable, programmatic format. 4. Add a brief comment for each of the main segments, what the operation will accomplish 5. The output of the messages tab, to include the full “Completion time” or “Total Execution Time” line. 6. First 5 lines of the “Results” output. Points will be deducted if missing, more than 5, or using the TOP command. Follow the instructions in the Lab Lecture, complete the following queries. We want to add some data to tables. The order in which the data is inserted is based on the table definition and the table relationships. For example, if we wanted to order something, looking at the orders table, you can see the primary key, but also the foreign key. So essentially, of a customer doesn’t exist, the order can’t be placed. Run the following queries: USE Cis111_GuitarShop --Query 1 SELECT * FROM Customers Then run: USE Cis111_GuitarShop --Query 2 SELECT * FROM Orders You can see the next customer number is 486 Let’s see if the following query runs. USE Cis111_GuitarShop --Query 3 INSERT INTO Orders (OrderID, CustomerID, OrderDate,ShipAmount, TaxAmount, ShipDate, ShipAddressID, CardType, CardNumber, CardExpires, BillingAddressID) VALUES (100, 486, getdate(), 200, 200, getdate() +10, '5101 Evergreen Dearborn MI', CIS111 Chapter 7 Lab 'Visa', 111-111-11121, getdate()+100, '5101 Evergreen Dearborn MI') Question 1: What was the error and why did you get it? Run the following query and answer the question. USE Cis111_GuitarShop --Query 4 insert into Orders (CustomerID, OrderDate,ShipAmount, TaxAmount, ShipDate, ShipAddressID, CardType, CardNumber, CardExpires, BillingAddressID) VALUES (486, getdate(), 200, 200, getdate() +10, 300, 'Visa', 111-111-11121, getdate()+100, 300) Question 2: what was the error, and why did you get the error? Using the following information, create two queries that will insert the data into both tables. In the <> use information provided or your information. For the Customers table: EmailAddress Password Firstname LastName ShippingAddressID BillingAddressID Submit your query, and verification that your information was added. You will need to see your customer number before adding the order data. Now create a query that will add the order information. Use or fill-in the information needed between <> CustomerID OrderDate ShipAmount TaxAmount ShipDate < use="" the="" function="" getdate()="" +10=""> ShipAddressID CardType CardNumber CardExpires< use="" the="" function="" getdate()+100=""> BillingAddressID Submit your query, and verification that your information was added. Question 3 – why did all work this time? CIS111 - Entity Relationship Lab This Lab sheet is worth 100 points. You will use the Oracle data modeler to create an ERD. Even though you can use other programs, you will need to create an ERD for project 1 and the quiz. If you use another program to complete this lab, and the cardinality is not displayed, a zero will be given. This is an architectural exercise, so you do not need to identify attribute data types, as you would show in the data dictionary. When complete with your ERD, please print to a PDF format. You can download the Oracle data modeler from either Moodle or Teams. There is a version for the MacBook’s, and two versions for Windows. If one of the Windows versions won’t work, the other should. Creating an entity relationship diagram. Once the entities and attributes have been determined, it’s time to make the table relationships. This part is important, as your ERD relies on this relationship. Using the tables/attribute below, you can make the ERD. Please see the online video on how to make an ERD using the Data Modeler. Vendors VendorID(pk) VendorName VendorCity VendorState VendorZip InvoiceID (fk) Invoices InvoiceID(pk) InvoiceDate InvoiceTerms InvoiceTotal ItemID (fk) InvoiceLineItem ItemID(pk) ItemDesciption ItemWeight Now that we have the tables and attributes, please create the ERD
Oct 21, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here