2

I've encountered this strange and rather odd (to me) usage of the preposition 'against', which I quite can't grasp as of now. I've tried to look it up in several dictionaries to no avail.

2

3 Answers 3

2

You can't use a ladder unless it is leaning against a wall or tree or some such object.

Likewise you can't use a SQL statement unless you have a database to run it against.

The database supports the SQL statement. The wall supports the ladder.

When I think of it like that against seems a natural choice.

1
0

It is a well used idiom in IT.

It is used as a synonym of "towards"

Have a look at some of the comments/answers here

Against and Towards can be same?

6
  • 2
    I'd not really think of it as a synonym for 'towards', even if such is technically correct - rather, I'd be likely to explain "execute <statement> against a MySQL database" as meaning that "the operations in <statement> should be applied to the data in the MySQL database". Dec 8, 2017 at 15:33
  • I have heard both since I started in IT last millennium ;)
    – mplungjan
    Dec 8, 2017 at 15:36
  • There are relatively few situations where towards and against are interchangeable, and I would say this is not one of them; in the last twenty years I have heard of things being executed on, in, against, and even under databases, but not towards. You can point some things toward a database, however.
    – choster
    Dec 8, 2017 at 16:11
  • Exactly: The word is used as something to point towards the database
    – mplungjan
    Dec 8, 2017 at 16:17
  • Towards doesn't really work for me, either. SQL queries can be used to set up, define the structure of, create records in, retrieve data from, change records in, delete records from and drop tables from databases. They can even delete entire database instances. The term against covers all these but towards seems much weaker.
    – BoldBen
    Dec 9, 2017 at 9:11
0

The use of the preposition "against" in this context may be due to the fact that there is a specific type of query in SQL known as full-text search, which is typically performed using the syntax "MATCH ... AGAINST". Therefore, the use of "against" may be intended to emphasize that SQL is not only capable of performing regular queries, but also full-text search queries.

However, the use of "against" in this sentence is not strictly necessary, as other prepositions such as "from" could also be used to convey the same meaning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.