List of commits:
Subject Hash Author Date (UTC)
Fixing few mistakes in code. b7eb7a0e476f8e0c3c6d3e651fd80827a03dd127 aubert@math.cnrs.fr 2020-05-15 17:38:32
Fixing few mistakes in code. 2bc77d7ee4e82e6961ce123fb7c3e1c68cba59b5 aubert@math.cnrs.fr 2020-05-15 17:30:02
Testing and indenting SQL code. a2b3bb4e242dd4980b94b25d11d6001459e2f0a0 aubert@math.cnrs.fr 2020-05-15 17:26:27
Clarified an example. e68bac453ab427c132b55249e21a08166b112f31 aubert@math.cnrs.fr 2020-05-15 15:06:54
Edits in style. 47578b081f74e9ec706772fa70a3079957129542 aubert@math.cnrs.fr 2020-05-15 14:38:16
Added activity diagram. 11c9acfa88c398f7463d6e54f45ea48c8793caf1 aubert@math.cnrs.fr 2020-05-15 14:34:31
Added activity diagram. 995cf4f64c43601716f77bb46d1535025ea14d10 aubert@math.cnrs.fr 2020-05-15 14:33:30
Edits in intro, converted an image to a figure for example of class diagram. 1ff4ef2f7f44ece81972a6c77e9f6654c144fcdc aubert@math.cnrs.fr 2020-05-14 22:12:38
Adding example file, to test installation. 5ed35e64a4e4dc60c888358bde54594999aab34d aubert@math.cnrs.fr 2020-05-13 19:03:41
Minor adjustments to the syllabus. dca6f12d9d3d561755991029f2d53bf9823a8cea aubert@math.cnrs.fr 2020-05-13 19:02:41
Worked on reverse-engineering section. 34aeba178fe553c08b4fb3738523be293704e09d aubert@math.cnrs.fr 2020-05-13 18:52:09
Cleaning images. ac02dcf8ffbbbd24139491e5d1e349ace782401e aubert@math.cnrs.fr 2020-05-13 17:40:43
Started to spell-check… 799dc31237aa41176687f37306ca4092a7760f89 aubert@math.cnrs.fr 2020-05-13 17:17:06
Added foldable toc to readme and co. 07854a4e108c91c55a40fbd10ed84336b885b93f aubert@math.cnrs.fr 2020-05-13 16:51:17
Added final exam. fb37cf99312795016ddbc2e859b055051bcedd13 aubert@math.cnrs.fr 2020-05-08 21:11:57
Refined ccs style + added foldable toc. 95b1663a7b8294dd401d796fb545a67bddba0a01 aubert@math.cnrs.fr 2020-05-07 19:02:27
Refined ccs style + added foldable toc. c208eee4f769e99415efa57a7f03081db87ec3db aubert@math.cnrs.fr 2020-05-07 18:02:53
Fixing indent in xml and notes. ace8f38f8e0374005d143ebaa32d47a209fb5a48 aubert@math.cnrs.fr 2020-04-27 18:42:28
NoSQL application detailled. f2030de09eb58462e04935ec83c71d3c1fc72469 aubert@math.cnrs.fr 2020-04-27 18:28:02
Added automatic anchors. 2ddb93394121bcf95f91bfed8b447966925afa6f aubert@math.cnrs.fr 2020-04-27 05:35:14
Commit b7eb7a0e476f8e0c3c6d3e651fd80827a03dd127 - Fixing few mistakes in code.
Author: aubert@math.cnrs.fr
Author date (UTC): 2020-05-15 17:38
Committer name: aubert@math.cnrs.fr
Committer date (UTC): 2020-05-15 17:38
Parent(s): 2bc77d7ee4e82e6961ce123fb7c3e1c68cba59b5
Signer:
Signing key:
Signing status: N
Tree: 2c4baa11da941e31d543cc4378d6b0f7764b670b
File Lines added Lines deleted
notes/code/sql/HW_DBCoffee.sql 2 2
notes/code/sql/HW_Storm.sql 5 3
notes/code/sql/HW_Train.sql 2 2
notes/code/sql/HW_Work.sql 23 21
File notes/code/sql/HW_DBCoffee.sql changed (mode: 100644) (index d41081b..763ebdd)
... ... INSERT INTO SUPPLY
75 75 VALUES ("Johns & Co.", 121); VALUES ("Johns & Co.", 121);
76 76
77 77 -- The following statement raises an error. -- The following statement raises an error.
78 INSERT INTO SUPPLY
79 VALUES ("Coffee Unl.", 311, 221);
78 ---INSERT INTO SUPPLY
79 -- VALUES ("Coffee Unl.", 311, 221);
80 80 -- ERROR 1136 (21S01): Column count doesn't match value count at row 1 -- ERROR 1136 (21S01): Column count doesn't match value count at row 1
81 81 -- Rest the changes: -- Rest the changes:
82 82 ROLLBACK; ROLLBACK;
File notes/code/sql/HW_Storm.sql changed (mode: 100644) (index 64b7f38..344e10b)
... ... INSERT INTO STORM
36 36 -- The error message returned is -- The error message returned is
37 37 -- ERROR 1292 (22007) at line 34: Incorrect date value: '2017-17-08' for column `HW_STORM`.`STORM`.`Creation` at row 1 -- ERROR 1292 (22007) at line 34: Incorrect date value: '2017-17-08' for column `HW_STORM`.`STORM`.`Creation` at row 1
38 38
39 INSERT INTO STORM
40 VALUES ('Dummy2', 'Hurricane', 120, DATE '2017-17-08');
39 -- In the following, we explicitely use 'DATE', and since the date is incorrect, nothing gets inserted.
40 --INSERT INTO STORM
41 -- VALUES ('Dummy2', 'Hurricane', 120, DATE '2017-17-08');
42 -- ERROR 1525 (HY000) at line 40: Incorrect DATE value: '2017-17-08'
43
41 44
42 45 -- The next one sets NULL for DATE. -- The next one sets NULL for DATE.
43 46 INSERT INTO STORM INSERT INTO STORM
File notes/code/sql/HW_Train.sql changed (mode: 100644) (index a3dfcc0..2f61f24)
... ... DROP TABLE TRAIN, CONDUCTOR, ASSIGNED_TO;
39 39
40 40 -- start snippet solution -- start snippet solution
41 41 -- Question 1: -- Question 1:
42 CREATE TABLE Train (
42 CREATE TABLE TRAIN (
43 43 Id VARCHAR(30) PRIMARY KEY, -- This line was changed. Id VARCHAR(30) PRIMARY KEY, -- This line was changed.
44 44 Model VARCHAR(30), Model VARCHAR(30),
45 45 ConstructionYear YEAR (4) ConstructionYear YEAR (4)
 
... ... FROM
130 130 ASSIGNED_TO ASSIGNED_TO
131 131 WHERE WHERE
132 132 ConductorID = 'GP1029' ConductorID = 'GP1029'
133 AND TrainId = Train.ID;
133 AND TrainId = TRAIN.ID;
134 134 -- end snippet solution -- end snippet solution
File notes/code/sql/HW_Work.sql changed (mode: 100644) (index 040dc20..59685f8)
... ... INSERT INTO EBOOK
82 82 Query OK, 1 row affected (0.003 sec) Query OK, 1 row affected (0.003 sec)
83 83 So, "Successful insertion". So, "Successful insertion".
84 84 */ */
85 INSERT INTO AUTHOR
86 VALUES ("Mary B.", "mb@fai.fr", NULL);
87
88
85 -- The following statement raises an error.
86 --INSERT INTO AUTHOR
87 -- VALUES ("Mary B.", "mb@fai.fr", NULL);
89 88 /* /*
90 89 ERROR 1136 (21S01): Column count doesn't match value count at row 1 ERROR 1136 (21S01): Column count doesn't match value count at row 1
91 90 So, "Other kind of error". So, "Other kind of error".
92 91 */ */
93 INSERT INTO WORK
94 VALUES ("My Life", "Claude A.");
95
96
92 -- The following statement raises an error.
93 --INSERT INTO WORK
94 -- VALUES ("My Life", "Claude A.");
97 95 /* /*
98 96 ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails
99 97 (`HW_EXAM_1`.`WORK`, CONSTRAINT `WORK_ibfk_1` FOREIGN KEY (`Author`) REFERENCES `AUTHOR` (`Name`) (`HW_EXAM_1`.`WORK`, CONSTRAINT `WORK_ibfk_1` FOREIGN KEY (`Author`) REFERENCES `AUTHOR` (`Name`)
 
... ... INSERT INTO BOOK
108 106 Query OK, 1 row affected (0.000 sec) Query OK, 1 row affected (0.000 sec)
109 107 So, "Successful insertion". So, "Successful insertion".
110 108 */ */
111 INSERT INTO AUTHOR
112 VALUES ("Virginia W.", "alt@isp.net");
109
110 -- The following statement raises an error.
111 -- INSERT INTO AUTHOR
112 -- VALUES ("Virginia W.", "alt@isp.net");
113 113
114 114
115 115 /* /*
 
... ... WHERE
153 153 but other rows have been changed as well. but other rows have been changed as well.
154 154 This changed W.1, B.1, E.1. This changed W.1, B.1, E.1.
155 155 */ */
156 DELETE FROM WORK;
157
158
156 -- The following statement raises an error.
157 -- DELETE FROM WORK;
159 158 /* /*
160 159 ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails
161 160 (`HW_EXAM_1`.`BOOK`, CONSTRAINT `BOOK_ibfk_1` FOREIGN KEY (`Work`) REFERENCES `WORK` (`Title`) ON UPDATE CASCADE) (`HW_EXAM_1`.`BOOK`, CONSTRAINT `BOOK_ibfk_1` FOREIGN KEY (`Work`) REFERENCES `WORK` (`Title`) ON UPDATE CASCADE)
162 161 Does not change any row. Does not change any row.
163 162 */ */
164 DELETE FROM AUTHOR
165 WHERE Name = "Virginia W.";
163 -- The following statement raises an error.
164 -- DELETE FROM AUTHOR
165 -- WHERE Name = "Virginia W.";
166 166
167 167
168 168 /* /*
 
... ... WHERE
262 262 Write a command that updates the title of all the pieces of work written by the author whose name is “Virginia W. to”BANNED". Write a command that updates the title of all the pieces of work written by the author whose name is “Virginia W. to”BANNED".
263 263 Is there any reason for this command to be rejected by the system? If yes, explain which one. Is there any reason for this command to be rejected by the system? If yes, explain which one.
264 264 */ */
265 -- The following statement raises an error.
266 /*
265 267 UPDATE UPDATE
266 268 WORK WORK
267 269 SET SET
268 270 Title = "BANNED" Title = "BANNED"
269 271 WHERE WHERE
270 272 Author = "Virginia W."; Author = "Virginia W.";
271
273 */
272 274
273 275 /* /*
274 Does not give an error with the that we currently have.
275 However, since "Title" is the primary key in the WORK table, if Virginia W. had authored two pieces of work or more,
276 then this command would give an error.
276 Gives an error, since "Title" is the primary key in the WORK table, and Virginia W. has authored two pieces of work or more,
277 they are both given the title "BANNED", which violates the unicity of value in primary keys.
277 278 */ */
278 279 -- Write one or multiple commands that would delete the work whose title is “My Life”, as well as all of the books and ebooks versions of it. -- Write one or multiple commands that would delete the work whose title is “My Life”, as well as all of the books and ebooks versions of it.
279 DELETE FROM WORK
280 WHERE Title = "My Life";
280 -- The following statement raises an error.
281 --DELETE FROM WORK
282 --WHERE Title = "My Life";
281 283
282 284
283 285 /* /*
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/caubert/CSCI_3410

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/caubert/CSCI_3410

Clone this repository using git:
git clone git://git.rocketgit.com/user/caubert/CSCI_3410

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main