Database Basics Flashcards
What is a database?
A structured collection of related data organised for convenient access.
What is a database management system (DBMS)?
Computer software that interacts with users, applications, and databases to capture and analyse data.
What type of structure do most databases use?
Relational, grouping data by relations.
What does each record in a relational database relate to?
One object, event, or entity.
What are tables in a database?
Collections of related data, structured with columns and rows.
What do columns and rows represent?
Columns (attributes) define data type and length;
rows represent individual records.
What are attributes in a database?
Columns in a table, often used as keys.
What is a primary key?
A unique identifier for each record
What is a foreign key?
A link to a unique identifier in another table
What are examples of data types in databases?
Integer, Decimal, Character, Varchar, Date/Time, Boolean, Binary
What is the difference between Character and Varchar?
Character is for fixed-length strings; Varchar is for variable-length strings.
How is a Decimal type declared?
Decimal(n, m), where n is places before the decimal, m is after.
What is a Boolean type?
Data that can only be TRUE or FALSE.
What is SQL?
Structured Query Language, used to manage and manipulate databases
What does the SQL statement SELECT do?
Retrieves existing data from a table.
What does INSERT INTO do?
Adds new records to a table.
What does UPDATE do?
Modifies existing records.
What does DELETE do?
Removes records from a table.
What does CREATE TABLE do?
Creates a new table with specified columns and data types.
What does the FROM clause specify?
The table(s) being used.
What does the WHERE clause do?
Filters records based on conditions.
What does GROUP BY do?
Groups records by a column’s values.
What does LIMIT or SAMPLE do?
Restricts the number of records returned.
What does COUNT() do?
Counts the number of rows returned.