List of commits:
Subject Hash Author Date (UTC)
Adding some minor SQL remarks + code for HW_FACULTY. 1d1b74302d29fb63c3c2bacca30533283f720997 aubert@math.cnrs.fr 2019-01-25 17:24:16
fixing small typo. 0feeb8df61e05d6d0990120628303cf31108f100 aubert@math.cnrs.fr 2019-01-22 18:23:34
Quick fix + adding macOS install instructions. ea3063e4e9225c8ce66838c8bfddb9a34aadacf8 aubert@math.cnrs.fr 2019-01-16 15:59:38
Fixing a few typos and adding a drawing. b335800d4129c8e29763a6c1d564243d485fa51b aubert@math.cnrs.fr 2019-01-15 19:03:38
Fixing first homework 3eeb05a78235274a330c780f4f26b5fed1a01aef aubert@math.cnrs.fr 2019-01-08 19:50:29
Added content of various exam, fixed intro, added references, solutions, fixed types. a8e9d2d4856133d68d882403cde42dfcc2f5cc69 aubert@math.cnrs.fr 2019-01-07 16:47:02
Cleaning files and makefile 7605a6530505ad69042413dd995d77f1814c2f30 au 2018-12-24 14:25:31
Fixed margin for PDF, added a couple of SVG images, fixed some problems, added some code. eb83d9f07d738df7ab2515b768d6165a3b7e5ca3 au 2018-12-24 02:28:36
Working on rel_mod for Prof_Department_Extended. 2b1eff83797fbda620189f014043d648c884e887 au 2018-12-23 22:38:07
Working on FD and various figures. 8fd7f8322e70ae252596aa9cb88918ac40d5aa84 au 2018-12-23 20:25:19
Added first drawing for fd. 2a0e4fc716d91c23c81346a0e3b568f7132284c9 au 2018-12-23 05:23:29
Cleaned latex code. 1cf04e85915d24fc0208b407eb0166803b2369cf au 2018-12-23 04:27:41
Working on drawing for functional dependencies. 7dc167021630c00be25881877c0921adbc87f482 au 2018-12-23 04:20:33
Working on style for functional dependencies graph. 029c32395ba1110ad2af980e248848e0877040d7 au 2018-12-23 00:17:54
Working on template for FD. 091bb061b6fea06f440e97a4c9ac0f69b4ea1392 au 2018-12-22 20:57:00
Started to work on Functional Dep. 2123fbafc3b8258184ad745d8f23521a3f477d0e au 2018-12-22 18:53:20
Fixing a couple of problem, adding some more correct figures. ef44b65f45fba2bd9a653b639287d872b9f7471d au 2018-12-22 04:27:34
Fixing two figures, and renaming them. 71f4ab9c4090e97da19089f2316e87a4ebe838d6 au 2018-12-22 02:37:15
Fixing some of the name of the problems + references. 67c6c669fbb952cdd92be94487f46774da086a59 au 2018-12-21 16:20:08
Exercises fix, naming problems. 2b00c9f2306dd4d05f6919b4c06bc61b5786917f au 2018-12-21 02:10:54
Commit 1d1b74302d29fb63c3c2bacca30533283f720997 - Adding some minor SQL remarks + code for HW_FACULTY.
Author: aubert@math.cnrs.fr
Author date (UTC): 2019-01-25 17:24
Committer name: aubert@math.cnrs.fr
Committer date (UTC): 2019-01-25 17:24
Parent(s): 0feeb8df61e05d6d0990120628303cf31108f100
Signer:
Signing key:
Signing status: N
Tree: 65494aa53e715380a0cf26b1fa274a7c92179a92
File Lines added Lines deleted
notes/code/sql/HW_FACULTY.sql 38 0
notes/lectures_notes.md 19 40
File notes/code/sql/HW_FACULTY.sql added (mode: 100644) (index 0000000..81becd9)
1 /* code/sql/HW_FACULTY.sql */
2
3 CREATE SCHEMA HW_FACULTY;
4
5 /* Or
6 CREATE DATABASE HW_FACUTLY;
7 */
8
9 CREATE TABLE HW_FACULTY.PROF(
10 Fname VARCHAR(15), -- No String!
11 Room INT, -- shorthad for INTEGER, are also available: SMALLINT, FLOAT, REAL, DEC
12 Title CHAR(3), -- fixed-length string, padded with blanks if needed
13 Tenured BIT(1),
14 Nice BOOLEAN, -- True / False (= 0) / Unknown
15 Hiring DATE,
16 Last_seen TIME,
17 FavoriteFruit ENUM('apple','orange','pear'),
18 PRIMARY KEY(Fname, Hiring)
19 );
20
21 /* Or, instead of using the fully qualified name HW_FACULTY.PROF, we could have:
22 USE HW_FACULTY;
23 CREATE TABLE PROF(…)
24 */
25
26 USE HW_FACULTY;
27
28 INSERT INTO PROF VALUES (
29 "Clément" -- Or 'Clément', but ' " ' and "'" are neat!
30 , 290
31 , 'PhD'
32 , 0
33 , NULL
34 , '19940101' -- Or '940101', '1994-01-01', '94/01/01'
35 , '090500' -- Or '09:05:00', '9:05:0', '9:5:0', '090500'
36 -- Note also the existence of DATETIME, with 'YYYY-MM-DD HH:MM:SS'
37 , 'apple'
38 );
File notes/lectures_notes.md changed (mode: 100644) (index 289f2c1..6f4fa83)
... ... Type and domains are two different things in some implementations, cf. for insta
981 981
982 982 ## First Commands ## First Commands
983 983
984 ~~~{.sqlmysql .numberLines}
985 CREATE SCHEMA HW_FACULTY;
986
987 /* Or
988 CREATE DATABASE HW_FACUTLY;
989 */
990
991 CREATE TABLE HW_FACULTY.PROF(
992 Fname VARCHAR(15), -- No String!
993 Room INT, -- shorthad for INTEGER, are also available: SMALLINT, FLOAT, REAL, DEC
994 Title CHAR(3), -- fixed-length string, padded with blanks if needed
995 Tenured BIT(1),
996 Nice BOOLEAN, -- True / False (= 0) / Unknown
997 Hiring DATE,
998 Last_seen TIME,
999 FavoriteFruit ENUM('apple','orange','pear'),
1000 PRIMARY KEY(Fname, Hiring)
1001 );
1002
1003 /* Or, instead of using the fully qualified name HW_FACULTY.PROF, we could have:
1004 USE HW_FACULTY;
1005 CREATE TABLE PROF(…)
1006 */
984 ```{.sqlmysql .numberLines include=code/sql/HW_FACULTY.sql}
985 ```
1007 986
1008 USE HW_FACULTY;
1009
1010 INSERT INTO PROF VALUES (
1011 "Clément" -- Or 'Clément', but ' " ' and "'" are neat!
1012 , 290
1013 , 'PhD'
1014 , 0
1015 , NULL
1016 , '19940101' -- Or '940101', '1994-01-01', '94/01/01'
1017 , '090500' -- Or '09:05:00', '9:05:0', '9:5:0', '090500'
1018 -- Note also the existence of DATETIME, with 'YYYY-MM-DD HH:MM:SS'
1019 , 'apple'
1020 );
1021 ~~~
1022 987
1023 988 The following commands are particularly useful: The following commands are particularly useful:
1024 989
1025 ~~~{.sqlmysql .numberLines}
990 ~~~{.sqlmysql}
1026 991 SHOW SCHEMAS; -- List the schema SHOW SCHEMAS; -- List the schema
1027 992 SHOW TABLES; -- List the tables in a schema SHOW TABLES; -- List the tables in a schema
1028 993 DESCRIBE <TableName>; -- Show the structure of a table DESCRIBE <TableName>; -- Show the structure of a table
1029 994 SELECT * FROM <TableName> -- List all the rows in a table SELECT * FROM <TableName> -- List all the rows in a table
1030
1031 995 DROP TABLE <TableName>; -- "Drop" (erase) a table DROP TABLE <TableName>; -- "Drop" (erase) a table
1032 996 DROP SCHEMA <SchemaName>; -- Drop a schema DROP SCHEMA <SchemaName>; -- Drop a schema
997 ~~~
1033 998
999 <!--
1034 1000 DESCRIBE <SQL command>; -- Gives explanations as to how the SQL command is processed DESCRIBE <SQL command>; -- Gives explanations as to how the SQL command is processed
1035 ~~~
1001 -->
1036 1002
1037 1003 --- ---
1038 1004
 
... ... ERROR 1045 (28000): Access denied for user 'testuser'@'localhost' (using passwor
1973 1939 then you probably typed the wrong password. then you probably typed the wrong password.
1974 1940 Otherwise, you should see a welcoming message from MySQL or MariaDB and a prompt. Otherwise, you should see a welcoming message from MySQL or MariaDB and a prompt.
1975 1941
1942 To save yourself the hassle of typing the password, you can use
1943
1944 ~~~{.bash}
1945 mysql -u testuser -ppassword
1946 ~~~
1947
1948 or
1949
1950 ~~~{.bash}
1951 mysql -u testuser -p --password=password
1952 ~~~
1953
1954
1976 1955 If at some point you want to know if you are logged as root or testuser, simply enter If at some point you want to know if you are logged as root or testuser, simply enter
1977 1956
1978 1957 ~~~{.sqlmysql} ~~~{.sqlmysql}
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