Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Dashes in numbers
--PostgreSQL 9.6 --'\\' is a delimiter --upc has dashes, the datatype is now a text not numeric --dashes in numbers like phone number use text datatypes CREATE TABLE warehouse( sku CHAR(10) PRIMARY KEY NOT NULL, upc VARCHAR (20) NOT NULL, quantity INT NOT NULL ); --insert records --upc numbers are in single quotes because of the dash INSERT INTO warehouse (sku, upc, quantity) VALUES ('A113M1', '3445-113-545', 540), ('A212M2', '3445-212-454', 230), ('A221NP2', '3445-221-435', 670), ('A332NP2', '3445-332-003', 168), ('A36LIPG', '3445-336-347', 470); --retrieve all records SELECT * FROM warehouse;
run
|
edit
|
history
|
help
0
Sample tables
code1
fgf
podd version
Food Delivery Website SQL Analysis
PostreSQL: Left Join
Attributvariation 2
Assignment 1(SET A)
postgres group by by function
PC02-DB-UTEC