CSCI-3287-Homework 1-Solutions-Fall 2017.doc

CSCI-3287-Homework 1-Solutions-Fall 2017.doc - CSCI 3287...

This preview shows page 1 out of 5 pages.

CSCI 3287: Homework 1 Due Date 9:55p Wed. Sep 20, 2017 No late submissions will be accepted. Delivery Method Submit a Microsoft Word or PDF document containing your answers using Moodle. Problem 1: Matrix Manipulations While it is not optimal to use SQL for matrix operations, implementation of some of the simple ones can get you thinking about attributes the right way. Assume that a matrix is represented by an index/value representation, each tuple has the form: < i , j , value >. For example, a 2x2 identity matrix would look like this in a SQL table: i j value 0 0 1 0 1 0 1 0 0 1 1 1 For each part, you should provide your query and sample input and output from a mysql run. a) (20 pts) Write a SQL query that will add two 2-dimensional matrices of arbitrary but equal size, A and B. create table A(i int, j int, value int); create table B(i int, j int, value int); insert into A values(0, 0, 1); insert into A values(0, 1, 2); insert into A values(0, 2, 3); insert into A values(1, 0, 1); insert into A values(1, 1, 2); insert into A values(1, 2, 3); insert into A values(2, 0, 3); insert into A values(2, 1, 2); insert into A values(2, 2, 1);
Image of page 1
You've reached the end of this preview.
  • Spring '17
  • Frank Miller

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern