Database Basics Flashcards

1
Q

What is a database?

A

A structured collection of related data organised for convenient access.

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

What is a database management system (DBMS)?

A

Computer software that interacts with users, applications, and databases to capture and analyse data.

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

What type of structure do most databases use?

A

Relational, grouping data by relations.

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

What does each record in a relational database relate to?

A

One object, event, or entity.

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

What are tables in a database?

A

Collections of related data, structured with columns and rows.

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

What do columns and rows represent?

A

Columns (attributes) define data type and length;

rows represent individual records.

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

What are attributes in a database?

A

Columns in a table, often used as keys.

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

What is a primary key?

A

A unique identifier for each record

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

What is a foreign key?

A

A link to a unique identifier in another table

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

What are examples of data types in databases?

A

Integer, Decimal, Character, Varchar, Date/Time, Boolean, Binary

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

What is the difference between Character and Varchar?

A

Character is for fixed-length strings; Varchar is for variable-length strings.

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

How is a Decimal type declared?

A

Decimal(n, m), where n is places before the decimal, m is after.

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

What is a Boolean type?

A

Data that can only be TRUE or FALSE.

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

What is SQL?

A

Structured Query Language, used to manage and manipulate databases

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

What does the SQL statement SELECT do?

A

Retrieves existing data from a table.

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

What does INSERT INTO do?

A

Adds new records to a table.

17
Q

What does UPDATE do?

A

Modifies existing records.

18
Q

What does DELETE do?

A

Removes records from a table.

19
Q

What does CREATE TABLE do?

A

Creates a new table with specified columns and data types.

20
Q

What does the FROM clause specify?

A

The table(s) being used.

21
Q

What does the WHERE clause do?

A

Filters records based on conditions.

22
Q

What does GROUP BY do?

A

Groups records by a column’s values.

23
Q

What does LIMIT or SAMPLE do?

A

Restricts the number of records returned.

24
Q

What does COUNT() do?

A

Counts the number of rows returned.

25
What does SUM() do?
Returns the sum of a numeric column.
26
What do MAX() and MIN() do?
Return the largest and smallest values in a column
27
What does AND do in a condition?
Requires all conditions to be true.
28
What does OR do in a condition?
Allows any condition to be true.
29
What does IS NOT NULL do?
Filters records with non-empty data in the specified column.
30
What does an INNER JOIN do?
Returns records where the join condition is met.
31
What does a LEFT OUTER JOIN do?
Returns all records from the left table and matches from the right.
32
What does a RIGHT OUTER JOIN do?
Returns all records from the right table and matches from the left.
33
What does a FULL OUTER JOIN do?
Returns all records from both tables, matching where possible.
34
How should SQL statements be formatted for readability?
lace each keyword on a new line.
35
What is a standard naming convention for tables and columns?
Tables in ALL CAPS; columns in CamelCase.