• Stars
    star
    113
  • Rank 301,835 (Top 7 %)
  • Language
  • Created over 6 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Administrative division of Thailand in SQL file format

āļāļēāļ™āļ‚āđ‰āļ­āļĄāļđāļĨ āļˆāļąāļ‡āļŦāļ§āļąāļ” āļ­āļģāđ€āļ āļ­ āļ•āļģāļšāļĨ āļĨāļ°āļ•āļīāļˆāļđāļ” āļĨāļ­āļ‡āļˆāļīāļˆāļđāļ”

āļ‚āđ‰āļ­āļĄāļđāļĨāļˆāļēāļ Open Government Data data.go.th

āļ‚āđ‰āļ­āļĄāļđāļĨāļžāļīāļāļąāļ” LAT/LONG āļ—āļĩāđˆāļ•āļąāđ‰āļ‡āļ•āļģāļšāļĨ

āđ‚āļ”āļĒ

codesanook page

codesanook.com

  • āļ›āļĢāļąāļšāļ›āļĢāļļāļ‡āļ„āļ§āļēāļĄāļ–āļđāļāļ•āđ‰āļ­āļ‡āļ‚āļ­āļ‡āļ‚āđ‰āļ­āļĄāļđāļĨāļ—āļĩāđˆāļ‹āđ‰āļģāļāļąāļ™
  • āļ›āļĢāļąāļšāļ‚āđ‰āļ­āļĄāļđāļĨāđƒāļŦāđ‰āļ­āļĒāļđāđˆāđƒāļ™āļĢāļđāļ›āđāļšāļš relational database
  • āđ€āļžāļīāđˆāļĄ Foreign key
  • Indexing
  • Unique constraint
  • Rename column
  • Surrogate Id

How to use it/āļāļēāļĢāđƒāļŠāđ‰āļ‡āļēāļ™

  • connect to your database
  • execute thai-administrative-division-full-my-sql.sql for MySQL database
  • execute thai-administrative-division-full-sql-server.sql for SQL Server database

database diagram

thai-administrative-division-province-district-subdistrict-sqld-iagram

database dictionary

āļ„āļ§āļēāļĄāļ–āļđāļāļ•āđ‰āļ­āļ‡āļ‚āļ­āļ‡āļ‚āđ‰āļ­āļĄāļđāļĨ

āļāļēāļ™āļ‚āđ‰āļ­āļĄāļđāļĨāļĄāļĩāļˆāļģāļ™āļ§āļ™āļ‚āđ‰āļ­āļĄāļđāļĨāļ”āļąāļ‡āļ™āļĩāđ‰

  • āļˆāļģāļ™āļ§āļ™āļˆāļąāļ‡āļŦāļ§āļąāļ” 77 āļˆāļąāļ‡āļŦāļ§āļąāļ”
  • āļˆāļģāļ™āļ§āļ™āļ­āļģāđ€āļ āļ­ 928 āļ­āļģāđ€āļ āļ­
  • āļˆāļģāļ™āļ§āļ™āļ•āļģāļšāļĨ 7,364 āļ•āļģāļšāļĨ
  • āļˆāļģāļ™āļ§āļ™āđ€āļĨāļ‚āļĢāļŦāļąāļŠāđ„āļ›āļĢāļĐāļ“āļĩāļĒāđŒāļ‚āļ­āļ‡āđāļ•āđˆāļĨāļ°āļ•āļģāļšāļĨ 7,348 āļˆāļģāļ™āļ§āļ™ (āļĄāļĩāļšāļēāļ‡āļ•āļģāļšāļĨāđ„āļĄāđˆāļĄāļĩāļĢāļŦāļąāļŠāđ„āļ›āļĢāļĐāļ“āļĩāļĒāđŒ āļāļēāļ™āļ‚āđ‰āļ­āļĄāļđāļĨāļ‚āļēāļ”āļ‚āđ‰āļ­āļĄāļđāļĨāļŠāđˆāļ§āļ™āļ™āļĩāđ‰āđ„āļ›)

SQL statement to verify number of row

SELECT COUNT(Id) FROM Provinces;
SELECT COUNT(Id) FROM Districts;
SELECT COUNT(Id) FROM Subdistricts;
SELECT COUNT(Id) FROM Subdistricts WHERE ZipCode IS NOT NULL;

