How to write Basic SQL commands in Room

QUERY

@Query("SELECT * FROM professor_db")
@Query("SELECT your_column FROM professor_db")

DELETE

@Delete

INSERT

@Insert(onConflict = OnConflictStrategy.REPLACE)
onConflict = OnConflictStrategy.REPLACE) → This ensures that if a repetition is already available to the Database with the same primary or foreign key, an exception is thrown.

Update

@Update

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store