Pre-Lab Tutorial 1: What Is a Database?
Read before Lab 1 | Estimated reading time: 15 minutes | No prior experience assumed
This tutorial gets you ready for Lab 1. It answers two questions: what is a relational database, and what is SQL.
Nothing here requires you to have touched a database before.
1. What Is a Database?
A database is an organized collection of data stored electronically, built so that software can store, find, and
update it reliably. That's it — a phone's contact list, a bank's account records, and a university's list of students
are all databases.
A database management system (DBMS) is the software that stores and controls access to that data. Oracle is a
DBMS. In this course you won't install anything — you'll use Oracle APEX, a web tool that lets you talk to an
Oracle database through your browser.
2. What Makes a Database "Relational"?
A relational database organizes data into tables — grids of rows and columns, similar to a spreadsheet. Each
table stores information about one kind of thing. For example, a table called STUDENTS might look like this:
STUDENT_ID FIRST_NAME LAST_NAME MAJOR
1 Amara Haddad Computer Science
2 Yusuf Karam Biology
3 Lina Nasser Computer Science
Three terms describe the parts of that table, and you will use them constantly:
• Table — the whole grid (STUDENTS). Sometimes called a relation, which is where "relational database" gets
its name.
• Row — one single record (one student). Also called a record or a tuple.
• Column — one category of information shared by every row (FIRST_NAME). Also called a field or an
attribute.
A database is called "relational" because it can also relate separate tables to each other — for example, a
COURSES table could be connected to STUDENTS to show who is enrolled in what. You won't build that
connection until Lab 3; for Lab 1, you only need to create standalone tables.
3. Primary Keys: How a Table Tells Rows Apart
Look at the STUDENTS table again. Two students could share the same first name, or even the same full name —
but STUDENT_ID is never shared. A column (or set of columns) that uniquely identifies every row is called a
primary key.
Why this matters
Every table you create in this course should have a primary key. It's how the database — and you — can always
refer to one exact row without ambiguity, even if every other column happens to match another row.
4. What Is SQL?
SQL (Structured Query Language, usually pronounced "sequel" or spelled out "S-Q-L") is the standard language
used to talk to a relational database. Every relational DBMS — Oracle, MySQL, PostgreSQL, SQL Server —
understands SQL, with small differences in the details.
SQL statements fall into a few families. In this course you will meet three of them, roughly in this order:
• DDL (Data Definition Language) — defines and changes structure: CREATE TABLE, ALTER TABLE, DROP
TABLE. This is what Lab 1 covers.
• DML (Data Manipulation Language) — adds, changes, or removes data: INSERT, UPDATE, DELETE. Starting in
Lab 2.
• DQL (Data Query Language) — asks questions of existing data: SELECT. Starting in Lab 4.
5. A One-Line Preview
Here is the very first statement you will run in Lab 1. Don't worry about memorizing the syntax yet — just notice
the shape of it: a command, a table name, and a list of columns with their types.
CREATE TABLE library_members (
member_id NUMBER(6) PRIMARY KEY,
first_name VARCHAR2(20) NOT NULL,
last_name VARCHAR2(25) NOT NULL,
email VARCHAR2(50),
join_date DATE
);
In plain English, this says: "Create a table named library_members. It has five columns. member_id is a number,
up to 6 digits, and it's the primary key. first_name and last_name are short pieces of text that are required.
email is optional text. join_date is a calendar date." You'll type exactly this in Lab 1, Part 3.
6. Glossary — Keep This Handy
Term What It Means
Database An organized collection of data, stored and managed electronically.
DBMS Database Management System — the software (e.g. Oracle) that runs the database.
Table A grid that stores one kind of data, organized into rows and columns.
Row One single record in a table.
Column One category of data shared by every row in a table.
Primary Key A column (or columns) that uniquely identifies every row in a table.
SQL Structured Query Language — the standard language for talking to a relational database.
DDL SQL commands that define or change structure: CREATE, ALTER, DROP.
Term What It Means
DML SQL commands that change data: INSERT, UPDATE, DELETE.
DQL SQL commands that read data: SELECT.
Before You Start Lab 1
• You do not need to install any software — Oracle APEX runs in your browser.
• You do not need to memorize SQL syntax yet — Lab 1 will have you type it while looking at examples.
• If a term above still feels fuzzy, that's expected — Lab 1 is where these ideas become concrete.