Store_DB-ExtraProblemSolutions.pdf - IT105-Information...

This preview shows page 1 - 3 out of 5 pages.

IT105-Information Management 1 2 nd Semester SY 2020-2021 CSIT Dept., BU College of Science Solutions for the Extra Problems in Store DB 1. List the order number, order date, customer number, customer name (first and last), employee number, and employee name (first and last) of January 2013 orders placed by Colorado customers. Oracle SQL solutions: SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName, Employee.EmpNo, EmpFirstName, EmpLastName FROM OrderTbl, Customer, Employee WHERE CustState = 'CO' AND OrdDate BETWEEN '1-Jan-2013' AND '31-Jan-2013' AND OrderTbl.CustNo = Customer.CustNo AND OrderTbl.EmpNo = Employee.EmpNo; SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName, Employee.EmpNo, EmpFirstName, EmpLastName FROM OrderTbl INNER JOIN Customer ON OrderTbl.CustNo = Customer.CustNo INNER JOIN Employee ON OrderTbl.EmpNo = Employee.EmpNo WHERE CustState = 'CO' AND OrdDate BETWEEN '1-Jan-2013' AND '31-Jan-2013'; MySQL solution SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName, Employee.EmpNo, EmpFirstName, EmpLastName FROM OrderTbl, Customer, Employee WHERE CustState = 'CO' AND OrdDate BETWEEN '2013-01-01' AND '2013-01-31' AND OrderTbl.CustNo = Customer.CustNo AND OrderTbl.EmpNo = Employee.EmpNo; SELECT OrdNo, OrdDate, Customer.CustNo, CustFirstName, CustLastName, Employee.EmpNo, EmpFirstName, EmpLastName FROM OrderTbl INNER JOIN Customer ON OrderTbl.CustNo = Customer.CustNo INNER JOIN Employee ON OrderTbl.EmpNo = Employee.EmpNo WHERE CustState = 'CO' AND OrdDate BETWEEN '2013-01-01' AND '2013-01-31'; 2. List the customer number, name (first and last), order number, order date, employee number, employee name (first and last), product number, product name, and order cost
4/26/2021 Solutions for the Extra Problems in Store DB 2 (OrdLine.Qty * ProdPrice)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture