In the wp_options table there is a record where option_name = "permalink_structure".
<a href="<?php the_permalink(); ?>">permalink</a>