Sep 10: DDL and Constraints
Learning Objectives
After today's class, you should be able to:
- Interpret and write
CREATE TABLEstatements, including column constraints. - Write
INSERT,UPDATE, andDELETEstatements, and predict constraint violations.
Lesson Outline
GitHub [10 min]
- Join the cs374f26 organization – check your inbox
- Windows users: use Git Bash (recommended)
- Tell git who you are – on each machine you use:
git config --global user.name "Your Name"git config --global user.email "username@dukes.jmu.edu" - Use this command to show your configuration:
git config --global --list
Security [20 min]
- SQL Injection
- Demo: hack.py and hack.html
- Input 1:
'; DROP TABLE account; -- - Input 2:
<script>alert("Hi");</script>
- Input 1:
DB Design [45 min]
- SQL Data Definition Language
- New activity about key constraints
Your To-Do List
- Submit the Team Survey on Canvas ← due TODAY
- Submit
hw2.pyon Gradescope ← due Monday