Relational Databases, SQL & Application Design – Review

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/112

flashcard set

Earn XP

Description and Tags

100 Q&A flashcards covering SQL commands, NULL logic, relational design, normalization, Visio notation, MS Access features, MSF methodology, ADO/JDBC programming, and general database concepts.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

113 Terms

1
New cards

What does the SQL SELECT statement do?

Retrieves rows (records) from a database table.

2
New cards

Which SQL command is used to insert new rows into a table?

INSERT.

3
New cards

Which SQL command removes rows from a table?

DELETE.

4
New cards

Which SQL command modifies existing rows in a table?

UPDATE.

5
New cards

What is the main purpose of an index in a relational database?

To speed up record retrieval (search).

6
New cards

Which SQL statement permanently saves the changes of a transaction?

COMMIT.

7
New cards

Which SQL statement undoes the changes of the current transaction?

ROLLBACK.

8
New cards

What privilege-related SQL command grants rights to a user?

GRANT.

9
New cards

Which SQL command removes previously granted privileges?

REVOKE.

10
New cards

What does the SQL statement ALTER TABLE primarily change?

The schema/structure of an existing table.

11
New cards

In three-valued logic, what is the result of Null = Null?

Null.

12
New cards

What is the result of TRUE OR Null?

TRUE.

13
New cards

What is the result of FALSE OR Null?

Null.

14
New cards

What is the result of FALSE AND Null?

FALSE.

15
New cards

What is the result of TRUE AND Null?

Null.

16
New cards

What is the result of NOT Null?

Null.

17
New cards

Why does the predicate EmployeeID = NULL return no rows?

Because comparisons with NULL are unknown; you must use IS NULL.

18
New cards

Which SQL keyword counts rows irrespective of NULLs?

COUNT(*).

19
New cards

What is the maximum COUNT(*) result of SELECT … WHERE a < a?

Always 0.

20
New cards

In a relational database, what object corresponds to an entity?

A table.

21
New cards

Which relational object represents a single-valued attribute?

A column in a table.

22
New cards

What database object usually represents a one-to-many relationship?

A foreign key in the many-side table.

23
New cards

What database object represents a many-to-many relationship?

An additional associative (junction) table.

24
New cards

Which key enforces entity integrity and uniqueness of each row?

Primary key.

25
New cards

What does referential integrity guarantee?

A foreign key is either NULL or matches a primary key value in the parent table.

26
New cards

What is the informal rule of Third Normal Form (3NF)?

Non-key attributes must depend only on the whole key and nothing transitively on the key.

27
New cards

What is the Boyce-Codd Normal Form (BCNF) rule?

Every non-trivial functional dependency has a superkey on its left side.

28
New cards

Which relational model properties are true? (rows / columns)

Rows are unique; column order is irrelevant.

29
New cards

Can there be multiple candidate (unique) keys in one table?

Yes, many candidate keys are allowed; only one is chosen as primary.

30
New cards

Does every foreign key automatically receive an index?

No; primary and unique keys get indexes automatically, foreign keys may not.

31
New cards

Who proposed the relational model?

Edgar F. Codd.

32
New cards

Which company built the first relational DBMS prototype?

IBM.

33
New cards

Which problems appear if a schema is not in 3NF?

Redundancy and insert, delete, update anomalies.

34
New cards

What concept does a functional dependency relate?

Attributes (columns).

35
New cards

Moving to an object table gives what to each row?

Object identity; the row becomes an object of some class and can have methods.

36
New cards

In an ORDBMS, an attribute value can be which complex types?

Atomic value, collection (list/set), or reference to another object.

37
New cards

In ODL, a class is declared with which keyword?

interface.

38
New cards

Which ODL features allow bidirectional navigation and hierarchy?

Inverse relationships and inheritance.

39
New cards

In Visio, how is a non-identifying relationship shown?

Arrow pointing to the ‘one’ side; foreign key not part of child’s primary key.

40
New cards

How is an identifying relationship shown in Visio?

Arrow to the ‘one’ side; foreign key included in child’s primary key.

41
New cards

What do Visio referential actions define?

How INSERT, DELETE, UPDATE propagate between related rows.

42
New cards

In Visio, Cardinality property sets what?

Number of child rows per parent row.

43
New cards

Transforming a binary many-to-many relationship creates how many tables?

One associative table.

44
New cards

Transforming a binary many-to-many creates how many relationships?

Two one-to-many relationships.

45
New cards

What does a cycle in an ERD potentially indicate?

May represent a recursive relationship; not necessarily an error.

46
New cards

In Chen’s notation, what symbol represents a relationship?

A diamond (rhombus).

47
New cards

In Chen’s notation, how is an entity represented?

A rectangle.

48
New cards

In Chen’s notation, how is an attribute shown?

An oval (circle).

49
New cards

Which SQL query correctly finds employees in DALLAS or CHICAGO with salary >1200?

SELECT name, dept, sal FROM emp WHERE (dept='DALLAS' OR dept='CHICAGO') AND sal>1200;

50
New cards

Which clause filters grouped rows after GROUP BY?

HAVING.

51
New cards

Which clause lists the grouping columns?

GROUP BY.

52
New cards

Where is a pass-through query executed?

