Using SQL and databases in Tcl
It would be hard to talk about data storage and not mention relational databases. In this section, we will briefly review how Tcl interacts with different databases. We assume the reader is familiar with database concepts and SQL. If not, you can either skip this section, or learn about the topic from other sources first.
For demonstration purposes, in every database described, we will setup a database named Bookstore with the following tables and sample data:
CREATE DATABASE Bookstore CREATE TABLE Books ( title varchar(255), isbn varchar(255), PRIMARY KEY (isbn) ); CREATE TABLE Persons ( name varchar(255), surname varchar(255), CONSTRAINT pk PRIMARY KEY (name, surname) ); CREATE TABLE Authors ( book_id varchar(255), name varchar(255), surname varchar(255), FOREIGN KEY (book_id) REFERENCES Books(isbn), FOREIGN KEY (name, surname) REFERENCES Persons(name, surname) ); INSERT INTO Persons VALUES ('Piotr','Beltowski'); INSERT INTO Persons VALUES ('Wojciech','Kocjan...