Database Systems Flashcards

(38 cards)

1
Q

Explain the advantages of using a database system when there is simultaneous
access to the same data.

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

Explain why junction tables, devised to express many-to-many relationships,
should have composite primary keys.

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

Comment on the following statement: “Candidate Keys should use the SQL
constraints of NOT NULL and UNIQUE”.

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

Explain how a B-Tree Index can help improve the performance of a database.

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

Describe how a “Phantom Read” could occur in a transactional database and
suggest a strategy to avoid it.

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

Describe how a “Dirty Read” could occur in a transactional database and
suggest a strategy to avoid it.

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

Describe how a “Fuzzy Read” could occur in a transactional database and
suggest a strategy to avoid it.

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

Do the ANSI level table

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

Explain the use of Triggers in database systems and provide an illustrative
example.

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

Discuss two advantages of using a Relational Database for data persistence, when
compared to using an operating system’s standard file system.

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

Explain why a surrogate key should not be used as Primary Key in tables devised
to express many-to-many relationships.

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

Comment on the following statement: “Adding more Indexes will always make a
Database Management System perform better”.

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

Describe an example of a “Dirty Read” in transactional databases.

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

Comment on the following statement: “Database Management System
Administrators should always define a Transaction Isolation Level of Serializable”.

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

Discuss two circumstances where Stored Procedures might become useful in
Database Systems

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

Explain the advantage of describing Data Models in different levels of
abstraction, such as External, Conceptual, Logical and Internal layers.

17
Q

Describe disadvantages of using Relational Databases.

18
Q

Discuss the disadvantages of using Stored Procedures in Database Systems.

19
Q

List some of the commands belonging to the Data Definition Language (DDL)
portion of SQL

19
Q

Explain the difference between an “SQL INNER JOIN” and an “SQL LEFT
JOIN” CROSS JOIN - RIGHT JOIN

20
Q

What is the main goal of database normalization?

21
Q

Describe the ACID (Atomicity, Consistency, Isolation, Durability) principles of
transactional databases.

22
Q

Difference between 1NF, 2NF and 3NF

23
Q

Redo the ERD Chen Style for:
S2 2023
S2 2024

24
Transform them in Physical Database Tables Give the list of the keys
25
Provide the sample SQL code to create a table “Order”, indicating the respective data types and constraints.
26
WORLD DATABASE QUERIES List all the cities with ‘Population’ of at least 10000.
27
WORLD DATABASE QUERIES List all the countries with ‘Population’ of at least 10 million.
28
WORLD DATABASE QUERIES List all the official languages, i.e. IsOfficial = ‘T’.
29
WORLD DATABASE QUERIES In a single query, list all the countries by ‘Name’ and the number of languages spoken in it, including countries without any language listed.
remember the GROUP BY
30
WORLD DATABASE QUERIES In a single query, list all the countries by ‘Name’ and the number of official languages spoken in it, and present the result in descending order of number of official languages.
31
WORLD DATABASE QUERIES In a single query, list all the countries by ‘Name’ and the sum of ‘Population’ living in cities within it.
32
WORLD DATABASE QUERIES Create an SQL View to list all the cities with ‘English’ as official language (isOfficial = ‘T’).
33
WORLD DATABASE QUERIES Create an SQL View “AmericaRegions” to hold all the Regions in mainland America.
34
WORLD DATABASE QUERIES Create an SQL View “Capitals” to hold all the Capital city names in the world, sorted alphabetically in ascending order.
35
Store Procedures give an example of the structure.
36
WORLD DATABASE QUERIES Create a Stored Procedure to list the cities whose names start with the letter ‘D’, in ascending alphabetical order.
37
WORLD DATABASE QUERIES Create a trigger to check if, before inserting a new country population, the value is not negative, and if it is negative, set it to zero.