Database Exercises
SERIE 1:Project database
JOIN / Project database
    Make Query which,...
  1. Print the person lastnames and the amount of their working hour.
  2. Print the person lastnames and the sum of their working hour.
  3. Print the pnames of the project and the sum of their working hour.
  4. Print the person lastnames , project pnames and and the amount of their working hour.
  5. Print the pnames of the project where Morrison has been working.
  6. Print the project pname and person lastname and the amount of their working hour; the project without hour should be included (105 and 106)
SERIE 2:Library database
JOIN / Library database
    Make Query which,...
  1. Show the names of borrower and which book they have borrowed. Result should be like this
    +-----------+----------+------------------------------------+
    | firstname | lastname | name                               |
    +-----------+----------+------------------------------------+
    | Kay       | Naquin   | TBA                                |
    | Leonard   | Rowden   | Art Since 1940                     |
    | Leonard   | Rowden   | Art History Vol II & ala carte lab |
    | Leonard   | Rowden   | Drawing Manual Vilppu              |
    | Ralph     | Shane    | Everything You Ever Wanted to Know |
    | Marvin    | Heflin   | Intermediate Accounting            |
    | Marvin    | Heflin   | Management                         |
    | Marvin    | Heflin   | Business Law Today                 |
    | Marvin    | Heflin   | Management Info Systems            |
    +-----------+----------+------------------------------------+
    
  2. The same as below but use concat and change the headins, so the the results are like this
    +----------------+------------------------------------+
    | borrower name  | book name                          |
    +----------------+------------------------------------+
    | Kay Naquin     | TBA                                |
    | Leonard Rowden | Art Since 1940                     |
    | Leonard Rowden | Art History Vol II & ala carte lab |
    | Leonard Rowden | Drawing Manual Vilppu              |
    | Ralph Shane    | Everything You Ever Wanted to Know |
    | Marvin Heflin  | Intermediate Accounting            |
    | Marvin Heflin  | Management                         |
    | Marvin Heflin  | Business Law Today                 |
    | Marvin Heflin  | Management Info Systems            |
    +----------------+------------------------------------+
    
  3. The same as below but use group_concat, so that the results are like this
    +----------------+--------------------------------------------------------------------------------+
    | borrower name  | books                                                                          |
    +----------------+--------------------------------------------------------------------------------+
    | Kay Naquin     | TBA                                                                            |
    | Leonard Rowden | Art Since 1940,Art History Vol II & ala carte lab,Drawing Manual Vilppu        |
    | Ralph Shane    | Everything You Ever Wanted to Know                                             |
    | Marvin Heflin  | Intermediate Accounting ,Management,Business Law Today,Management Info Systems |
    +----------------+--------------------------------------------------------------------------------+
    



Toggle Menu