Relational Database and Structured Query Language (SQL)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Relational Database and

Structured Query Language


(SQL)
Database
A database is an organized collection of structured information, or data, typically
stored electronically in a computer system. A database is usually controlled by a
database management system (DBMS).

*There is non-relational Database Also


Benefit Relational Database
- Simplicity and Ease of Use: Relational databases follow a well-defined
structure organized into tables with rows and columns.
- Data Integrity and Accuracy: Relational databases enforce data integrity
through mechanisms like primary and foreign keys.
- Flexibility and Scalability: Relational databases are highly flexible. Can easily
add new tables, modify existing ones, and scale the database.
- Data Security: Relational databases offer built-in security features like user
permissions and access controls. (Read/Write/Delete)
- ACID Compliance: Relational databases adhere to the ACID (Atomicity,
Consistency, Isolation, Durability) properties.
Components of Relational Database
- Table/views/materialized views
- Column
- Row
- Key -> a set of attributes or an attribute that uniquely identifies a row in a
table (PK, FK)
- Index -> a data structure that allows users to quickly access specific
information without having to read the entire table's data
Server - Client Interaction in SQL
Most Popular DBMS
- Postgresql
- MySQL
- Oracle
- Microsoft SQL Server
SQL
DDL -> Data Definition
Language (Mendefinisikan
komponen)
DML -> Data Manipulation
Language (Manipulasi Data)
DCL -> Data Control
Language (akses)
TCL -> Transaction Control
Language (mengatur alur
transaksi)
Data Type
https://www.postgresql.org/docs/current/datatype.html
- VARCHAR -> String, Text -> VARCHAR(5)
- TEXT -> unlimited chars
- INT -> angka bulat - & +
- DECIMAL -> angka pecahan dalam koma
- FLOAT -> angka pecahan, dalam binary , 0.5 -> 1 / 11
- UUID -> identifier dalam string, tp sortable
- ARRAY -> set of value. A, (12,21,30,5)
- TIMESTAMP -> waktu. Respect to localization
- DATETIME -> waktu ga respect ke localization
Postgresql - Installation
Follow this instruction here :

https://www.postgresqltutorial.com/postgresql-getting-started/install-postgresql/
Dbeaver - Installation
https://dbeaver.io/download/
Hands On
- Connect DBeaver to PostgreSQL Server
- Create Database
- Insert Data
Homework
Create All table
from diagram

Insert some
data for all
tables

You might also like