Skip to content

Instantly share code, notes, and snippets.

@WesJD
Created June 26, 2018 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WesJD/a5e2ef295ab462d45a0f76f743b7aac4 to your computer and use it in GitHub Desktop.
Save WesJD/a5e2ef295ab462d45a0f76f743b7aac4 to your computer and use it in GitHub Desktop.
MariaDB [(none)]> use michelle;
MariaDB [michelle]> create table items (type VARCHAR(75) NOT NULL, broken BOOL NOT NULL, used BOOL NOT NULL DEFAULT TRUE, got_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, last_used TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);Query OK, 0 rows affected (0.01 sec)
MariaDB [michelle]> DESCRIBE items;
+-----------+-------------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+-------------------+-------+
| type | varchar(75) | NO | | NULL | |
| broken | tinyint(1) | NO | | NULL | |
| used | tinyint(1) | NO | | 1 | |
| got_date | timestamp | NO | | CURRENT_TIMESTAMP | |
| last_used | timestamp | NO | | CURRENT_TIMESTAMP | |
+-----------+-------------+------+-----+-------------------+-------+
5 rows in set (0.00 sec)
MariaDB [michelle]> drop table items;
Query OK, 0 rows affected (0.00 sec)
MariaDB [michelle]> create table items (type VARCHAR(75) NOT NULL, broken BOOL NOT NULL, used BOOL NOT NULL DEFAULT TRUE, got_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, last_used TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (type));
Query OK, 0 rows affected (0.01 sec)
MariaDB [michelle]> DESCRIBE items;
+-----------+-------------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+-------------------+-------+
| type | varchar(75) | NO | PRI | NULL | |
| broken | tinyint(1) | NO | | NULL | |
| used | tinyint(1) | NO | | 1 | |
| got_date | timestamp | NO | | CURRENT_TIMESTAMP | |
| last_used | timestamp | NO | | CURRENT_TIMESTAMP | |
+-----------+-------------+------+-----+-------------------+-------+
5 rows in set (0.01 sec)
MariaDB [michelle]> INSERT INTO items (type) VALUES ("dresser");
Query OK, 1 row affected, 1 warning (0.00 sec)
MariaDB [michelle]> select * from items;
+---------+--------+------+---------------------+---------------------+
| type | broken | used | got_date | last_used |
+---------+--------+------+---------------------+---------------------+
| dresser | 0 | 1 | 2018-06-26 20:38:33 | 2018-06-26 20:38:33 |
+---------+--------+------+---------------------+---------------------+
1 row in set (0.00 sec)
MariaDB [michelle]> INSERT INTO items (type) VALUES ("soap");
Query OK, 1 row affected, 1 warning (0.00 sec)
MariaDB [michelle]> INSERT INTO items (type, broken, used, got_date, last_used) VALUES ("cup", TRUE, TRUE, NOW(), NOW()-INTERVAL 1 WEEK);
Query OK, 1 row affected (0.00 sec)
MariaDB [michelle]> SELECT * FROM items;
+---------+--------+------+---------------------+---------------------+
| type | broken | used | got_date | last_used |
+---------+--------+------+---------------------+---------------------+
| cup | 1 | 1 | 2018-06-26 20:51:51 | 2018-06-19 20:51:51 |
| dresser | 0 | 1 | 2018-06-26 20:38:33 | 2018-06-26 20:38:33 |
| soap | 0 | 1 | 2018-06-26 20:44:46 | 2018-06-26 20:44:46 |
+---------+--------+------+---------------------+---------------------+
3 rows in set (0.00 sec)
MariaDB [michelle]> SELECT type FROM items;
+---------+
| type |
+---------+
| cup |
| dresser |
| soap |
+---------+
3 rows in set (0.00 sec)
MariaDB [michelle]> SELECT type, got_date FROM items;
+---------+---------------------+
| type | got_date |
+---------+---------------------+
| cup | 2018-06-26 20:51:51 |
| dresser | 2018-06-26 20:38:33 |
| soap | 2018-06-26 20:44:46 |
+---------+---------------------+
3 rows in set (0.00 sec)
MariaDB [michelle]>
@wjdmom
Copy link

wjdmom commented Jun 27, 2018

Hi wesley,
i tried to write something but became confused.
Let me know if this makes any sense. It is confusing because the things I want to enter into the table are maybe too unique? Maybe I need a table in a table...I don't know. Here is my attempt:

ok...apparently copy/pasting isn't a thing in git.

@wjdmom
Copy link

wjdmom commented Jul 5, 2018

