Basics of databases Flashcards

1
Q

What is an ANSI/SPARC structure?

A

A proposed framework for DBMS
- Internal level
- Conceptual level
- External level

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

Explain the Internal level in the ANSI structure

A
  • Physical storage of data
  • Structure of records on disk
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain the conceptual level in the ANSI structure

A

Deals with the organisation of the entire database content
(CREATE table vibes)

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

Explain the external level in the ANSI structure

A

Provides a view of the database tailored to a user
(CREATE view vibes)

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

What are the advantages of using a database?

A
  • Data integrity
  • Data consistency
  • Enforcement of standards
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the stages of the system development life cycle (SDLC)?

A

Planning
Analysis
Design
Implementation
Maintenance

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

What is a conceptual schema?

A

Users can see what data is stored in the database and the relationship between data

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

What is a DBMS?

A

Stores, modifies and retrieves data

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

What is SQL made up of?

A

DDL
DML
DCL

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

What is DDL?

A

Data definition language (actual STRUCTURE of database)
- CREATE
- ALTER
- DROP

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

What is DML?

A

Data manipulation language (manipulating the data- a level stuff)
- SELECT
- INSERT
- DELETE
- UPDATE

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

What is DCL?

A

Data control language (access)
- GRANT
- REVOKE

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

What are the three types of data model?

A

Hierarchal
Network
Relational

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

Explain the hierarchal data model

A

Data organised in a tree structure
- DOM

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

Explain the network data model

A

Data organised in a loose network

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

Explain the relational data model

A

Data organised into sets

17
Q

What is a relation?

A

A table with columns and rows

18
Q

What is an attribute?

A

A named column of a relation

19
Q

What is a domain?

A

Set of allowable values for one or more attributes

20
Q

What is a tuple?

A

A row in a relation
- Attribute name rows don’t count

21
Q

What is the degree of a relation?

A

The number of attributes the relation contains

22
Q

What is the cardinality?

A

Number of tuples the relation contains

23
Q

What is a relational database?

A

A collection of normalised relations with distinct relation names

24
Q

What is a candidate key?

A

A single key or group of multiple keys uniquely identifying table rows

25
Q

What is a primary key?

A

A candidate key that is selected to identify tuples uniquely in a relation

26
Q

What is a foreign key?

A

An attribute, or set of attributes within one relation that matches the candidate key of some relation

27
Q

How do we maintain data integrity?

A
  • Restrict domain
  • Candidate and primary keys identify tuples
  • Foreign keys link relations to each other
28
Q

What is NULL?

A

Represents a value for an attribute that is currently unknown or is not applicable

29
Q

What is entity integrity?

A

In the base relation, no attribute of the primary key can be NULL and must be unique

30
Q

What is referential integrity?

A

If a foreign key exists in a relation, either the foreign key value must match a candidate key value or it must be NULL

31
Q

What are three ways we can deal with maintaining referential integrity?

A

Restrict
- Stop user from changing the values in candidate keys
Cascade
- Let the changes flow
Nullify
- Make values in foreign key NULL

32
Q

How do we logically connect two tables together?

A

Common attribute