Database Management Final

0.0(0)
studied byStudied by 5 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/192

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

193 Terms

1
New cards

What is data cleaning?

The process of correcting or removing erroneous data to ensure accuracy in analysis.

2
New cards

What are the consequences of 'dirty' data?

Low productivity, revenue loss, stakeholder distrust, and harm to customers.

3
New cards

What causes erroneous data?

Human error, lack of integrity constraints, and encoding corruption.

4
New cards

What is the purpose of reshaping data?

To organize data into a relational structure suitable for analysis.

5
New cards

What is the difference between wide and long data?

Wide data has rows for subjects and columns for attributes; long data has rows for subject-attribute pairs.

6
New cards

What does normalization involve?

Separating columns into 3NF tables and ensuring primary/foreign key connections.

7
New cards

What is de-duplication?

The process of removing duplicate rows from a dataset.

8
New cards

What are surrogate keys?

Artificially generated unique identifiers used when natural keys are unreliable.

9
New cards

What is the goal of data wrangling?

To prepare clean, consistent data for loading into a database.

10
New cards

What is the SQL command for creating a new table?

CREATE TABLE.

11
New cards

What is the purpose of Data Definition Language (DDL)?

To define and modify database structure, including tables and constraints.

12
New cards

What are the three families of SQL commands?

Data Definition Language (DDL), Data Manipulation Language (DML), and Data Control Language (DCL).

13
New cards

What is the syntax for creating a table in SQL?

CREATE TABLE table_name (field_definitions);

14
New cards

What is referential integrity?

A set of rules that ensures relationships between tables remain consistent.

15
New cards

What is the purpose of field constraints in SQL?

To specify rules for data entry, such as uniqueness or required fields.

16
New cards

What is the DROP TABLE command used for?

To delete a table from the database.

17
New cards

What is the significance of primary keys in a database?

They uniquely identify each record in a table.

18
New cards

What is the difference between DML and DDL?

DML is for manipulating data (e.g., INSERT, UPDATE), while DDL is for defining database structure (e.g., CREATE, ALTER).

19
New cards

What is the purpose of data type constraints?

To ensure that the data entered into a field matches the expected type.

20
New cards

What is the function of encoding in data management?

To convert data into a specific format for storage and retrieval.

21
New cards

What is flattening in data reshaping?

Resolving multivalued attributes to fit data into a 2D, tabular structure.

22
New cards

What are typographical errors in data?

Mistakes in data entry, such as misspellings or incorrect formatting.

23
New cards

What is the purpose of the SQL command GRANT?

To give user privileges to access or manipulate database objects.

24
New cards

What does the term 'data decomposition' refer to?

Breaking down data into smaller, normalized relations.

25
New cards

What is the importance of constraints in data entry?

To prevent errors and ensure data integrity during input.

26
New cards

What is the 'Marty McFly Problem' in database management?

The issue that arises when referential integrity is violated, such as deleting parent records before child records.

27
New cards

What is the role of SQL in database management?

To create, manipulate, and control access to relational databases.

28
New cards

What are illogical values in data?

Data points that are impossible or nonsensical, such as negative ages.

29
New cards

What is the purpose of the SQL command SELECT?

To retrieve data from a database.

30
New cards

What is the purpose of the CREATE TABLE statement?

To define a new table and its structure in a database.

31
New cards

What are the naming rules for SQL tables?

Table names must be ≤ 30 characters, start with a letter, contain no spaces or reserved words, and be unique.

32
New cards

What is the difference between CHAR and VARCHAR2 data types?

CHAR is a fixed-length string, while VARCHAR2 is a variable-length string.

33
New cards

What does the NUMBER data type represent?

Numeric values, where precision and scale can be defined.

34
New cards

What is the purpose of the NOT NULL constraint?

It ensures that a column cannot have a NULL value.

35
New cards

What does the UNIQUE constraint enforce?

It ensures that all values in a column are distinct.

36
New cards

What is a PRIMARY KEY?

A constraint that uniquely identifies each row in a table.

37
New cards

What is a FOREIGN KEY?

A constraint that enforces a relationship between two tables.

38
New cards

What SQL command is used to modify an existing table's structure?

ALTER TABLE

39
New cards

What does the DROP TABLE command do?

It deletes a table and all its data from the database.

40
New cards

What is the purpose of the INSERT command?

To add new records into a table.

41
New cards

What is the syntax for inserting multiple rows into a table?

INSERT ALL INTO table_name VALUES (...) INTO table_name VALUES (...) SELECT * FROM DUAL;

42
New cards

What does the UPDATE command do?

It modifies existing records in a table.

43
New cards

What happens if you run a DELETE command without a WHERE clause?

It deletes all rows from the table but keeps the structure.

44
New cards

What is the purpose of the SELECT command?

To retrieve records from a database.

45
New cards

What is the function of the WHERE clause in SQL?

It specifies filtering criteria for rows of data.

46
New cards

What does the GROUP BY clause do?

It divides data into subsets based on values in one or more fields.

47
New cards

What is the HAVING clause used for?

It specifies filtering criteria for groups of data, often using aggregate functions.

48
New cards

What is the purpose of the ORDER BY clause?

To sort the results of a query.

49
New cards

What does the OFFSET clause do in a SQL query?

It skips a specified number of rows before returning the result set.

50
New cards

What is the FETCH FIRST clause used for?

To limit the number of rows returned by a query.

51
New cards

What is a literal in SQL?

A fixed data value, such as 'Danny' or 150.

52
New cards

What is a logic error in SQL?

Code that runs but produces unintended results.

53
New cards

What is the purpose of the TRUNCATE command?

To delete all rows from a table while keeping its structure.

54
New cards

What does the COMMENT command do in SQL?

It adds notes or documentation to database objects.

