SQL and Relational Databases Flashcards

1
Q

Explain the concept of a database.

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the concept of a relational database.

A

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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the advantages of relational databases?

A

use of a relational database facilitates the elimination of data inconsistency and data redundancy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what sql query do you use to retrieve data from a relational database

A

SELECT
FROM
WHERE
ORDER BY…ASC | DESC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what SQL query do you use to insert data into a relational database using the commands.

A

INSERT INTO table_name (column1, column 2 …)
VALUES (value1, value2 …)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what sql query do you use to edit (update) and delete data in a database using the commands.

A

UPDATE table_name
SET column1 = value1, column2 = value2 …
WHERE condition

DELETE FROM table_name WHERE condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a primary key

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is a foreign key

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is a field

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is a record

A

A record in a database is a single, complete set of data entries (or row) that contains information for all fields in a table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly