Databases
Databases
Databases
A database is an organized collection of data that allows easy access, management, and updating of information. It
stores data in a structured way so that it can be efficiently retrieved, modified, and maintained.
Single-table database
A single-table database is a simple database design where all the data is stored in a single table, rather than being
split across multiple tables.
1. Fields (Columns) - A field is a single data attribute or column in a table, representing a specific type of
information for all records
2. Records (Rows) - A record is a complete row in a table, representing a single entry with values for all fields.
Validation
Validation in databases refers to the process of ensuring that the data entered into the database is accurate,
consistent, and follows specific rules. This prevents errors, maintains data integrity, and ensures the reliability of
the database.
1
Basic data types
There are six basic data types that you need to be able to use in a database,
1. text/alphanumeric
2. character
3. Boolean
4. Integer
5. Real
6. date/time
Primary key
A primary key is a field (or a combination of fields) in a database table that uniquely identifies each record. It
ensures that no two rows have the same value for the primary key, and it cannot contain NULL values. The primary
key is essential for maintaining data integrity and establishing relationships between tables in a relational
database.
SQL
SQL (Structured Query Language) is a standardized programming language used to manage, retrieve, and
manipulate data in relational databases.
SQL scripts
An SQL script is a collection of SQL commands stored in a file that can be executed together. It is often used to
automate database tasks such as creating tables, inserting data, updating records, or managing permissions.
2
Basic format of SQL script:
FROM TableName
WHERE Condition