Please enable JavaScript.
Coggle requires JavaScript to display documents.
QUERY SQL - Coggle Diagram
QUERY SQL
TABLE
CRUD
SELECT :star:
FROM
WHERE
IN
GETS A LIST OF IDS -
Query(
"""
SELECT _id FROM interestList
WHERE _id IN (:idList)
"""
)
-
SET
Query("UPDATE $INTEREST_TABLE_NAME SET isSelected = :status WHERE _id = :itemId")
ALTER TABLE
-
wrangler d1 execute your_database_name --command "ALTER TABLE your_table_name ADD COLUMN new_column_name data_type;"
-
-
-
CLAUSES
-
The SQL query inside the Query annotation performs an inner join between the user and book tables based on the condition user.id = book.user_id. This means it will retrieve all columns from both tables where the id column in the user table matches the user_id column in the book table.
-
-
AKA
-
JOIN and INNER JOIN will return the same result. INNER is the default join type for JOIN , so when you write JOIN the parser actually writes INNER JOIN .
GROUP BY
-
-
fun loadUserAndBookNames(): Map<User, List<Book>>
-
-
COMPARISONS
AND
Query("SELECT * FROM user WHERE age BETWEEN :minAge AND :maxAge")
fun loadAllUsersBetweenAges(minAge: Int, maxAge: Int): Array<User>
-
GROUP BY
-
Example
SELECT learningStatus, COUNT(*) AS "count" FROM vocab
WHERE vocabId IN ("65f279b265bb93a2c2692f14", "65f279b265bb93a2c2692f1a", "65ea153a73a6bff5d0e9a756", "65f48c3265bb93a2c2a09b22")
-
-
LIMIT
Query("SELECT * FROM user WHERE first_name LIKE :first AND " +
-
fun findByName(first: String, last: String): User
-