O'Reilly logo

Learn More Python 3 the Hard Way: The Next Step for New Python Programmers by Zed A. Shaw

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required