Was this helpful?
CREATE INDEX Examples
1. Create a primary index named l_idx on the l_shipdate column of the lineitem table:
CREATE INDEX l_idx ON lineitem(l_shipdate);
2. Create a primary index named o_order_date_idx on the order_date column of the orders table:
CREATE INDEX o_order_date_idx ON orders(order_date);
3. Create a secondary index named si_supplier on the s_name column of the supplier table:
CREATE INDEX supplier_sidx ON supplier (s_name) WITH STRUCTURE=X100_SI;
4. Create a secondary index named si_cars on certain columns of the cars table:
CREATE INDEX cars_sidx ON cars (model_id, body_type, color, year_produced) WITH STRUCTURE=X100_SI;
Last modified date: 11/09/2022