Variabel
Variabel
Objek adalah unit dasar Pemrograman Berorientasi Objek dan mewakili entitas
kehidupan nyata.
Array: menyimpan beberapa nilai dalam satu variabel, alih- alih mendeklarasikan
variabel terpisah untuk setiap nilai.
Database: any collection of related information like shopping list, phonebook, etc
Database can be stored in different ways like paper, computer, etc
Database Management System (DBMS): special software program that helps
user to create & maintain a database.
CRUD: 4 main operation on database
2 type of database
1. Relational db (SQL): organize data into one or more table
a. Each table has columns & rows
b. A unique key identifies each rows
2. No Relational (NOSQL): organize data is anything but a traditional table.
a. Key-value stores
b. Documents (JSON, XML, etc)
c. Graphs
d. Flexible Table
SQL: Structured Query Language
1. Standardized language for interacting with RDBMS (Relational Database
Management System)
2. Used to perform CRUD operation as well as another administrative take.
3. Used to define tables & structure
4. SQL code used on one RDBMS isn’t always portable to another without
modification.
NoSQL: stores data in anything but a static table (mongodb, Cassandra, firebase,
dynamoDb, etc). implementation specific:
1. Any relational database falls under this category so there isn’t set
language standard
2. Most NRDBMS will implement their own language for performing CRUD
operations.
Database Queries: a request made to the DBMS for specific information.
Ex: Google Search is query
SQL basic
SQL is a language used for interacting with RDBMS to do:
1. CRUD data
2. Create & manage db
3. Design & Create db table
4. Perform administration tasks (Security, user management, import/export,
etc).
SQL implementation vary between system:
1. Not all RDBMS follow the SQL standard to a ‘T’
2. The concept are the same but the implementation may vary
SQL is actually a hybrid language, that has 4 types of language:
1. Data Query Language (DQL)
a. Used to query the db for information
b. Get information that Is already stored
2. Data Definition Language (DDL)
a. Used for defining db schemas
3. Data Control Language (DCL)
a. Used for controlling access to the data in db
b. User & permission management
4. Data Manipulation Language (DML)
a. CRUD data from database.
Queries: is a set of instructions given to the RDBMS (written is SQL) that tell
RDBMS what information you want to retrieve.
TONS of data in db
Often hidden in a complex schema
Goal is to only get data you need.
Example:
SELECT employee.name
FROM employee.table
WHERE employee.salary > 300000
SQL Datatypes:
1. INT = Whole Numbers
2. Decimal (M, N) = Decimal numbers – exact value
3. Varchar (1) = string of text length 1
4. BLOB = Binary Large Object, to stores large data
5. Date = ‘YYYY-MM-DD’
6. Timestamp = ‘‘YYYY-MM-DD HH:MM:SS’ used for recording