Skip to content

Instantly share code, notes, and snippets.

@jpuck
Created November 29, 2017 22:56
Show Gist options
  • Save jpuck/5fee74175c0407d898770cad405a1f3e to your computer and use it in GitHub Desktop.
Save jpuck/5fee74175c0407d898770cad405a1f3e to your computer and use it in GitHub Desktop.

Entertainment Store

DDL

  • Load Customers table
  • Load Items table
    • drop times rented
    • drop quantity
  • Checkout table
    • Drop total
    • Date_Out DATETIME NOT NULL DEFAULT GETDATE()

VB

  • Shows list of all Items
    • textbox for customer ID
    • button for "Check Out"
      • INSERT INTO checkouts (customer_id, item_id) VALUES (textBoxCustID.Text, getDataGridViewItems.CurrentRow().id)
  • Shows a list of all checked out items
    • SELECT * FROM checkouts ch JOIN customers cu ON ch.cust_id = cu.id JOIN items i ON ch.item_id = i.id WHERE check_in IS null
    • Button for check_in UPDATE checkouts SET check_in = GETDATE() WHERE id = getDataGridViewCheckedOutItems.CurrentRow().id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment