BU2010 Working with databases

Introduction

Overview

This week you get to work with databases.

Advice

Once you are done be sure to commit your changes (to save them to the repository) and to push them to GitHub (so that I can see the work you have done).

It's best if you Commit early, commit often - that way you can go back if you have made a mistake and I can see all the work you have done. It doesn't matter if your early commits contain mistakes.

Once you are done be sure to commit your changes (that will save them to the repository) and to push them to GitHub (so that I can see the work you have done).

Task Explanation

Below is today's task. We will be working with a range of skills you have learned in recent weeks.

We will work with the phpMyAdmin system available at bu2010.bimserver2.com . Please use the bu2010_reader user as shown in class.

Task Explanation and Overview

Below is today's task. For this task, you need to work in the file you are currently reading. It is a Markdown file. More explanations about the Markdown syntax can be found on this page.

  • Under the heading Your Task you will find several questions.
  • Please answer the questions here in this markdown file.
  • Commit
  • Push your Commit(s)

Commit early, commit often - that way you can go back if you have made a mistake and I can see all the work you have done. There's no problem if you commit and there's a mistake in your file or if you haven't answered all questions yet.

Once you are done be sure to commit your changes (that will save them to the repository) and to push them to GitHub (so that I can see the work you have done).

Work by yourself. Do not work with others as working with others might be Academic Misconduct.

Your Tasks

Task 1

Please log on to bu2010 database, using the bu2010_reader account. What query will help you find out which companies in Australia have a turnover of less than 14000?

Answer: Replace this text with your answer.

Task 2

Continue to work in the bu2010 database. Explain the query you used in Task 1, i.e. explain the different elements of the query and what they do.

Answer: Replace this text with your answer.

Task 3

Continue to work in the bu2010 database. What company has the highest turnover anywhere? What is the name of the company and the name of the country? What query did you use to find out?

Answer: Replace this text with your answer.

Task 4

Continue to work in the bu2010 database. Explain the query you used in Task 3, i.e. explain the different elements of the query and what they do.

Answer: Replace this text with your answer.

Task 5

Please log on to your own database. Earlier this week you were emailed the credentials you need to log on. Import the SQL code that is stored in the file authors_posts.sql in this repo.

Task 6

Continue to work in your own database. Link these two tables by setting the correct foreign key relationship. Use constraints that make sense.

Answer: Paste the SQL code that links these two tables here.

Task 7

Continue to work in your own database. Using phpMyAdmin's export function, export the exchange rate table you created in class and add the SQL code of the export to this repo in a file called exchangerates.sql

Again: Work by yourself. Do not work with others as working with others might be Academic Misconduct.