I am trying to build a model to input table data, make xy event layer and then select features by an SQL expression and make that a shapefile. What tool should I use for the SQL expression to select the features?
If you are taking a non-arcgis table and making the XY Event Layer directly from it, you can't run a select by anything because ArcGIS does not allow selections on tables without an ObjectID field. Therefore, there are a couple of solutions I can think of.
You could import the CSV or whatever your source table is to a temp/scratch workspace as a FileGDB table (or a DBF table). Then run the make xy event layer on that. Finally, use the Feature Class to Feature Class tool on the event layer and add your SQL query directly to the "Expression" field in the Feature Class to Feature Class GP Tool. This should allow you to save it out as a GDB feature class or shapefile.
Or, you could use the make xy event layer directly on your source table, then use feature class to feature class on the event layer to save it as a shapefile/feature class (Note: You can NOT use a SQL expression at this point this way since your source data won't be from a standard arcgis source with OID field). Then, once you have a feature class, you could use the Make Feature Layer GP tool on that, adding a SQL expression in the expression parameter of the tool for the features you don't want (ex: if you want all the ones where the Type field is 1, you would do an expression like Type <> 1). Then, you would run the delete features tool on the resulting feature layer and that should delete those selected records.
Hope those help; like I said initially though, the important thing to remember is if it doesn't have an ObjectID field, you won't be able to run any attribute queries against it (whether it's a table, event layer, etc...).