Databases Flashcards

(111 cards)

1
Q

Why is a database a better storage technique compared to file systems?

A

Data duplication is avoided in databases. Data is also consistent in databases.

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

List a few applications of databases.

A

Social networking websites, online shopping websites, industrial management, security systems, etc.

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

How does a database prevent data duplication?

A

Data duplication is prevented by using a unique primary key field for each record.

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

State examples of programming languages that are used to customise and interact with databases.

A

Python, JavaScript, Microsoft Visual Basic and Delphi.

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

What is the function of a query language?

A

Query language is used to customise and retrieve information from the database.

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

State an example for query language.

A

SQL (Structured query language)

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

In what form is data stored in a database?

A

Data is stored in the form of tables.

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

What is a flat-file database?

A

A flat-file database is a database with only one table.

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

What is a column in a table called?

A

Column

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

What is a row in a table called?

A

Record

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

Information in a database is an example of structured data or unstructured data?

A

Structured data

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

What is a relational database?

A

A relational database is a type of database that is structured and allows users to identify and access data which is in relation to other data.

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

What is an entity?

A

An entity is an object in a system for which the information is stored.

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

What is an attribute?

A

A characteristic of an entity is called an attribute.

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

What is a record?

A

A row in a table that is a collection of fields.

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

True or false: In a relational database, each table contains information about just one entity.

A

True

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

What is a composite primary key?

A

A primary key that consists of more than one attribute is called a composite primary key.

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

What is referential integrity?

A

Referential integrity is a database concept that ensures that all foreign keys represent a valid and existing primary key in its parent table.

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

What is normalisation?

A

The process of dividing larger tables into smaller tables such that these smaller tables are related to each other.

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

What is First Normal Form?

A

A table is said to be in first Normal Form (1NF) if none of its attributes are repeated and there is no grouping of attributes.

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

What is Second Normal Form?

A

A table is said to be in second Normal Form (2NF) if it is in 1NF and there are no partial dependencies on the primary key.

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

What is Third Normal Form?

A

A table is said to be in third Normal Form (3NF) if it is in 2NF and there are no non-key dependencies.

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

What is the main motive of normalisation?

A

The main motive of normalisation is to reduce data redundancy.

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

Why is it easy to maintain a normalised table compared to its unnormalised form?

A

Because there are no data duplications, it is enough to update a data once. In case of data duplications, we must change the data everywhere it appears. Missing updates in a place leads to data inconsistencies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
True or False: Normalised tables occupy less memory compared to its unnormalised form.
True.
26
Why searching and sorting is faster in normalised tables?
Because of normalisation, we have smaller tables without duplications. Hence, searching and sorting is performed at a faster rate.
27
What type of relationships require a link table?
Many-to-many
28
What is non-key dependency?
Non-key dependency is said to be present when the value of a non-key attribute is functionally dependent on another non-key attribute.
29
In which stage of normalisation, is partial dependencies removed?
Second Normal Form
30
In which stage of normalisation is non-key dependencies removed?
Third Normal Form
31
What operator represents not equal to in SQL?
!= or <>
32
What operator is used in SQL to filter records within the limit specified?
BETWEEN … AND …
33
What operator is used in SQL to return records with values of a field within a specific set?
IN
34
What operator is used in SQL to return records with no values in a certain field?
IS NULL
35
What query is used to display all fields and records of a table.
SELECT * FROM table_name;
36
What is the syntax for a CREATE TABLE statement?
CREATE TABLE table_name(column1_name datatype, column2_name datatype,....)
37
List some data types available in SQL.
Integer, float, char, varchar, and date.
38
A column in CREATE TABLE statement is denoted as: Name Varchar(25). What does the number 25 represent?
The number 25 represents the maximum number of characters the column Name can hold.
39
What clause is used to select a few records based on a condition using a SELECT statement?
WHERE clause
40
What clause is used to order records when using a SELECT statement?
ORDER BY clause
41
What statement is used to add new records to the table?
INSERT INTO statement
42
What is the syntax for an INSERT INTO statement?
INSERT INTO tablename (fieldname1, fieldname2, …) VALUES (fieldvalue1, fieldvalue2,…)
43
What statement is used to edit data in a table?
UPDATE statement
44
What is the syntax for an UPDATE statement?
UPDATE table_name SET column_name = value WHERE condition
45
What statement is used to remove data from a table?
DELETE statement
46
What is the syntax for using wildcard characters?
SELECT * FROM tablename WHERE fieldname LIKE (value)
47
What does the wildcard character _ represent?
Underscore(_) represents a single character
48
When displaying fields from multiple tables, how is a field specified?
The syntax tablename.fieldname is used.
49
What is a JOIN statement used for?
A JOIN statement is used to combine rows from two or more tables based on a field that is common to the tables.
50
What statement is used to modify a table?
ALTER TABLE statement
51
What is the syntax of a statement used to delete a field from a table?
ALTER TABLE table_name DROP COLUMN field_name
52
What is concurrency?
Concurrency is a property of a database that ensures that all changes are reflected to all users.
53
What are the components of the ACID rules?
Atomicity, Consistency, Isolation and Durability
54
What does atomicity in an ACID rule ensure?
A transaction consists of multiple operations that are considered as a single entity. A transaction is recorded only when the change is completed. An incomplete change is not recorded.
55
What does consistency in an ACID rule ensure?
Consistency ensures that a database is in a valid state after completion of a transaction.
56
What does isolation in an ACID rule ensure?
It ensures that a transaction is independent and does not manipulate other transactions. Multiple transactions running at the same time produce the same results, even when run sequentially.
57
What does durability in an ACID rule ensure?
It ensures that once a transaction is committed, it survives successfully even after a power failure or crash.
58
What are the challenges faced in processing a transaction in a multi-user database?
Database inconsistencies and missing some updates.
59
What is record locking?
A mechanism used to avoid inconsistencies in a multi-user database by placing a rule that at a time only one person can update an object in the database.
60
What is the disadvantage of record locking?
It may lead to deadlocks.
61
What is a deadlock?
Deadlock is a situation in which two or more transactions are waiting for each other to give up their locks.
62
How can deadlocks be avoided?
Using serialisation techniques such as timestamp ordering and commitment ordering.
63
What is serialisation?
Serialisation is a mechanism used to avoid record deadlocks by ensuring that transactions do not overlap in time.
64
How are transactions processed when timestamp ordering is used?
Each transaction is provided with a timestamp when it is initiated and when two transactions affect the same object of database, the transaction with earlier timestamp is processed first.
65
What is Electronic Data Interchange (EDI)?
A technique in which business documents are transferred from one computer to another in electronic format, rather than traditional methods on paper.
66
What is a DBMS?
A database management system (DBMS) is a systems software to define, create and manipulate information in a database.
67
List the advantages of using a DBMS.
Data security, data integrity, data consistency, different access level for users, encryption of data, back-ups and customisation.
68
Who is provided with the conceptual view of a database?
A database administrator is provided with a conceptual view of a database.
69
What does the internal view of a database consist of?
An internal view of a database includes information about the file structure and storage. It also consists of hex and binary references to bytes of data.
70
Who is provided with the internal view of a database?
Programmers
71
List the different views of a database.
Internal view, conceptual view and external view.
72
What is the conceptual view of a database?
The conceptual view shows how tables in a database are interconnected.
73
Why are different access levels provided for in a DBMS?
Different access levels in a database ensure that the information is secure.
74
What is data modelling?
The analysis and definition of data structures required in a database and to produce a data model.
75
Define Data Definition Language (DDL).
A language used to create, modify and remove the data structures that form a relational database.
76
Define Data Manipulation Language (DML).
A language used to add, modify, delete and retrieve the data stored in a relational database.
77
What are the components of the query processor?
DDL interpreter, DML compiler and query evaluation engine.
78
What are the three main aspects of Big Data?
Volume, velocity and variety
79
List a function of Big Data in banking services.
Customer credit score is monitored and tracked to decide on whether to award a loan or not.
80
What is latency in context to Big Data?
Time delay between the user’s request and the response obtained or time taken to extract meaningful information from raw data.
81
What are the properties of datasets stored in data warehouses?
Data is stored with timestamps. Data is not deleted and keeps growing. Data is immutable.
82
Attribute
A characteristic of an entity.
83
Composite primary key
Primary key that consists of more than one attribute.
84
Database
An organised collection of data which allows users to obtain and process information according to their requirements.
85
Entity
An object in a system for which the information is stored.
86
Field
A column of a table.
87
Flat-file database
A database with only one table.
88
Foreign key
A column of a table that is a link to a primary key of another table.
89
Primary key
A column of a table that uniquely identifies each record.
90
Query
A form of request placed by the user to the database for data.
91
Record
A row in a table that is a collection of fields.
92
c
Referential integrity is a database concept that ensures that table relationships in a database are consistent.
93
Relational database
A type of database that is structured and allows users to identify and access data which is in relation to other data.
94
Structured data
Information that is stored in a predefined format.
95
SQL
Structured Query Language. A standard computer language used to create, manage and search databases at the server end.
96
Table
A collection of records.
97
Varchar
Data type in SQL to represent strings of variable length.
98
Wildcard characters
Characters in a query that substitutes other characters in a string.
99
INT
Data type in SQL to represent integers
100
Operators
A symbol that tells the compiler to perform specific mathematical and logical operations.
101
Boolean
A data type used in programming language to represent two values: TRUE or FALSE.
102
Programming language
A set of rules to be followed by the programmer to instruct the computer to perform a specific task.
103
Access rights
The permission given to database users to access, modify or delete data.
104
Data dictionary
The data dictionary contains metadata about data stored in a database.
105
Data redundancy
Storing the same data more than once in a database
106
Database Administrator (DBA)
A person who is responsible for customising the database to suit user and programmer requirements.
107
Database management system
A systems software to define, create and manipulate information in a database.
108
Database
An organised collection of data which allows users to obtain and process information according to their requirements.
109
DDL
Data Definition Language. A language used to create, modify and remove the data structures that form a relational database.
110
Query
A form of request placed by the user to the database for data.
111
Big Data
A term used to denote large datasets that are difficult to store and analyse.