- CREATE TABLE comments (
- content VARCHAR(100),
- created_at TIMESTAMP DEFAULT NOW()
- );
- INSERT INTO comments (content) VALUES('lol what a funny article');
- INSERT INTO comments (content) VALUES('I found this offensive');
- INSERT INTO comments (content) VALUES('Ifasfsadfsadfsad');
- SELECT * FROM comments ORDER BY created_at DESC;
- CREATE TABLE comments2 (
- content VARCHAR(100),
- changed_at TIMESTAMP DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP
- );
- INSERT INTO comments2 (content) VALUES('dasdasdasd');
- INSERT INTO comments2 (content) VALUES('lololololo');
- INSERT INTO comments2 (content) VALUES('I LIKE CATS AND DOGS');
- UPDATE comments2 SET content='THIS IS NOT GIBBERISH' WHERE content='dasdasdasd';
- SELECT * FROM comments2;
- SELECT * FROM comments2 ORDER BY changed_at;
- CREATE TABLE comments2 (
- content VARCHAR(100),
- changed_at TIMESTAMP DEFAULT NOW() ON UPDATE NOW()
- );
Saturday, February 22, 2020
TimeStamps
Subscribe to:
Post Comments (Atom)
Right Joins
-- OUR FIRST RIGHT JOIN (seems the same as a left join?) SELECT * FROM customers RIGHT JOIN orders ON customers.id = orders.custom...
-
CREATE TABLE comments ( content VARCHAR ( 100 ), created_at TIMESTAMP DEFAULT NOW () ); INSERT INTO comments ( content ) V...
-
CODE: Setting Default Values Define a table with a DEFAULT name specified: CREATE TABLE cats3 ( name VARCHAR ( 20 ) DEFAUL...
-
SELECT author_fname , author_lname FROM books ; CONCAT ( x , y , z ) // from slides CONCAT ( column , anotherColumn ) // from ...
No comments:
Post a Comment