Column names across the top of the table: task name | task description | sequence | dependency (s) | accountable | target completion date | es | ls | ef | lf
Row names:
List eol services |   |   |   |   |   |   |   |   |  
Complete security assessment for each EOL service |   |   |   |   |   |   |   |   |  
Review LSP |   |   |   |   |   |   |   |   |  
Review Customer Contracts |   |   |   |   |   |   |   |   |  
Communication plan |   |   |   |   |   |   |   |   |  
Stop selling to new customers |   |   |   |   |   |   |   |   |  
Stop selling to existing customers |   |   |   |   |   |   |   |   |  
Move part number to auxiliary list |   |   |   |   |   |   |   |   |  
Remove part number from auxiliary list |   |   |   |   |   |   |   |   |  
Notify customers |   |   |   |   |   |   |   |   |  
Notify Infor |   |   |   |   |   |   |   |   |  
Extended support stops |   |   |   |   |   |   |   |   |  
Premier support stops |   |   |   |   |   |   |   |   |  
Sustaining support ends |   |   |   |   |   |   |   |   |  
Oracle data center stops hosting |   |   |   |   |   |   |   |   |  
R&A Available to all customers |   |   |   |   |   |   |   |   |  

@wjdmom
Copy link

wjdmom commented Jul 5, 2018

here is my attempt...

DESCRIBE michelle's pp1;
INSERT INTO michellepp1 (task name, task description, sequence, dependancy, accountable, target completion, dependancy, es, ls, ef, lf); VALUES (eol services, security assessment, review lsp, review customer contracts, internal cumminicaton plan, customer communication plan, Infor communication plan, stop selling to new customers, stop selling to existing customers, move part number to auxiliary list, remove part number from auxiliary list, extended support stops, premire support stops, sustaining support stops, Oracle data centers stop hosting vision, R&A Available to all customers);
SELECT FROM;

@wjdmom
Copy link

wjdmom commented Jul 5, 2018

The name of the table is Michelle's PP1.
The column names are: task name, task description, sequence, dependancy, accountable, target completion, dependancy, es, ls, ef, lf
The row names are: eol services, security assessment, review lsp, review customer contracts, internal cumminicaton plan, customer communication plan, Infor communication plan, stop selling to new customers, stop selling to existing customers, move part number to auxiliary list, remove part number from auxiliary list, extended support stops, premire support stops, sustaining support stops, Oracle data centers stop hosting vision, R&A Available to all customers
THANK YOU

@wjdmom
Copy link

wjdmom commented Jul 5, 2018

The values I want in each column or the thing I want to add to each column is:
task name is text
task description is text
sequence is a number
dependancy is one or more numbers
accountable is a text box
target completion, es, ls, ef, lf are all dates

@wjdmom
Copy link

wjdmom commented Jul 5, 2018

Thank you for helping me with this. Here is my attempt at three different tables.

DESCRIBE michellepp1;
INSERT INTO michellepp1 (“task name”, “task description”, sequence, dependancy, accountable, “target completion”); VALUES (“Part Number Removed To Auxiliary List”, “Customer Assessments”, “review contracts”, “remediation plan to sales”, “customer communication plan”, “Infor communication plan”, “stop selling”, “extended support ends”, “premire support ends”, “sustaining support ends”, ‘DC ends hosting”, “RA Available to all customers”);

DESCRIBE michellepp1dates
INSERT INTO michellepp1dates (“Task Name”, Accountable, Sequence, dependancy ); VALUES (ES, EF, LS, LF, “Target Completion”);

DESCRIBE michellepp1approvals
INSERT INTO michellepp1dates (“Task Name”, “approval date”); VALUES (VP)

DESCRIBE michellepp1raci
INSERT INTO michellepp1dates (responsible, accountable, consulted, informed); VALUES (“Part Number Removed To Auxiliary List”, “Customer Assessments”, “review contracts”, “remediation plan to sales”, “customer communication plan”, “Infor communication plan”, “stop selling”, “extended support ends”, “premire support ends”, “sustaining support ends”, ‘DC ends hosting”, “RA Available to all customers”, completed);

@wjdmom
Copy link

wjdmom commented Jul 5, 2018

oops-found a mistake. here it is again without the mistake that I found:

DESCRIBE michellepp1;
INSERT INTO michellepp1 (“task name”, “task description”, sequence, dependancy, accountable, “target completion”); VALUES (“Part Number Removed To Auxiliary List”, “Customer Assessments”, “review contracts”, “remediation plan to sales”, “customer communication plan”, “Infor communication plan”, “stop selling”, “extended support ends”, “premire support ends”, “sustaining support ends”, ‘DC ends hosting”, “RA Available to all customers”);

DESCRIBE michellepp1dates
INSERT INTO michellepp1dates (“Task Name”, Accountable, Sequence, dependancy ); VALUES (ES, EF, LS, LF, “Target Completion”);

DESCRIBE michellepp1approvals
INSERT INTO michellepp1dates (“Task Name”, “approval date”); VALUES (“VP name”, “approval date”)

DESCRIBE michellepp1raci
INSERT INTO michellepp1dates (responsible, accountable, consulted, informed); VALUES (“Part Number Removed To Auxiliary List”, “Customer Assessments”, “review contracts”, “remediation plan to sales”, “customer communication plan”, “Infor communication plan”, “stop selling”, “extended support ends”, “premire support ends”, “sustaining support ends”, ‘DC ends hosting”, “RA Available to all customers”, completed);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment