Exercise 39. Creating with SQL
When we talk about the acronym CRUD, the “C” stands for “create,” and it doesn’t just mean creating tables. It also means inserting data into the tables and using tables and inserts to link tables. Since we need some tables and some data to do the rest of CRUD (read, update, and delete) we’ll start with learning how to do the most basic creation operations in SQL.
Creating Tables
In the introduction in Exercise 38, I said that you can do CRUD operations to the data inside tables. How do you make the tables in the first place? By doing CRUD on the database schema, and the first SQL statement to learn is CREATE
:
ex1.sql
1 CREATE TABLE person ( 2 id INTEGER PRIMARY KEY, 3 first_name ...
Get Learn More Python 3 the Hard Way: The Next Step for New Python Programmers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.