Directly on the remote DBMS via ODBC, not by Access.

53
New cards

Name two uses of a pass-through query.

Create remote objects (tables, views) and retrieve data from a remote DB.

54
New cards

Which Access option enforces cascading deletes?

‘Cascade Delete Related Records’ in the relationship properties window.

55
New cards

How many join types are offered in Access relationship dialog?

Three.

56
New cards

Give two action query types in Access.

Update query and Delete (or Append/Make-Table) query.

57
New cards

List three default form views in Access.

Single Form, Continuous Form, Datasheet.

58
New cards

Access form controls can be of which binding types?

Bound, unbound, or calculated.

59
New cards

What does the expression If(IsNull([Salary]),0,[Salary]) return?

0 when Salary is Null, otherwise the Salary value.

60
New cards

What structure is the natural way to organize a report in Access?

Groups.

61
New cards

Cross-tab reports rely on which queries?

Crosstab queries and report totals.

62
New cards

What is an Access lookup field?

A list control in a table column storing only allowed values (often foreign keys).

63
New cards

What does ‘Filter by Form’ do?

Allows a user to enter criteria into blank form fields to filter records.

64
New cards

Name two common form events you can program in Access.

On Close and After Update.

65
New cards

Which objects can appear in a WHERE clause reference Forms![FormName]![Control]?

A table or query compared with a form control.

66
New cards

Where can you use Sum([Cost]) in Access?

SELECT list, form footer, detail section, or query design grid field row.

67
New cards

What does the DLookup function do?

Returns a value from another table/query into the current form/report.

68
New cards

What is required to link a subform to a main form?

Matching parent and child fields (usually PK↔FK) in their record sources.

69
New cards

What is the purpose of a TOR (Terms Of Reference) document?

Provides a baseline for further project work.

70
New cards

Name four repository operations supported by CASE tools.

Transformation, versioning, forward engineering, reverse engineering.

71
New cards

List the MSF risk model phases.

Analysis, Planning, Tracking, Control.

72
New cards

Which two main phases exist in the MSF process model?

Planning Phase and Building (Creating) Phase.

73
New cards

Who in MSF is accountable for delivery within project constraints?

The Program Manager.

74
New cards

Which four aspects make up MSF Enterprise Architecture?

Business, Information, Applications, Technology.

75
New cards

Which three design perspectives are defined in MSF?

Conceptual, Logical, Physical.

76
New cards

Name the three-tier layers in MSF application model.

Presentation layer, Business layer, Data layer.

77
New cards

Which Access VBA elements help error handling?

On Error statement, CancelEvent action, Form events like On Error or NotInList.

78
New cards

What is an ADO Recordset?

An object (Recordset) representing a set of records returned by a query.

79
New cards

Which object is the root of the ADO hierarchy?

Connection.

80
New cards

What does the DoCmd object provide in Access VBA?

Methods that execute database commands (OpenForm, ApplyFilter, Requery…).

81
New cards

Name two methods that synchronise data between forms.

DoCmd.ApplyFilter and DoCmd.Requery (or DoCmd.OpenForm with criteria).

82
New cards

Which actions can speed up an Access application?

Database Performance Analyzer, adding/removing indexes, splitting/merging tables, converting to .mde, removing unbound images.

83
New cards

Which Java package gives JDBC classes?

java.sql.

84
New cards

What is DriverManager responsible for in JDBC?

Managing the list of available database drivers.

85
New cards

Give two methods of java.sql.Statement.

executeQuery and executeUpdate.

86
New cards

Give two methods of java.sql.ResultSet.

next and getString.

87
New cards

Which class owns the commit method in JDBC?

java.sql.Connection.

88
New cards

How do you model a many-to-many relationship in Visio?

Create an associative entity and connect it to both original entities with two one-to-many relationships (associative entity on the ‘many’ side).

89
New cards

What type of relationship exists between COUNTRY and RIVER (flows through)?

Many-to-many; requires an associative entity.

90
New cards

How many tables are needed to model floors and rooms with 1-to-many?

Two (Floors and Rooms).

91
New cards

Which SQL operator should you use to test for NULL?

IS NULL (or IS NOT NULL).

92
New cards

Write an Oracle SQL query to return departments with more than 3 employees and their average salary.

SELECT deptno, AVG(sal) FROM emp GROUP BY deptno HAVING COUNT(*) > 3;

93
New cards

What is an example of pessimistic concurrency control?

Locking (exclusive locks until transaction completes).

94
New cards

What two mechanisms protect data from unauthorized access?

User accounts/passwords and granting object privileges.

95
New cards

Where are Access system tables (metadata) stored?

In special hidden tables inside the same database file.

96
New cards

Define client-server architecture.

Division of application tasks between a service provider (server) and a requester (client).

97
New cards

Can a single machine host multiple clients and servers?

Yes; many server and client processes can coexist on one computer.

98
New cards

Which SQL clause may still appear inside a subquery when GROUP BY is used?

GROUP BY is allowed, and SELECT list must contain grouped columns or aggregates.

99
New cards

Which Access control refreshes data in a list or combo box?

The Requery method.

100
New cards

What is a collection in VBA/ADO terms?

An object representing an ordered set of elements accessed by index or key.