Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Quick changes in the first SQL part: check is actually taken into account! | b62ed769ef0ebd96ea91e3053246e142b73d524c | aubert@math.cnrs.fr | 2019-09-09 16:26:17 |
Added quiz #1 of Fall 2019, plus minor corrections. | a5498523b05cb246ce58b05a8951b833a0b0e699 | aubert@math.cnrs.fr | 2019-08-29 16:23:07 |
Adding a figure for a quizz, and a possible bug to the list. | 6e83297ccb9678296993e605b2f35d0b13a97523 | aubert@math.cnrs.fr | 2019-08-27 16:20:35 |
Changed the monospace font, updated instructions to install mariaDB. | 3dc6162733e0a373205012869c1ee068ef3e5c91 | aubert@math.cnrs.fr | 2019-08-16 18:56:37 |
Few patches to prepare for Fall 2019. | 545561b3d47dfe9bff2436f8f2b7e32572cd808a | aubert@math.cnrs.fr | 2019-08-07 17:12:26 |
Editing the cycle of design picture | 9bd1c3190a71202b88011b831161cf9d6a365237 | aubert@math.cnrs.fr | 2019-08-07 16:13:03 |
Test | c742ba7590d59e2941f9fa197c9d009d5c642e76 | au | 2019-07-31 23:56:14 |
Minor fix in Known bugs and contrib. | 19f3adfa1f88e6d12e94868f4eab0b5838d05eb6 | aubert@math.cnrs.fr | 2019-07-29 20:51:14 |
Commit | 2ed1a8532cbdae46d3feb99cf52f23f2afa144ec | aubert@math.cnrs.fr | 2019-07-29 19:01:36 |
Adding the final to the notes. | 0e8848a3e67ec49bab5b767e25d6099fd218e417 | aubert@math.cnrs.fr | 2019-05-20 14:44:54 |
Added the solution to one of the problem from Exam #2. | 625545a335c5dc7b7303355088a3abba999fdf40 | aubert@math.cnrs.fr | 2019-05-06 16:59:50 |
Added a solution to one of the problem of Exam #2, and added the last quiz. | 4e0ee25d509412e5e455d9ad4c98f7aad8c5a354 | aubert@math.cnrs.fr | 2019-04-19 15:14:10 |
A few glitches in the first java programs patched, added the alternative version to the source. | 48611244d21515269bae041dc2535b7e08fb5877 | aubert@math.cnrs.fr | 2019-04-04 22:05:03 |
patching a few glitches with the java code and the mysql code used in the demo for the first program. | 0fcb73dcc60aef476899c4efea092c99dd6027db | aubert@math.cnrs.fr | 2019-04-04 21:55:55 |
Tidying up a program. | dd409ab3fd6736af4b8adaac284ee101b9770f60 | aubert@math.cnrs.fr | 2019-04-04 19:02:21 |
Correcting the chapter on db programming. | 484c4a6372056106bae77e48b397c1174738fc26 | aubert@math.cnrs.fr | 2019-04-04 18:57:50 |
Added solution to first problem of Exam 2. | 45881a9b8ab1e5a0071b58d72362059593365d52 | aubert@math.cnrs.fr | 2019-04-03 18:38:48 |
Quick note in Java programming. | 625282d4fece1f6a7a617a8c9bcf7c3c856185b3 | aubert@math.cnrs.fr | 2019-04-02 18:42:48 |
Added exam #2 | 0aa6788451b34cb6371fed5a0f719a4ac52cf0c8 | aubert@math.cnrs.fr | 2019-04-01 18:37:43 |
Fixing a typo. | 502262b742ac86d7b3d5e95a0f9fcd7ca3a6e586 | aubert@math.cnrs.fr | 2019-03-22 17:35:43 |
File | Lines added | Lines deleted |
---|---|---|
notes/code/sql/HW_FACULTY.sql | 4 | 0 |
notes/lectures_notes.md | 16 | 3 |
File notes/code/sql/HW_FACULTY.sql changed (mode: 100644) (index 27dd8ad..1769129) | |||
... | ... | CREATE DATABASE HW_FACUTLY; | |
8 | 8 | ||
9 | 9 | CREATE TABLE HW_FACULTY.PROF( | CREATE TABLE HW_FACULTY.PROF( |
10 | 10 | Fname VARCHAR(15), -- No String! | Fname VARCHAR(15), -- No String! |
11 | -- The value "15" vas picked randomly, any value below 255 would | ||
12 | -- more or less do the same. Note that declaring extremely large | ||
13 | -- values without using them can impact the performance of | ||
14 | -- your database, cf. for instance https://dba.stackexchange.com/a/162117/ | ||
11 | 15 | Room INT, -- shorthad for INTEGER, are also available: SMALLINT, FLOAT, REAL, DEC | Room INT, -- shorthad for INTEGER, are also available: SMALLINT, FLOAT, REAL, DEC |
12 | 16 | -- The "REAL" datatype is like the "DOUBLE" datatype of C# (they are actually synonyms in SQL): | -- The "REAL" datatype is like the "DOUBLE" datatype of C# (they are actually synonyms in SQL): |
13 | 17 | -- more precise than the "FLOAT" datatype, but not as exact as the "NUMERIC" datatype. | -- more precise than the "FLOAT" datatype, but not as exact as the "NUMERIC" datatype. |
File notes/lectures_notes.md changed (mode: 100644) (index 75fdc6d..4aee7dc) | |||
... | ... | We know 1. and 2. from the Relational Model, here comes new constraints that can | |
1238 | 1238 | ~~~{.sqlmysql .numberLines} | ~~~{.sqlmysql .numberLines} |
1239 | 1239 | CREATE TABLE HURRICANE( | CREATE TABLE HURRICANE( |
1240 | 1240 | Name VARCHAR(25) PRIMARY KEY, | Name VARCHAR(25) PRIMARY KEY, |
1241 | WindSpeed INT DEFAULT 76, | ||
1241 | WindSpeed INT DEFAULT 76 CHECK (WindSpeed > 74 AND WindSpeed < 500), | ||
1242 | -- 75mph is the minimum to be considered as a hurricane | ||
1243 | -- cf. https://www.hwn.org/resources/bws.html | ||
1242 | 1244 | Above VARCHAR(25) | Above VARCHAR(25) |
1243 | 1245 | ); | ); |
1244 | 1246 | -- WindSpeed INT CHECK (WindSpeed > 74 AND WindSpeed < 500), | -- WindSpeed INT CHECK (WindSpeed > 74 AND WindSpeed < 500), |
1245 | |||
1247 | -- would be parsed but wouldn't have any effect before MariaDB 10.2.1 | ||
1248 | -- https://mariadb.com/kb/en/library/constraint/#check-constraints | ||
1249 | -- Since MariaDB 10.2.1, the CHECK constraint are enforced. | ||
1250 | -- INSERT INTO HURRICANE VULES ("Test", 12, NULL); | ||
1251 | -- would give: | ||
1252 | -- ERROR 4025 (23000): CONSTRAINT `HURRICANE.WindSpeed` failed for `HW_CONSTRAINTS`.`HURRICANE` | ||
1253 | -- Note that you could still insert a value of NULL for the wind, and it would not | ||
1254 | -- triggered the error. | ||
1255 | |||
1256 | -- To use the DEFAULT value, use: | ||
1257 | -- INSERT INTO HURRICANE VALUES ("TestA", DEFAULT, NULL); | ||
1258 | |||
1259 | |||
1246 | 1260 | CREATE TABLE STATE( | CREATE TABLE STATE( |
1247 | 1261 | Name VARCHAR(25) UNIQUE, -- NULL can be inserted | Name VARCHAR(25) UNIQUE, -- NULL can be inserted |
1248 | 1262 | Postal_abbr CHAR(2) NOT NULL | Postal_abbr CHAR(2) NOT NULL |