What are the possible 'types' available in SQL Server as mentioned in the 'type' column in the sys.master_files view? I'm relatively new to SQL Server, and having a problem with an expanding tempdb database. As such, I'm starting to look just more generally into how database files work.

Looking at this query:

USE master;
SELECT *
FROM sys.master_files mf


I understand looking at the Microsoft documentation that the sys.master_files view keeps track of files related to databases. On my system the 'type' column is only either 0 or 1 - i.e. I only have Log and Row files. But the docs mention types 2 (FILESTREAM), 3 (...), and ,4 (Full text).

Questions:


Would .mdf files always be type 0? It seems this is the file that represents a database; I didn't realize that all database objects would be represented by 'Row'-type files
What is the type FILESTREAM?
How are tables differentiated in files of type Rows?


===== EDIT

Question 1 is a little misleading; the answer mentions that .mdf and other SQL Server file extensions are just SQL Server's default file extensions and that these can be changed. Testing this, it looks like data is written to the files in exactly the same way regardless of file extension.
You shouldn't mix file extensions with file types. You have to differentiate between file extensions and what the files actually contain. 

Create Database (non-standard)

It is possible to create a database that has *.txt as the file extension for the Data files ("ROWS Data" type) which are otherwise created with an *.mdf or *.ndf extension.

It is equally possible to create a database that has a *.txt extension for the TransactionLog file ("Log" type) which is otherwise created with an *.ldf file extension.

Script to create a non-standard database

CREATE DATABASE [File_Types]
    CONTAINMENT = NONE
    ON  PRIMARY 
   ( NAME = N'File_Types', FILENAME = N'C:\SQL\SQL_DATA\File_Types.txt' , SIZE = 5120KB , FILEGROWTH = 1024KB ), -- normally *.mdf
   ( NAME = N'File_Types_01', FILENAME = N'C:\SQL\SQL_DATA\File_Types_01.txt' , SIZE = 5120KB , FILEGROWTH = 1024KB ), -- normally *.ndf
    FILEGROUP [File_Types_FS_FG] CONTAINS FILESTREAM 
   ( NAME = N'File_Types_FS', FILENAME = N'C:\SQL\FILESTREAM\File_Types_FS' ) -- no extension; is a directory where BLOBs are stored
   LOG ON 
   ( NAME = N'File_Types_log', FILENAME = N'C:\SQL\SQL_LOGS\File_Types_Log.txt' , SIZE = 3072KB , FILEGROWTH = 10%) -- normally *.ldf
GO
USE [File_Types]
GO
IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [File_Types] MODIFY FILEGROUP [PRIMARY] DEFAULT
GO


This will create a database with three files which all have the *.txt extension.

Query sys.master_files

SELECT database_id, FILE_ID, TYPE, type_desc, NAME, mf.physical_name
  FROM sys.master_files AS mf WHERE database_id = 13


Output

database_id FILE_ID type_desc   NAME            physical_name  
13          1       ROWS        File_Types      C:\SQL\SQL_DATA\File_Types.txt  
13          2       LOG         File_Types_log  C:\SQL\SQL_LOGS\File_Types_Log.txt  
13          3       ROWS        File_Types_01   C:\SQL\SQL_DATA\File_Types_01.txt  
13      65537   2   FILESTREAM  File_Types_FS   C:\SQL\FILESTREAM\File_Types_FS  


To answer your questions


"DATA Rows" will always be type 1. A file with an *.mdf extension can be of any type.
FILESTREAM integrates the SQL Server Database Engine with an NTFS file system by storing varbinary(max) binary large object (BLOB) data as files on the file system. Transact-SQL statements can insert, update, query, search, and back up FILESTREAM data. Win32 file system interfaces provide streaming access to the data. (see: FILESTREAM Overview)
Tables are stored in pages and extents inside the "Data ROWS" database files. An explanation of how data is stored can be found here: Understanding Pages and Extents and Managing Space Used by Objects.