āļŦāļēāļāļ‚āđ‰āļ­āļĄāļđāļĨāļŠāđˆāļ§āļ™āđƒāļ”āđ„āļĄāđˆāļ–āļđāļāļ•āđ‰āļ­āļ‡ āļ•āđ‰āļ­āļ‡āļāļēāļĢāđƒāļŦāđ‰āđāļāđ‰āđ„āļ‚ āļŠāļēāļĄāļēāļĢāļ–āļŠāļĢāđ‰āļēāļ‡ PR āļŦāļĢāļ·āļ­āļ•āļīāļ”āļ•āđˆāļ­āļĄāļēāļ—āļĩāđˆ facebook page codesanook.com āđ„āļ”āđ‰āđ€āļĨāļĒāļ„āļĢāļąāļš

codesanook page

codesanook.com

āļ„āļ§āļēāļĄāļ–āļđāļāļ•āđ‰āļ­āļ‡āļ‚āļ­āļ‡āļ‚āđ‰āļ­āļĄāļđāļĨ

  • āļ‚āđ‰āļ­āļĄāļđāļĨāļšāļēāļ‡āļŠāđˆāļ§āļ™āđ„āļĄāđˆāđ„āļ”āđ‰ update āđ€āļ›āđ‡āļ™āļĨāđˆāļēāļŠāļļāļ” āđ€āļŠāđˆāļ™ āļ•āļģāļšāļĨ āļĢāļŦāļąāļŠāđ„āļ›āļĢāļĐāļ“āļĩāļĒāđŒ
  • āļ‚āđ‰āļ­āļĄāļđāļĨāļĨāļ°āļ•āļīāļˆāļđāļ” āļĨāļ­āļ‡āļˆāļīāļˆāļđāļ”āđ„āļĄāđˆāđāļĄāđˆāļ™āļĒāļģāļŠāļģāļŦāļĢāļąāļšāļžāļ·āđ‰āļ™āļ—āļĩāđˆāļ•āļģāļšāļĨāļ—āļĩāđˆāđ€āļ›āđ‡āļ™āđ€āļāļēāļ° āđ€āļžāļĢāļēāļ°āļ•āđ‰āļ­āļ‡āđƒāļŠāđ‰āļ‚āđ‰āļ­āļĄāļđāļĨāļŦāļĨāļēāļĒāļˆāļļāļ” āđ„āļĄāđˆāļŠāļēāļĄāļēāļĢāļ–āđƒāļŠāđ‰āļ‚āđ‰āļ­āļĄāļđāļĨāļˆāļļāļ”āđ€āļ”āļĩāļĒāļ§āđ„āļ”āđ‰ āļˆāļ°āļ›āļĢāļąāļšāļ›āļĢāļļāļ‡āđƒāļ™āļ­āļ™āļēāļ„āļ•
  • āļ„āļ§āļēāļĄāļ–āļđāļāļ•āđ‰āļ­āļ‡āļ‚āļ­āļ‡āļ‚āđ‰āļ­āļĄāļđāļĨāļˆāļ°āđ„āļ”āđ‰āļĢāļąāļšāļāļēāļĢāļ›āļĢāļąāļšāļ›āļĢāļļāļ‡āđ€āļĄāļ·āđˆāļ­āļžāļąāļ’āļ™āļēāđ€āļ›āđ‡āļ™āļĢāļ°āļšāļšāđ€āļ›āđ‡āļ™ web application āļ—āļĩāđˆāļ—āļļāļāļ„āļ™āļŠāļēāļĄāļēāļĢāļ–āđ€āļ‚āđ‰āļēāđ„āļ›āļĢāđˆāļ§āļĄāđāļāđ‰āđ„āļ‚ āđāļĨāļ°āļŠāđˆāļ§āļĒāļāļąāļ™āļ•āļĢāļ§āļˆāļŠāļ­āļšāļ„āļ§āļēāļĄāļ–āļđāļāļ•āđ‰āļ­āļ‡

Credit & Thank you

useful information

index and key naming convention

  • If Index is Primary Clustered Index, use PK_TableName

  • If Index is Non-clustered Index, use IX_TableName_ColumnName1_ColumnName2â€Ķ

  • If Index is Unique Non-clustered Index, use UX_TableName_ColumnName1_ColumnName2â€Ķ (unique key should be index)

  • If Foreign key : FK_TableName_ColumnName1_ColumnName2â€Ķ (Use IX.. if you want to create index for this foreign key)

  • credit https://blog.sqlauthority.com/2012/05/21/sql-server-renaming-index-index-naming-conventions/

TO DO

  • SQL script for SQL server
  • SQL script for MySQL
  • zip code
  • CodeSanook Module
  • allow to edit correctness/approve
  • Export to multiple types of RDMS with NHibernate e.g.
  • SQL Server
  • MySQL
  • Oracle
  • SQLite
  • SQL Server Compact
  • PostgreSQL

More Repositories

1

codesanook-examples

programming language examples for codesanook.com blog
TSQL
36
star
2

