What is a database?
A structured set of data that is stored locally, on a server, or in the cloud.
Definition: Databases resemble spreadsheets but contain tables. Flat files are two-dimensional (rows and columns).
Boot Story: Imagine a filing cabinet where each drawer is a table and each folder is a record.
When should we use a database?
When theres multiple concurrent users, for scalability, speed, a variety of data, or security is required.
Definition: Databases are better than flat files because they allow multiple users, handle large data sets, and store varied data securely.
Boot Story: Think of an office where everyone needs to access the same spreadsheet at once — a database makes this possible.
What is a relational database?
A database that uses tables with rows and columns to recognize relationships among stored information.
Definition: Relational Database Management Systems (RDBMS) manage these databases and allow adding, updating, and retrieving data.
Boot Story: Like linking customers, addresses, and cities in a real-world address book.
What is a schema in a relational DB?
The rules and structure of a database.
Definition: Schema defines how data is organized — tables, relationships, and constraints.
Boot Story: Like the blueprint of a house showing where each room (table) belongs.
What is the difference between a record and an attribute?
A record is a row (horizontal), an attribute is a column (vertical).
Definition: Records store individual entries, attributes define the type of data stored in each column.
Boot Story: Think of a spreadsheet — rows are people, columns are their details.
What is a primary key?
A unique identifier for a record.
Definition: There can only be one primary key per record, ensuring uniqueness.
Boot Story: Like a student ID that uniquely identifies each student.
What is a foreign key?
A key that links two tables together.
Definition: Foreign keys create relationships between tables by pointing to a primary key in another table.
Boot Story: Like linking a student’s ID in the student table to their course ID in the course table.
What is a non-relational database?
A database that doesn’t use rows and columns.
Definition: Uses models optimized for unstructured (videos, pictures) or semi-structured (metadata-tagged) data.
Boot Story: Like a box of mixed media (photos, letters, videos) stored together, not in neat rows.
What are examples of non-relational databases?
Redis, Dynamo DB, Microsoft Azure, Oracle NoSQL, Amazon, Memcached, Cosmos DB.
Definition: These are NoSQL databases designed for handling massive and flexible datasets.
Boot Story: Think of a big photo album app storing millions of pictures instantly.
What are DB access methods?
Different ways to access a database — from direct table editing to GUIs and SQL queries.
Boot Story: Like different doors leading into the same building — some front doors, some back doors.
What are examples of data manipulation commands?
SELECT, INSERT, DELETE, UPDATE.
Definition: DML (Data Manipulation Language) commands used to work with data in tables.
Boot Story: Think of managing a contact list: add a new person, delete an old one, or update their phone number.
What does data definition do?
Defines the structure of a database and its tables.
Definition: DDL (Data Definition Language) includes CREATE, ALTER, DROP, and permissions.
Boot Story: Like laying the foundation and walls of a building before putting furniture inside.
What are examples of data definition commands?
CREATE, ALTER, DROP, Permissions.
Definition: Used to set up or modify database structures.
Boot Story: Like adding, changing, or demolishing rooms in a house.
What are two types of database backups?
Database Dump and Database Backup.
Definition: Dump is a one-time logical copy, Backup is repeatable, often physical, and used for restoration.
Boot Story: Like saving one copy of an essay (dump) versus setting automatic daily saves (backup).
What is data manipulation vs data definition?
Data manipulation works with data, data definition works with structure.
DML edits contents, DDL defines tables and schema.
Boot Story: Like editing text in a Word document (DML) versus designing the template of the document (DDL).
*
How does a database support multiple users?
By allowing concurrent access and secure handling of data changes.
Definition: Databases manage simultaneous queries without data corruption.
Boot Story: Like multiple tellers in a bank updating accounts at the same time.
What does scalability mean in databases?
Ability to handle more users and larger datasets efficiently.
Definition: Databases perform better with scaling mechanisms compared to flat files.
Boot Story: Like upgrading a restaurant kitchen to serve more customers without slowing down.
Which type of key ensures uniqueness in a table?
Primary Key.
Definition: Guarantees no duplicate rows in a table.
Boot Story: Like a fingerprint — unique to each person.
What is a query language?
A language used to retrieve or input data from a database.
Definition: SQL and LDAP are common query languages.
Boot Story: Like asking a librarian to find a specific book from the shelves.
What is data backup used for?
To restore a database in case of failure.
Definition: Backups can be scheduled and repeated to protect data integrity.
Boot Story: Like saving your phone photos to the cloud so you can recover them if the phone is lost.
Which type of key connects different tables?
Foreign Key.
Definition: Establishes a relationship between two tables by referencing another table’s primary key.
Boot Story: Like linking a student’s record to their teacher’s record in a school system.
How do relational databases differ from non-relational databases?
Relational use rows and columns with strict schema, non-relational handle unstructured or semi-structured data.
Definition: Relational = predictable, tabular. Non-relational = flexible, often NoSQL.
Boot Story: Like the difference between a neatly organized filing cabinet vs a box full of mixed documents.
What is the difference between a dump and a backup?
Dump is one-time, backup is ongoing and scheduled.
Definition: Dump copies schema/data into another database, backup creates recoverable copies.
Boot Story: Like copying an assignment once (dump) versus auto-saving every version (backup).