Session 1 Flashcards
(22 cards)
What is Big Data?
Big Data is large, complex data that’s hard to process with traditional tools.
Example: Healthcare records
Difference between structured and unstructured data
Structured data is organised and stored in fixed formats like databases (e.g., Excel spreadsheets), while unstructured data lacks a predefined format, such as emails, videos, or social media posts.
What does RDBMS stand for?
Relational Database Management System
What is RDBMS?
It is the basis for SQL, and for all modern database systems. The data in RSBMS is stored in database objects called tables. A table is a collection of related data entries and it consists of columns and rows.
Command for deleting an existing SQL Database
DROP TABLE ‘insert table name’
Command for creating a new database
CREATE DATABASE ‘insert name’
NULL VALUE VS NOT NULL
NULL means no value is assigned (unknown or missing).
NOT NULL means a value must always be provided (it cannot be left empty).
Creating a table
Use project name;
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
);
DATA TYPES: CHAR(size)
Fixed length text. The size defines the exact number of characters it will store.
For example CHAR(5) means it can store up to 5 characters. Even if only “hi” is input it will be stored as “hi “ (three spaces totalling to 5 characters).
DATA TYPES: VARCHAR(size)
Stores variable-length text.
The size defines the maximum number of characters it can store, but unlike CHAR, it only uses the exact space needed for the input without adding extra padding.
For example, VARCHAR(5) can store up to 5 characters. If you insert “Hi,” it will store just “Hi” (no extra spaces).
DATA TYPES: BINARY
Fixed length strings, where size is the number of binary characters to store.
The size defines the exact number of bytes it stores.
DATA TYPES: FLOAT(p)
Floating point number. Where p is a precision
It’s used to store approximate numerical values with a precision p, which determines the number of significant digits. The precision affects how the value is stored and calculated.
If p is 1 to 24, the value is stored as a single-precision (4 bytes).
If p is 25 to 53, it is stored as double-precision (8 bytes).
For example, FLOAT(10) will store a number with up to 10 significant digits.
DATA TYPES: INTEGER
Standard integer value, allows whole numbers. INTEGER stores whole numbers (no decimals) from -2 billion to 2 billion.
DATA TYPES: DECIMAL (m,d)
Fixed point number, where m is the total digits and d is the number of digits after the decimal.
For example, DECIMAL(5, 2) can store numbers like 123.45 (5 digits total, 2 after the decimal).
DATA TYPES: BOOLEAN
BOOLEAN stores true or false values, often represented as 1 (true) and 0 (false).
DATA TYPES: DATE
Displayed as ‘YYY-MM-DD’
DATA TYPES: TIME
Displayed as ‘HH:MM:SS’
DATA TYPES: TIMESTAMP
Displayed as ‘YYY-MM-DD HH:MM:SS’
What datatype to enter when creating table for id
INT
What datatype to enter when creating table for name/text
VARCHAR(n)
What datatype to enter when creating table for whole numbers
INTEGER
How to populate inside several tables
INSERT INTO table_name (column1_name, column2_name, column3_name) VALUES
(‘Data’, ‘Data’, ‘Data’),
(‘Data’, ‘Data’, ‘Data’),
(‘Data’, ‘Data’, ‘Data’),
(‘Data’, ‘Data’, ‘Data’);