Skip to content

Instantly share code, notes, and snippets.

// Define Column Table & Table Name
public final class DatabaseContract {
private DatabaseContract() {
}
public static class TbDosen implements BaseColumns {
public static final String TABLE_NAME = "dosen";
public static final String COLUMN_NAME_NAMA = "nama";
public static final String COLUMN_NAME_EMAIL = "email";
}
@bl4ckck
bl4ckck / query.sql
Last active April 13, 2022 23:07
Alvin Naufal: Assignment SQL Query Part 1
/**
* Alvin Naufal
*/
-- 1. Tampilkan Employees yang memiliki FirstName berinisial huruf 'A'
SELECT * FROM Employees WHERE FirstName LIKE 'A%';
-- 2. Tampilkan jumlah Employees yang memiliki panjang LastName lebih dari 5 huruf
SELECT COUNT(EmployeeID) AS TotalEmployee FROM Employees WHERE LENGTH(LastName) > 5;
@bl4ckck
bl4ckck / query2.sql
Last active April 14, 2022 07:16
Alvin Naufal: Assignment SQL Query Part 2
/**
* Alvin Naufal
*/
-- 6. Tampilkan kuantitas barang yang di order dengan nama produk = Geitost
SELECT O.Quantity FROM OrderDetails O
JOIN Products P
ON O.ProductID = P.ProductID
WHERE P.ProductName = 'Geitost';
@bl4ckck
bl4ckck / query3.sql
Last active April 18, 2022 13:42
Alvin Naufal: Assignment SQL Query Part 3
/**
* Alvin Naufal
*/
-- 11. Tampilkan nama produk dan nama category yang termasuk kategori Beverages, Dairy Products, dan Condiments
SELECT P.ProductName, C.CategoryName FROM Products P
INNER JOIN Categories C
ON P.CategoryID = C.CategoryID
WHERE C.CategoryName = 'Beverages'