cM2908/leetcode-sql
关于
Leetcode SQL Solutions
数据与分析实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Leetcode SQL Questions & Solutions

Repository Contains :
(1) All Leetcode SQL Question Solutions
(2) PostgreSQL Dump File (leetcodedb.sql)
Problem statements of all questions including leetcode premium questions :
(1) https://leetcode.ca
(2) https://lifewithdata.com/sql
(3) https://www.jiakaobo.com/leetcode
How to Import dump file using command line terminal?
(1) Open terminal & open psql utility
user@my-machine:~$ psql
(2) Create Database (To import the dump file, database should be created priorly)
postgres=# CREATE DATABASE sample_db;
(3) Quit the psql promt
postgres=# \q
(4) From terminal, Load dump file into the newly created database using below command
user@my-machine:~$ pg_restore --host "127.0.0.1" --port "5432" --username "postgres" --dbname "sample_db" --verbose "leetcodedb.sql"
Replace your configurations(host,port,username) in pg_restore command
How to Import dump file using PgAdmin tool?
(1) Open PgAdmin & Create Database
Servers -> Databases -> Create -> Database.. (Create Database dialog will get opened)
(2) Restore Dump File
Right Click on newly created Database & select Restore option from menu (Restore dialog will get opened)
Just Browse the dump file and keep other options as it is.
Notes :
(1) Do not just copy-paste and run the content of dump file into either "psql promt in terminal" or "query tool of pgadmin".
(Because dump file contains COPY commands not INSERTS,So doing such will cause errors.)
(2) Table names are suffixed with question number.
(3) New solutions will get added as I solve them.
Checkout my another repository which cantains Miscellaneous SQL Questions & Solutions :
https://github.com/cM2908/misc-sql
Checkout my Blogs on interesting SQL topics :
探索相关项目
加载中…