If you only have the data file for a database, it is possible to attach it with the “ATTACH_REBUILD_LOG” option which will create a log file.
I found this was a necessary method when attempting to install the AdventureWorks databases for SQL 2012. The .mdf files can be downloaded from the CodePlex site, but no log files are given.
CREATE DATABASE AdventureWorks2012
ON (FILENAME = 'C:\Paul\Sql\Data\AdventureWorks2012_Data.mdf')
CREATE DATABASE AdventureWorksDW2012
ON (FILENAME = 'C:\Paul\Sql\Data\AdventureWorksDW2012_Data.mdf')
Thanks to Dave Lassiter for this tip.