Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PostgreSQL Sandbox: Legitimate Resale
--PostgreSQL 9.5 --'\\' is a delimiter CREATE TABLE legitimate_resale(UPC INTEGER, item VARCHAR, in_stock INTEGER, price INTEGER, ship_day DATE, hazard_class VARCHAR)\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (101, 'generator', 16, 5999, '12-1-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (102, 'mini generator', 25, 3000, '12-1-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (991, 'toy robot', 1, 99000, '12-28-2065', 'banned')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (204, 'blank tape', 93, 5999, '12-31-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (303, 'irradiator', 4, 3000, '1-2-2066', 'restricted')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (321, 'irradiator gamma', 1, 99000, '12-25-2065', 'banned')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (201, 'A WasteLand Pocket Guide', 2, 5999, '12-28-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (301, 'gas mask', 17, 3000, '12-19-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (302, 'sunshades', 17, 3000, '12-19-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (212, 'fingerprinting kit', 1, 99000, '12-4-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (401, 'guppy', 31, 100, '12-16-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (405, 'mutant guppy', 3, 1000, '12-6-2065', 'restricted')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (404, 'guppy food', 28, 299, '12-6-2065', 'neutral')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (107, 'powdered rations', 56, 1349, '1-3-2066', 'restricted')\\ INSERT INTO legitimate_resale (UPC, item, in_stock, price, ship_day, hazard_class) VALUES (999, 'extra life', 1, 10000, '1-6-2066', 'neutral')\\ SELECT * from legitimate_resale\\ CREATE TABLE report_breakin (UPC INTEGER, units_stolen INTEGER, unit_value INTEGER)\\ INSERT INTO report_breakin (UPC, units_stolen, unit_value) VALUES (101, 4, 5999)\\ INSERT INTO report_breakin (UPC, units_stolen, unit_value) VALUES (991, 1, 99000)\\ INSERT INTO report_breakin (UPC, units_stolen, unit_value) VALUES (401, 2, 100)\\ INSERT INTO report_breakin (UPC, units_stolen, unit_value) VALUES (404, 1, 299)\\ INSERT INTO report_breakin (UPC, units_stolen, unit_value) VALUES (107, 16, 1349)\\ SELECT * from report_breakin\\
run
|
edit
|
history
|
help
0
Persy_Jackson
2
to_char(now(), 'YYYYddd')
postgresql
Atuação
Tememons Dashboard
Select rows only with values separated by a given interval from other ...
1
Postgres Trigger
Query integer in text field - Seemingly doesn't work as expected