Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
LeetCode 262
--PostgreSQL 9.6 --'\\' is a delimiter drop table If Exists Trips; drop table If Exists Users_1; create table Trips("id" int, "client_id" int, "driver_id" int, "city_id" int, "status" varchar(30), request_at date); create table Users_1("users_id" int, "banned" varchar(30), "role" varchar(30)); insert into Trips("id", "client_id", "driver_id", "city_id", "status", "request_at") values (1, 1, 10, 1, 'completed', '2013-10-01'), (2, 2, 11, 1, 'cancelled_by_driver', '2013-10-01'), (3, 3, 12, 6, 'completed', '2013-10-01'), (4, 4, 13, 6, 'cancelled_by_client', '2013-10-01'), (5, 1, 10, 1, 'completed', '2013-10-02'), (6, 2, 11, 6, 'completed', '2013-10-02'), (7, 3, 12, 6, 'completed', '2013-10-02'), (8, 2, 12, 12, 'completed', '2013-10-03'), (9, 3, 10, 12, 'completed', '2013-10-03'), (10, 4, 13, 12, 'cancelled_by_driver', '2013-10-03'); insert into Users_1("users_id", "banned", "role") values (1, 'No', 'client'), (2, 'Yes', 'client'), (3, 'No', 'client'), (4, 'No', 'client'), (10, 'No', 'driver'), (11, 'No', 'driver'), (12, 'No', 'driver'), (13, 'No', 'driver');
run
|
edit
|
history
|
help
0
SQL social network practice by Han Wang 20200720
Query workaround in order to avoid IN Operator in WHERE Clause
nested array to table
generate-data-combinations-for-a-column-dynamically-based-on-another-column-sql-postgresql
Christmas Tree Generator
SQL social network practice by Han Wang 20200720 - 2
PC02-DB-UTEC
Shortest "path" between two employees across companies
HW1
SQL - Unpivot Table