<p>Hopefully, I can get answers for each database server.</p>

<p>For an outline of how indexing works check out: <a href="https://stackoverflow.com/questions/1108/how-does-database-indexing-work">How does database indexing work?</a></p>

[{'answer_id': 1157, 'author': 'John Downey', 'author_id': 200, 'author_profile': 'https://Stackoverflow.com/users/200', 'pm_score': 7, 'selected': True, 'text': '<p>The following is SQL92 standard so should be supported by the majority of RDMBS that use SQL:</p>\n\n<pre><code>CREATE INDEX [index name] ON [table name] ( [column name] )\n</code></pre>\n'}, {'answer_id': 9853, 'author': 'Eric Z Beard', 'author_id': 1219, 'author_profile': 'https://Stackoverflow.com/users/1219', 'pm_score': 3, 'selected': False, 'text': "<p><code>Sql Server 2005</code> gives you the ability to specify a covering index.  This is an index that includes data from other columns at the leaf level, so you don't have to go back to the table to get columns that aren't included in the index keys.</p>\n\n<pre><code>create nonclustered index my_idx on my_table (my_col1 asc, my_col2 asc) include (my_col3);\n</code></pre>\n\n<p>This is invaluable for a query that has <code>my_col3</code> in the select list, and <code>my_col1</code> and <code>my_col2</code> in the where clause.</p>\n"}, {'answer_id': 8973833, 'author': 'tdc', 'author_id': 1038264, 'author_profile': 'https://Stackoverflow.com/users/1038264', 'pm_score': 2, 'selected': False, 'text': "<p>For python pytables, indexes don't have names and they are bound to single columns:</p>\n\n<pre><code>tables.columns.column_name.createIndex()\n</code></pre>\n"}, {'answer_id': 11055918, 'author': 'David Manheim', 'author_id': 1132642, 'author_profile': 'https://Stackoverflow.com/users/1132642', 'pm_score': 2, 'selected': False, 'text': '<p>In SQL Server, you can do the following: (<a href="http://msdn.microsoft.com/en-us/library/ms188783.aspx" rel="nofollow">MSDN Link</a> to full list of options.)</p>\n\n<pre><code>CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name \n    ON &lt;object&gt; ( column [ ASC | DESC ] [ ,...n ] ) \n    [ INCLUDE ( column_name [ ,...n ] ) ]\n    [ WHERE &lt;filter_predicate&gt; ]\n</code></pre>\n\n<p>(ignoring some more advanced options...)</p>\n\n<p>The name of each Index must be unique database wide.</p>\n\n<p>All indexes can have multiple columns, and each column can be ordered in whatever order you want.</p>\n\n<p>Clustered indexes are unique - one per table. They can\'t have <code>INCLUDE</code>d columns.</p>\n\n<p>Nonclustered indexes are not unique, and can have up to 999 per table. They can have included columns, and where clauses.</p>\n'}, {'answer_id': 30597765, 'author': 'Sharvari', 'author_id': 4010493, 'author_profile': 'https://Stackoverflow.com/users/4010493', 'pm_score': 2, 'selected': False, 'text': '<p>To create indexes following stuff can be used:</p>\n\n<ol>\n<li><p>Creates an index on a table. Duplicate values are allowed:\n<code>CREATE INDEX index_name\nON table_name (column_name)</code></p></li>\n<li><p>Creates a unique index on a table. Duplicate values are not allowed:\n<code>CREATE UNIQUE INDEX index_name ON table_name (column_name)</code></p></li>\n<li><p>Clustered Index: <code>CREATE CLUSTERED INDEX CL_ID ON SALES(ID);</code></p></li>\n<li>Non-clustered index:<br>\n<code>CREATE NONCLUSTERED INDEX NONCI_PC ON SALES(ProductCode);</code></li>\n</ol>\n\n<p>Refer: <a href="http://www.codeproject.com/Articles/190263/Indexes-in-MS-SQL-Server" rel="nofollow noreferrer">http://www.codeproject.com/Articles/190263/Indexes-in-MS-SQL-Server</a> for details.</p>\n'}, {'answer_id': 41695102, 'author': 'Looking_for_answers', 'author_id': 6920172, 'author_profile': 'https://Stackoverflow.com/users/6920172', 'pm_score': 1, 'selected': False, 'text': '<ol>\n<li><p><code>CREATE INDEX name_index ON Employee (Employee_Name)</code></p></li>\n<li><p>On a multi column: <code>CREATE INDEX name_index ON Employee (Employee_Name, Employee_Age)</code></p></li>\n</ol>\n'}, {'answer_id': 50649693, 'author': 'mdeora', 'author_id': 1269201, 'author_profile': 'https://Stackoverflow.com/users/1269201', 'pm_score': 0, 'selected': False, 'text': '<p>Since most of the answers are given for SQL databases, I am writing this for NOSQL databases, specifically for MongoDB.</p>\n\n<p>Below is the syntax to create an index in the MongoDB using mongo shell.</p>\n\n<pre><code>db.collection.createIndex( &lt;key and index type specification&gt;, &lt;options&gt; )\n</code></pre>\n\n<p>example - <code>db.collection.createIndex( { name: -1 } )</code></p>\n\n<p>In the above example an single key descending index is created on the name \nfield. </p>\n\n<p>Keep in mind MongoDB indexes uses B-tree data structure.</p>\n\n<p>There are multiple types of indexes we can create in mongodb, for more information refer to below link - <a href="https://docs.mongodb.com/manual/indexes/" rel="nofollow noreferrer">https://docs.mongodb.com/manual/indexes/</a></p>\n'}, {'answer_id': 50697793, 'author': 'SriniV', 'author_id': 2772061, 'author_profile': 'https://Stackoverflow.com/users/2772061', 'pm_score': 0, 'selected': False, 'text': "<p>An index is not always needed for all the databases. For eg: Kognitio aka WX2 engine doesn't offer a syntax for indexing as the database engine takes care of it implicitly. Data goes on via round-robin partitioning and Kognitio WX2 gets data on and off disk in the simplest possible way.</p>\n"}, {'answer_id': 57400894, 'author': 'krishna kirti', 'author_id': 2826658, 'author_profile': 'https://Stackoverflow.com/users/2826658', 'pm_score': 0, 'selected': False, 'text': "<p>We can use following syntax to create index.</p>\n\n<pre><code>CREATE INDEX &lt;index_name&gt; ON &lt;table_name&gt;(&lt;column_name&gt;)\n</code></pre>\n\n<p>If we do not want duplicate value to be allowed then we can add <strong>UNIQUE</strong> while creating index as follow </p>\n\n<pre><code>CREATE UNIQUE INDEX &lt;index_name&gt; ON &lt;table_name&gt;(&lt;column_name&gt;)\n</code></pre>\n\n<p>We can create index on multiple column by giving multiple column name separated by '<strong>,</strong>'</p>\n"}]
['https://Stackoverflow.com/questions/1156', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/264/']