diff --git a/cst363/.gitignore b/cst363/.gitignore deleted file mode 100644 index b761d5c..0000000 --- a/cst363/.gitignore +++ /dev/null @@ -1 +0,0 @@ -lab/ diff --git a/cst363/lab/patients.sql b/cst363/lab/patients.sql new file mode 100644 index 0000000..f336092 --- /dev/null +++ b/cst363/lab/patients.sql @@ -0,0 +1,16 @@ +drop table if exists patient; + +create table patient ( + patient_no integer primary key, + last_name varchar(64) not null, + first_name varchar(64) not null, + sex varchar(1) not null, + date_of_birth varchar(8) not null, + ward integer not null +); + +insert into patient values(454, "Smith", "John", "M", "14.08.78", 6); +insert into patient values(223, "Jones", "Peter", "M", "07.12.85", 8); +insert into patient values(597, "Brown", "Brenda", "F", "17.06.61", 3); +insert into patient values(234, "Jenkins", "Alan", "M", "29.01.72", 7); +insert into patient values(244, "Wells", "Chris", "F", "25.02.95", 6); diff --git a/cst363/lab/table.pdf b/cst363/lab/table.pdf new file mode 100644 index 0000000..75471c3 Binary files /dev/null and b/cst363/lab/table.pdf differ diff --git a/cst363/lec/lec3.md b/cst363/lec/lec3.md index a16d273..f3bf15a 100644 --- a/cst363/lec/lec3.md +++ b/cst363/lec/lec3.md @@ -3,14 +3,14 @@ ## Relational Algebra and its relation to SQL ### SELECT -Used to select rows from some table. +Used to select columns from some table. > `SELECT [...] FROM [...]` > Relational symbol: sigma ### Projection -Picks out the columns of a (set of) table(s) +Picks out the rows of a (set of) table(s) > `PROJECTION [table...]` diff --git a/cst363/lec/lec4.md b/cst363/lec/lec4.md new file mode 100644 index 0000000..0de839e --- /dev/null +++ b/cst363/lec/lec4.md @@ -0,0 +1,15 @@ +# lec4 + + +## Lab* + +This lecture has some lab questions in the `lec/` dircory named `table1.pdf` *and* some example data called `patients.sql` +Intro to some sql commands + +## Serverless + +Instead of having listen server listen for requests to perform actions upon these requests we simply have some databse held on a machina and we perform all of our sql commands on that machine. + +For now we'll be dealing with small test db's so that we can practice the commands and observe each one's behavior; this will give you a good feeling of what does what in sqlite3. + +