Get the date seven days after the payment date.
mysql>
mysql> CREATE TABLE PENALTIES(
-> PAYMENTNO INTEGER NOT NULL,
-> PLAYERNO INTEGER NOT NULL,
-> PAYMENT_DATE DATE NOT NULL,
-> AMOUNT DECIMAL(7,2) NOT NULL,
-> PRIMARY KEY (PAYMENTNO)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> INSERT INTO PENALTIES VALUES (1, 6, '1980-12-08', 100);
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO PENALTIES VALUES (2, 44, '1981-05-05', 75);
Query OK, 1 row affected (0.00 sec)
mysql>
mysql>
mysql> SELECT PAYMENTNO, PAYMENT_DATE, PAYMENT_DATE + INTERVAL 7 DAY
-> FROM PENALTIES
-> WHERE PAYMENTNO > 5;
Empty set (0.00 sec)
mysql>
mysql> drop table PENALTIES;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category