SQL and Databases
This section houses what you need to know about SQL and databases to use the Platform, including, relationships, beginner, intermediate, and advanced SQL, tokens, and more.
MinistryPlatform is built on Microsoft SQL Server (MSSQL), a Relational Database. Although there are other types of databases, the Relational Database Model is a widely used and well-established method to organize and retrieve data.
Best Practices
The following are tried and true techniques to extend MinistryPlatform. The advice here is tailored toward using the Platform and may vary from advice you find elsewhere.
Table & Column Names
- Avoid any names that appear on the Reserved Keywords List for MSSQL.
- Name primary keys with singular name of table plus "_ID".
- Do not use spaces in names. Use an underscore.
Primary Keys
- Name primary keys with singular name of table plus "_ID".
- Use the int data type with IDENTITY specification.
Transact SQL (TSQL)
The variant of SQL used by Microsoft SQL Server is Transact SQL, also referred to as TSQL.
SQL Server (General)
Tips & Tricks
- When searching the web for answers to your SQL questions, include the keyword "mssql" or "tsql" in your search. This helps you get results more specific to Microsoft SQL. There are many other variants (dialects) of SQL.
- The Advanced Search Tool generates an extended form of SQL which uses the Table Lookup Convention. This is an extension to TSQL specifically used by MinistryPlatform. It can be identified by its use of "_Table" added to field names.