ICA-5-SQL-Part-1.docx - In-class Activity#5 Working with...

Info icon This preview shows pages 1–3. Sign up to view the full content.

In-class Activity #5: Working with SQL, Part 1 Getting Information out of a Database Submit your solutions for Part 2 of this exercise as a word or pdf file through Blackboard by Wednesday, 9/27/2017, 11:59 pm. To do this exercise, you will be working with a movie rental database. The schema for this database is provided on the accompanying document. All of the tables are in a schema called simply “ moviedb ” (not m0moviedb, m1moviedb, etc.). You can’t write to any of the tables – you can only use SELECT statements to read from them (so don’t worry about causing any damage). Spend some time looking at the schema carefully. The field names are pretty self-explanatory. For example, here are three tables: You can see that a film has a title, description, rating, and length (among other things). You can also see that an actor has a first name and a last name. The film_actor table implements the many-to-many relationship between actor and film (i.e., a film can have more than one actor, and an actor can be in more than one film). You’ll also notice that data types are listed for each field, but they should be pretty obvious – for example, first_name is a VARCHAR because it is a string value.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Part 1: Try out some simple queries In the Query 1 pane, type the following: And then click the Execute SQL Script button (the lightning bolt):
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '11
  • schuff

{[ 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