55
New cards

What is the syntax for a basic SELECT statement?

SELECT column1, column2, ... FROM table_name [WHERE condition];

56
New cards

What is the significance of ending SQL statements with a semicolon?

It signifies the end of the SQL statement.

57
New cards

What SQL command is used to rename or alias columns?

Use AS to rename or alias columns.

58
New cards

How can you remove duplicates in a SQL query?

Use DISTINCT to remove duplicates.

59
New cards

What is the order of operations in SQL?

Parentheses → Multiplication/Division → Addition/Subtraction.

60
New cards

What operator is used for concatenation in SQL?

The concatenation operator is ||.

61
New cards

What is the purpose of the WHERE clause in SQL?

Filters rows using logical conditions.

62
New cards

What is the difference between WHERE and HAVING clauses?

WHERE filters individual rows; HAVING filters groups after aggregation.

63
New cards

What does the INNER JOIN do?

Joins two tables based on matching values in shared columns, excluding non-matching rows.

64
New cards

What is a CROSS JOIN?

Joins two tables without specifying common columns, producing a Cartesian product.

65
New cards

What is a LEFT JOIN?

Keeps all rows from the left table, adding NULLs for unmatched rows from the right table.

66
New cards

What is a FULL OUTER JOIN?

Keeps all rows from both tables, including unmatched rows.

67
New cards

What is a self join?

Joins a table to itself, often requiring an alias to differentiate copies.

68
New cards

What is the execution order of a SQL query?

FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY → OFFSET/FETCH.

69
New cards

What does the function COUNT() do?

Counts the number of rows in a group.

70
New cards

What does the function AVG() calculate?

Calculates the average value of a numeric column.

71
New cards

What is the purpose of the JOIN condition?

Determines how rows are matched across tables.

72
New cards

What is an equi-join?

A join type that matches rows where values are equal.

73
New cards

What is a natural join?

Joins tables automatically based on columns with the same name.

74
New cards

What is referential integrity in the context of joins?

Ensures that matching key values are valid.

75
New cards

When should you prefer JOIN...ON syntax?

For clarity and flexibility in joins.

76
New cards

What is the risk of using a natural join?

It can lead to errors if tables have homonymous fields.

77
New cards

What does the OFFSET clause do?

Skips a specified number of rows in the result set.

78
New cards

What is the purpose of the FETCH clause?

Limits the number of rows returned in the result set.

79
New cards

What is the significance of using parentheses in SQL?

They clarify the order of operations in complex queries.

80
New cards

What is the result of a CROSS JOIN?

Generates all combinations of rows from the joined tables.

81
New cards

What is the difference between mandatory and optional relationships in joins?

Mandatory requires matching rows; optional allows for unmatched rows.

82
New cards

What SQL function would you use to find the square root of a number?

Use the SQRT function.

83
New cards

What is a Right Join?

Keeps all records from the right (second) table in the join, even if there are no matching values in the left table.

84
New cards

What are Set Operators in SQL?

Used to combine the results of multiple queries into compound queries.

85
New cards

What does the UNION operator do?

Combines all rows from the results of both queries, removing duplicate rows.

86
New cards

What is the difference between UNION and UNION ALL?

UNION removes duplicates, while UNION ALL includes all duplicates.

87
New cards

What does the INTERSECT operator do?

Returns common rows from the results of both queries, removing duplicates.

88
New cards

What does the MINUS operator do?

Returns rows from the results of the first query that are not contained in the results of the second query, removing duplicates.

89
New cards

What is a Scalar Subquery?

A subquery that returns exactly one value (one row, one column).

90
New cards

What is a Rows Subquery?

A subquery that returns multiple rows from one column, often used with IN, NOT IN, ANY, or ALL.

91
New cards

What is a Table Subquery?

A subquery that returns multiple rows and multiple columns, acting as a temporary table.

92
New cards

What is a Correlated Subquery?

A subquery that depends on outer query values and runs once per row.

93
New cards

What is the execution order of compound queries?

Each query runs individually, and results are combined using the set operator.

94
New cards

What does the CASE statement do in SQL?

Evaluates conditions and returns different values depending on which condition is true.

95
New cards

Where can CASE statements be used?

Anywhere an expression is allowed: SELECT, ORDER BY, GROUP BY, WHERE, HAVING.

96
New cards

What is the purpose of using parentheses in compound queries?

To control the order of execution.

97
New cards

What is the main purpose of a Compound Query?

To combine results of multiple SELECT queries vertically (stacking rows).

98
New cards

What is the difference between a Compound Query and a Subquery?

A Compound Query combines queries side by side, while a Subquery is nested inside another query.

99
New cards

What is meant by union compatibility?

Queries must return the same number of columns and matching data types and order.

100
New cards

What does the term 'absolute filtering' refer to in SQL?

Finding instances where specific criteria are always met or never met.

Explore top flashcards

Nisäkkäät
Updated 773d ago
flashcards Flashcards (47)
31-35
Updated 79d ago
flashcards Flashcards (69)
BIOL 375 Exam 2
Updated 1026d ago
flashcards Flashcards (76)
MB3
Updated 191d ago
flashcards Flashcards (37)
Tema 6: Contexto 2
Updated 970d ago
flashcards Flashcards (30)
Emotions and moods
Updated 187d ago
flashcards Flashcards (114)
Nisäkkäät
Updated 773d ago
flashcards Flashcards (47)
31-35
Updated 79d ago
flashcards Flashcards (69)
BIOL 375 Exam 2
Updated 1026d ago
flashcards Flashcards (76)
MB3
Updated 191d ago
flashcards Flashcards (37)
Tema 6: Contexto 2
Updated 970d ago
flashcards Flashcards (30)
Emotions and moods
Updated 187d ago
flashcards Flashcards (114)