Topic 4: Introduction To Database Management Systems
Topic 4: Introduction To Database Management Systems
MANAGEMENT SYSTEMS
Fundamentals of ICT – ETC 2191 R Vasana Sahabandu
TOPIC 4: CONTENT
WHAT IS A DATABASE
A system for MANAGEMENT
protecting data A tool for simplifying
against failure and system development SYSTEM (DBMS)?
unauthorized access
Relieves the
programmer of
physical data storage
DIFFERENT TYPES OF DBMS
PERSON
Person_Cars Person
Data lakes and data warehouses are storage systems for big data used by data
scientists, data engineers, and business analysts. Despite their similarities,
though, they're more different than they are similar, and understanding these key
differences is important for any aspiring data professional.
Data lakes, much like real lakes, have multiple sources ("rivers")
of structured and unstructured data that flow into one combined site. Data
warehouses are designed to be repositories for already structured data to be
queried and analyzed for very specific purposes.
For some companies, a data lake works best, especially those that benefit from
raw data for machine learning. For others, a data warehouse is a much better fit
because their business analysts need to decipher analytics in a structured system.
THE KEY DIFFERENCES
Product
PID PName Price Category Manufacturer
TABLES
FURTHER
1A Gizmo 19.99 Gadgets GizmoWorks
EXPLAINED
Powergiz
1B 29.99 Gadgets GizmoWorks
mo
SingleTou Photograp
1C 149.99 Canon
ch hy
MultiTouc Househol
1D 203.99 Hitachi
h d
Tuples or rows
TABLES FURTHER EXPLAINED
A Primary Key is an attribute whose values are unique (cannot have duplicate
values) and not NULL (must have a value). It is usually underlined.
Product(PID, PName, Price, Category, Manfacturer)
Data types:
String: CHAR(20), VARCHAR(50), etc.
Numeric: INT, BIGINT, SMALLINT, FLOAT, etc.
Others: DATETIME, TIMESTAMP, etc.
SELECT <attributes>
FROM <one or more tables>
WHERE <conditions>
SELECT STATEMENT:
SELECT PID, FName FROM Person EXAMPLES
SELECT *
FROM Person
WHERE Age>25 AND Sex='Male'
SELECT STATEMENT: EXAMPLE
Product
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks
SingleTouch $149.99 Photography Canon
SELECT * MultiTouch $203.99 Household Hitachi
FROM Product
WHERE Category='Gadgets'
Product
PName Price Category Manufacturer
Gizmo $19.99 Gadgets GizmoWorks
Powergizmo $29.99 Gadgets GizmoWorks
SingleTouch $149.99 Photography Canon
SELECT PName, Price, Manufacturer MultiTouch $203.99 Household Hitachi
FROM Product
WHERE Price>100
SELECT *
FROM Products
WHERE PName LIKE '%gizmo%'
Data is inserted with the INSERT statement INTO a table (with attributes)
with VALUES as a tuple.
INSERT INTO
Person_Cars(PID, Car)
VALUES (3, 'Toyota')
UPDATE STATEMENT: UPDATING DATA
UPDATE PRODUCT
SET price = price/2
WHERE name LIKE 'J%'