BlockchainSQL.io runs your SQL queries over the Bitcoin blockchain.

Type your query above and click the Execute button.

Load template queries from the drop down list.

Save your query for future reference.

Table Name Column Name Column Position Column Type Primary Key Unique Indexed Nullable Foreign Key
AddressType ID 1 SMALLINT Y Y Y
AddressType Name 2 VARCHAR
AddressType Description 3 NVARCHAR Y
Block ID 1 INT Y Y Y
Block Height 2 INT Y Y
Block PreviousBlockHash 3 BINARY
Block Hash 4 BINARY Y
Block BranchID 5 INT Y
Block Size 6 BIGINT
Block Nonce 7 BIGINT
Block TimeStampUnix 8 BIGINT
Block TimeStampUtc 9 DATETIME2
Block MerkleRoot 10 BINARY
Block Bits 11 BIGINT
Block Difficulty 12 REAL Y
Block Version 13 INT
Block TransactionCount 14 BIGINT
Block OutputsBTC 15 DECIMAL Y
Block RewardBTC 16 DECIMAL
Block FeesBTC 17 DECIMAL Y
Block RowState 18 SMALLINT
Branch ID 1 INT Y Y Y
Branch ForkHeight 2 INT
Branch TimeStampUnix 3 BIGINT
Branch TimeStampUtc 4 DATETIME2
Branch ParentBranchID 5 INT Y Branch.ID
Branch RowState 6 SMALLINT
OpCode Name 2 VARCHAR
OpCode Description 3 NVARCHAR Y
Script ID 1 BIGINT Y Y Y
Script ScriptType 2 SMALLINT
Script ScriptClass 3 SMALLINT
Script ScriptByteLength 4 INT Y
Script InstructionCount 5 INT
Script RowState 6 SMALLINT
ScriptClass ID 1 SMALLINT Y Y Y
ScriptClass Name 2 VARCHAR
ScriptClass Description 3 NVARCHAR Y
ScriptInstruction ID 1 BIGINT Y Y Y
ScriptInstruction ScriptID 2 BIGINT Y Script.ID
ScriptInstruction OpCode 3 SMALLINT
ScriptInstruction Index 4 INT Y
ScriptInstruction Valid 5 BIT
ScriptInstruction DataLE 6 VARBINARY Y
ScriptInstruction RowState 7 SMALLINT
ScriptType ID 1 SMALLINT Y Y Y
ScriptType Name 2 VARCHAR
ScriptType Description 3 NVARCHAR Y
sysdiagrams name 1 SYSNAME Y Y
sysdiagrams principal_id 2 INT Y Y
sysdiagrams diagram_id 3 INT Y Y Y
sysdiagrams version 4 INT Y
sysdiagrams definition 5 VARBINARY Y
Text ID 1 INT Y Y Y
Text Name 2 NVARCHAR Y Y
Text en 3 NVARCHAR Y
Text es 4 NVARCHAR Y
Text pt 5 NVARCHAR Y
Text zh 6 NVARCHAR Y
Text ar 7 NVARCHAR Y
Text ru 8 NVARCHAR Y
Text fr 9 NVARCHAR Y
Text mn 10 NVARCHAR Y
Text System 11 BIT
Transaction ID 1 BIGINT Y Y Y
Transaction BlockID 2 INT Y Block.ID
Transaction Index 3 BIGINT
Transaction TXID 4 BINARY Y
Transaction WTXID 5 BINARY
Transaction Size 6 BIGINT
Transaction InputCount 7 BIGINT
Transaction OutputCount 8 BIGINT
Transaction InputsBTC 9 DECIMAL Y
Transaction OutputsBTC 10 DECIMAL Y
Transaction FeeBTC 11 DECIMAL Y
Transaction LockTime 12 BIGINT
Transaction Version 13 INT
Transaction RowState 14 SMALLINT
TransactionInput ID 1 BIGINT Y Y Y
TransactionInput TransactionID 2 BIGINT Y Transaction.ID
TransactionInput Index 3 BIGINT
TransactionInput ScriptID 4 BIGINT Y Script.ID
TransactionInput WitScriptID 5 BIGINT Y Script.ID
TransactionInput OutpointTXID 6 BINARY
TransactionInput OutpointIndex 7 BIGINT
TransactionInput TransactionOutputID 8 BIGINT Y Y TransactionOutput.ID
TransactionInput Value 9 BIGINT Y
TransactionInput Sequence 10 BIGINT
TransactionInput RowState 11 SMALLINT
TransactionOutput ID 1 BIGINT Y Y Y
TransactionOutput TransactionID 2 BIGINT Y Transaction.ID
TransactionOutput Index 3 BIGINT
TransactionOutput ToAddressType 4 SMALLINT
TransactionOutput ToAddress 5 VARCHAR Y Y
TransactionOutput Value 6 BIGINT
TransactionOutput ScriptID 7 BIGINT Y Script.ID
TransactionOutput RowState 8 SMALLINT


Social Media