SQL and Relational Databases Flashcards
Explain the concept of a database.
A database is an organized collection of data that is stored and managed in a structured way to allow easy access, retrieval, and manipulation. Databases are commonly used in software applications, websites, and systems that handle large amounts of information
Explain the concept of a relational database.
A relational database is a type of database that organizes data into tables (also called relations) which are linked together based on defined relationships. The primary structure used to manage and store data in a relational database is tables that consist of rows (records) and columns (fields).
What are the advantages of relational databases?
use of a relational database facilitates the elimination of data inconsistency and data redundancy.
what sql query do you use to retrieve data from a relational database
SELECT
FROM
WHERE
ORDER BY…ASC | DESC
what SQL query do you use to insert data into a relational database using the commands.
INSERT INTO table_name (column1, column 2 …)
VALUES (value1, value2 …)
what sql query do you use to edit (update) and delete data in a database using the commands.
UPDATE table_name
SET column1 = value1, column2 = value2 …
WHERE condition
DELETE FROM table_name WHERE condition
what is a primary key
A primary key is a unique identifier for a record in a database table. It ensures that each row in the table can be uniquely identified and prevents duplicate entries.
what is a foreign key
is a column or a set of columns in a database table that establishes a link between the data in two tables. It references the primary key of another table to enforce referential integrity.
what is a field
A field in a database is a single column within a table that represents a specific attribute or piece of information about the records in that table. Fields are the smallest unit of data in a database.
what is a record
A record in a database is a single, complete set of data entries (or row) that contains information for all fields in a table.