Giter Site home page Giter Site logo

mysql-workshop-2's Introduction

MySQL Workshop 2 - Basic Data Manipulation

Workshop Contents

Data Manipulation Statements

Data Manipulation Queries

Query Clauses

Query Modifiers

MySQL Bulk Data Import

# Executing Statements from an External File
mysql> source <filename>

Workshop Instructions

  • Fork this repository
  • Create a new Cloud9 Workspace
  • For every exercise in this Workshop:
    • Create a new file named "exercise-n.txt", containing:
      • The SQL Statement used, when applicable
      • The SQL Statement results, when applicable
  • After the first exercise you commit, do a pull request from your master branch. Then, commit and push after each exercise so that we can see your progress.

Exercise 1

  • Import Database Schema from the following source file into decodemtl_addressbook:
    • data/import-table-structure.sql

Exercise 2

  • Insert one row into decodemtl_addressbook.Account
  • Insert one row into decodemtl_addressbook.AddressBook
  • Insert three rows into decodemtl_addressbook.Entry

Exercise 3

  • Retrieve data from the previously inserted decodemtl_addressbook.Account row
  • Retrieve data from the previously inserted decodemtl_addressbook.AddressBook row
  • Retrieve data from the previously inserted decodemtl_addressbook.Entry rows

Exercise 4

  • Modify the decodemtl_addressbook.Account row
  • Modify the decodemtl_addressbook.AddressBook row
  • Modify the three decodemtl_addressbook.Entry rows using one query only

Exercise 5

  • Delete all data from decodemtl_addressbook.Entry without using a DELETE statement

Exercise 6

  • Delete decodemtl_addressbook.Account and all associated date

Exercise 7

  • Import Database Schema from the following source file into decodemtl_addressbook_import:
    • data/import-table-structure.sql
  • Bulk import data from the following source files into decodemtl_addressbook_import:
    • data/import-account.sql
    • data/import-addressbook.sql
    • data/import-entry.sql

Exercise 8

  • What is the email of the Account identified by "63"?
  • What are the names of the AdressBooks belonging to accountId "3"?
  • On which date was the AddressBook titled "Lorem Foundation" created?

Exercise 9

  • How many Accounts exist?
  • How many Address Books exist?
  • How many Address Book Entries exist?

Exercise 10

  • How many Address Book Entries are listed as born before February 12th of 1982?
  • How many Address Book Entries are listed as born on or after January 1st of 1965?
  • Which Address Book Entry is listed as being the oldest of age?

Exercise 11

  • How many Address Book Entries are not listed as other?
  • How many Address Book Entries are listed as either home or work?
  • How many Address Book Entries are listed as phones?

Exercise 12

  • Which Account owns the most Address Books?
  • Which Address Book contains the most Entries?

Exercise 13

  • How many Address Book Entries have phones starting with area code 3XX?
  • How many Address Book Entries have home phones not containing the digit 5?
  • How many Address Book Entries are work phones starting with a country code?

Exercise 14 (Workshop Challenge)

  • Create a data model representing a Store with Inventory, Customers and Invoices
  • This model should provide answers to the following questions:
    • What is the Store's income within a specific date range?
    • What is the Store's top selling Inventory product?
    • Which company produces the top selling Inventory product?
    • What is the top refunded Inventory product?
    • Which products should be taken out from the Store's Inventory?
    • Which companies should the Store stop selling products from?
    • What is the amount of Internal (Canadian) vs. External sales?
    • How many of a specific product remains in Inventory for a specific date?

mysql-workshop-2's People

Contributors

sonia-badeau avatar nyanofthemoon avatar ziad-saab avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.