codesanook-ef-note

Demo app for EF course
C#
9
star
3

sanook-meetup-001

CodeSanook Meetup #001 - Workshop: React, TypeScript and VS Code.
TypeScript
6
star
4

my-company-wiki

A simple Gatsby wiki with GitHub Actions, Azure App Service container and Google authentication (log in with Gmail)
TypeScript
5
star
5

codesanook-meetup

Slides and source code from Codesanook meetup since the beginning
5
star
6

LearnLog4Net

This project is designed to help people who what to learn logging log4net for debugging and monitoring system.
PHP
4
star
7

Codesanook.SqlGenerator

C# console app to generate SQL insert statement, export insert statement tool
C#
4
star
8

Codesanook.ThailandAdministrativeDivisionTool-Backup

Thailand administrative division province district subdistrict export tool
TypeScript
4
star
9

OrchardCore.EF

Enable EF Core for OrchardCore project
C#
3
star
10

sql-server-linux-docker

sql-server-linux-docker
C#
3
star
11

Codesanook.CollaborativeLocalization

A command line to create Google Sheet for creating localization file, supported language to each sheet and export to JSON
C#
3
star
12

Codesanook.EFNote.Finished

Just another web-based note app implemented by Entity Framework and C#
C#
2
star
13

codesanook-sql-server-replication-setup-script

example scripts to create SQL Server replication
TSQL
2
star
14

Codesanook.CultureSwitcher

A language switcher for Orchard CMS
C#
2
star
15

LearnOpenGL

A repository to learn OpenGL
C++
2
star
16

spring-clinic

simple clinic software project with Spring Boot
Java
2
star
17

CodesanookTheme

Orchard Theme for codesanook.com
HTML
2
star
18

VisualGit

Cross-platform GUI for Git written in C++ using wxWidgets.
2
star
19

codesanook-react-map

A simple React component to render OpenStreetMap
TypeScript
2
star
20

codesanook-java-edition

Free open source Java web project used for codesanook.com
JavaScript
2
star
21

spring-boot-i18n

i18n internationalization spring boot project example
Java
2
star
22

CoreMvcAppService

A simple project to deploy ASP.NET Core MVC
HTML
2
star
23

Codesanook.ReactServerSideRendering

ReactJS example project
C#
2
star
24

codesanook-fb-comments-reader

Read all comments of given post's permalink.
JavaScript
2
star
25

Codesanook.Swagger

Orchard CMS module integrated with Swagger to auto generate JSON REST API doc
JavaScript
1
star
26

orchard-examples

Code example for OrchardCore project
C#
1
star
27

Codesanook.FacebookConnect

Orchard module for login with Facebook
C#
1
star
28

Codesanook.Mobile

example code of ionic1, AngularJS, TypeScript and ES6 module system
JavaScript
1
star
29

codesanook-bumblebee-ts

A browser test page object inspired by .NET Bumblebee
TypeScript
1
star
30

Codesanook.LearningEnglish

An Orchard module for learning English
C#
1
star
31

palm-account

A oil palm accounting program to collect revenue and expense from selling oil palm. It uses Terminal.Gui.
1
star
32

Codesanook.AdministrativeDivision

administrative division of Thailand that consists of province, district and subdistrict, orchard module
TSQL
1
star
33

CodeSanook.LINQtoEF101

Entity Framework mapping and LINQ to EF that use StackOverflow database
C#
1
star
34

Codesanook.FacebookWinForm

Code example for using Facebook Graph API with Windows Form application C#
C#
1
star
35

Codesanook.DDNSUpdateClient

A dynamic DNS update client, get public IP from router and update it to noip.com
TypeScript
1
star
36

CodeCampServer

Clone of CodeCampServer CodeCampServer, a free and open source Code Camp management web application from Codeplex
HTML
1
star
37

Codesanook.AmazonS3

Orchard module to upload files to AWS S3 service
C#
1
star
38

nucksoo.js

Yet another JavaScript library
1
star
39

NetduinoRealTimeClockDS1307

An example of using a real time clock DS1307 with Netduino and C#
C#
1
star
40

thailand-regional-projects

āļĢāļ§āļĄ project open source āļ•āđˆāļēāļ‡āđ† āļ—āļĩāđˆāđ€āļāļĩāđˆāļĒāļ§āļ‚āļ­āļ‡āļāļąāļšāļ›āļĢāļ°āđ€āļ—āļĻāđ„āļ—āļĒ āļ āļēāļĐāļēāđ„āļ—āļĒ
1
star
41

ShareYoutubeOnFacebook

Code example to share a Youtube video on facebook
JavaScript
1
star