Mid Term study Flashcards

1
Q

What is the Range of Database applications?

A

-Personal Databases

-Multitier Client/Server Databases

-Enterprise Applications(
* Enterprise Resource Planning
* Data Warehousing)

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

What are the THREE development stage models?

A

Conceptual model

Logical Model

Physical Model

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

Problems with Data Dependency?

A

Each application programmer must maintain his/her own data

Lack of Coordination and Central Control

Non-standard file formats

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

Costs and Risks of Database Approach?

A

New, specialized personnel

Installation and management cost and
complexity

Conversion costs

Need for explicit backup and recovery

Organizational conflict

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

What is the Database Approach?

A

Central repository of shared data

Data is managed by a controlling agent

Stored in a standardized, convenient
form

Requires a Database Management System (DBMS)

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

What are CASE Tools

A

computer-aided software engineering Tools

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

What is a Repository?

A

centralized storehouse of metadata

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

What are End Users?

A

people who use the applications and
databases

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

Define Metadata?

A

Data about data(information about data)

Provides context to the data.

Example: if ‘Salary’ for an employee is 65000.

65000 is the data and ‘Salary’ is the context or metadata.

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

Define Conceptual Data Modelling

A
  • Define detailed inventory of data attributes
  • Lists all the data categories
  • Establishes relations between data categories

Results in conceptual schema that is usually
displayed graphically
(known as the Entity-Relationship Diagram)

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

Define Logical Data Modelling

A

Transform The conceptual schema to logical schema

Describe data in terms of data management
technology that will be used (i.e relational database)

Transform data to atomic elements through the process of normalization (tune the conceptual model)

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

Define Physical Data Modelling

A

Describe how data will be stored and managed by the technology (i.e RDBMS)

Responsible for specifications for memory
management, storage layout, data indexing, etc

Results in a physical schema

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

Select Query syntax

A

SELECT [column name] from [table name]
WHERE [Condition]

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

Selecting null or not null syntax

A

SELECT * FROM [TABLE] WHERE Column name IS NULL
IS NOT NULL

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

BETWEEN and IN clause examples

A

BETWEEN:
SELECT * FROM [TABLE]
WHERE [Column name] BETWEEN VAL-1 AND VAL-2

IN:
SELECT * FROM [TABLE]
WHERE [Column name] IN (VAL-1,VAL-2, ETC)

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

LIKE Clause: What do these % and _ mean?

A

//name starts with any 1 char, ends w/ erman
WHERE [Column name] LIKE ‘_erman’

//name starts w/ h with anything after
WHERE [Column name] LIKE ‘h%’

17
Q

Date functions?

A

SYSDATETIME,
DATENAME(year, ‘2017/08/25’) AS DatePartString;,
DATEPART(year, ‘2017/08/25’) AS DatePartInt;,
DATEDIFF(year, ‘2017/08/25’, ‘2011/08/25’) AS DateDiff;

18
Q

String functions?

A

CONCAT(‘W3Schools’, ‘.com’);

REPLACE(‘SQL Tutorial’, ‘T’, ‘M’);

RTRIM(‘SQL Tutorial ‘)

UPPER(‘sql’)
LOWER[‘SQL’)

SUBSTRING(‘SQL Tutorial’, 1, 3)
//SQL extracted

LEN(‘SQL’)

19
Q

Mathematical functions

A

ROUND(235.415, 2)
//round to 2 decimal places

CEILING(25.75)

FLOOR(25.75)

20
Q

Aggregate functions

A

MIN()
MAX()
COUNT()
AVG()
SUM()
CAST()

21
Q

What are business rules?

A

Basis for the data model.

Define what data does your business needs and define
how to govern the data.

22
Q

What does the ER diagram consist of?

A

Entities:
– Entity Type – collection of entities (often corresponds to a table)
* Relationships:
– Relationship type – category of relationship; link between entity types
* Attributes:
– Properties or characteristics of an entity or relationship type (often corresponds to a field in a
table)

23
Q

What are Supertypes and Subtypes?

A

Supertype is a generic entity type that has one or more Subtype.

24
Q

Explain the Completeness constraints

A

Total Specialization Rule: An instance of a supertype must also be a subtype

Partial Specialization Rule: An instance of a supertype doesn’t have to be a subtype

25
Q

Explain the Disjointness Constraints

A

Disjoint rule: A Supertype can only have one subtype

Overlap Rule: A Supertype can have one or more subtypes

26
Q

Two Approaches to Make Relational Models

A

Generalization and Specialization

27
Q

Generalization is a ______-__ approach where we start looking at ______ and then categorize all entities with similar
attributes to ______ _____

A

Generalization is a bottom-top approach where we
start looking at entities and then categorize all entities with similar
attributes to entity types

28
Q

Specialization Is a ___-_______ approach where we start thinking of
the more ______ entities (the big picture) and then drill down till
we can get to the ____ __________ entity types. This approach is more
inline with the _________ __________ modeling.

A

Specialization Is a top bottom approach where we start thinking of
the more abstract entities (the big picture) and then drill down till
we can get to the more concise entity types. This approach is more
inline with the Object Oriented O-O modeling.

29
Q

What does ACID stand for?

A

ATOMICITY
CONSISTENCY
ISOLATION
DURABILITY

30
Q

Explain the A in ACID

A

A - Atomicity:
This principle ensures that a transaction is treated as a single unit, which either fully happens or doesn’t happen at all. If any part of the transaction fails, the entire transaction is rolled back, leaving the database in its initial state before the transaction was attempted.

31
Q

Explain the C in ACID

A

C - Consistency:
Consistency ensures that a transaction can only bring the database from one valid state to another, maintaining all predefined rules, including constraints, cascades, and triggers. The data must be consistent before and after the transaction.

32
Q

Explain the I in ACID

A

I - Isolation:
Isolation ensures that transactions are securely and independently processed simultaneously without interference, guaranteeing that transactions occurring concurrently result in the same state as if they were processed sequentially. This prevents transactions from reading intermediate data from each other.

33
Q

Explain the D in ACID

A

D - Durability:
Durability guarantees that once a transaction has been committed, it will remain so, even in the event of a power loss, crash, or error. Committed transactions are recorded in non-volatile memory, ensuring that the effects of the transaction are permanently reflected in the database.

34
Q

What is CAP Theorem

A

in a distributed database system, it is impossible to simultaneously guarantee Consistency (all nodes see the same data at the same time), Availability (every request receives a response about whether it was successful or failed), and Partition Tolerance (the system continues to operate despite network partitions).

A distributed system can only achieve two of these three things so a trade-off must be made.

35
Q

Scale-up vs Scale-out

A

Scale-up: Vertical scaling, make one machine stronger by adding more resources.

Scale-out: Horizontal scaling, Add more machines to share the load.

36
Q

Schema on read is?

A

Schema on read means that you can
create your own structure from
unstructured or loosely structured
data when you read the data.
Example: Relational Databases

37
Q

Schema on write is?

A

Schema on write requires a well
defined structure (tables in relational
databases) and you need to adhere
to this schema when writing to the
the database
Example: MongoDB

38
Q
A