Database Concepts and SQL Queries Study Notes, Exams of Computer Science

Study notes on database concepts, including flat files, hashed files, heap files, and structured vs. Unstructured data. It covers relationships between entities, cardinality, modality, and e-r models. Additionally, it includes sql query examples for data retrieval and manipulation, covering commands like select, from, where, and operators like and, or, between, and like. The notes also touch on ddl and dml commands, offering a concise overview of database management and sql for students and professionals. Useful for university students.

Typology: Exams

2025/2026

Available from 10/14/2025

QUIZBANK01
QUIZBANK01 šŸ‡ŗšŸ‡ø

4.9

(9)

4.3K documents

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1 / 15
WGU C175 Study Notecards
1.
Flat
Files:
a
file
having
no
internal
hierarchy
2.
Hashed
Files:
A file that has been encrypted for security purposes.
3.
Heap
File:
An unsorted set of records.
4.
Information:
The
transformation
of
raw
data
into
useful
facts.
5.
Punch
Card:
A card that is perforated and can hold commands or data.
6.
Structured
Data:
Information
with
a
high
degree
of
organization.
7.
Unstructured
Data:
Information that does not have structure (such as text)
8.
Binary
Relationship:
A relationship between two entity types.
9.
Unary
Relationship:
An associate occurrence of an entity type with other occurrences of the same entity
type.
10.
Cardinality:
The
maximum
number
of
entities
that
can
be
involved
in
a
particular
relationship.
11.
E-R
Model
*E-R
=
Entity
-
Relationship:
Diagram of entities together with their attributes and the relationship among
them.
12.
Intersection
Data:
It is data that describes a many-to-many relationship.
13.
Modality:
It
is
a
minimum
number
of
entity
occurrences
that
can
be
involved
in
a
relationship.
14.
One-to-one
Binary
Relationship:
It means that a single occurrence of one entity type can be
associated with a single occurrence of the
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Database Concepts and SQL Queries Study Notes and more Exams Computer Science in PDF only on Docsity!

1 / 15

WGU C175 Study Notecards

1. Flat Files: a file having no internal hierarchy

2. Hashed Files: A file that has been encrypted for security purposes.

3. Heap File: An unsorted set of records.

4. Information: The transformation of raw data into useful facts.

5. Punch Card: A card that is perforated and can hold commands or data.

6. Structured Data: Information with a high degree of organization.

7. Unstructured Data: Information that does not have structure (such as text)

8. Binary Relationship: A relationship between two entity types.

9. Unary Relationship: An associate occurrence of an entity type with other occurrences of the same entity type.

10. Cardinality: The maximum number of entities that can be involved in a particular relationship.

11. E-R Model

*E-R = Entity - Relationship: Diagram of entities together with their attributes and the relationship among them.

12. Intersection Data: It is data that describes a many-to-many relationship.

13. Modality: It is a minimum number of entity occurrences that can be involved in a relationship.

14. One-to-one Binary Relationship: It means that a single occurrence of one entity type can be associated with a single occurrence of the

2 / 15 other entity type and vice versa.

15. Ternary Relationship: Involves three ditterent entity types.

16. Unique identifier: It is used to uniquely identify each record in a database table.

17. Attribute: A property, characteristic, or fact that we know about an entity.

18. "A salesperson works in one office."

What is the name of this relationship?: One-to-one binary relationship

19. "A salesperson sells to many customers."

What is the name of this relationship?: One-to-many binary relationship

20. "A salesperson is authorized to sell many products, and a product can be sold by many

salespersons." What is the name of this relationship?: Many-to-many binary relationship

21. What is the positioning and meaning for Cardinality and Modality on an E-R model?: Cardinality is the outer

symbol; represents the maximum. Modality is the inner symbol; represents the minimum.

22. "A salesperson works in a minimum of one and a maximum of one office, and an office may be

occupied by or assigned to a minimum of zero and a maximum of one salesperson.":

4 / 15

31. Define the delete rule SET-TO-NULL.: If the delete rule between the two relations is SET-TO-NULL and an attempt is made to delete a

record on the "one side" of the one-to-many relationship, that record will be deleted and the matching foreign key values in the records on the "many side" of the relationship will be set to null. Essentially, it's exactly like the CASCADE delete option, but instead of completely deleting all possible values, the values are set to NULL instead.

32. Which entity is uniquely identified by concatenating the primary keys of the two entities it connects?:

Associative Entity

33. Which type of entity is also called a dependent entity?: Weak Entity

34. Candidate Key: This is when a relation has more than one attribute or minimum group of attributes that represents a way of uniquely identifying

the entity.

35. Concurrency Problem: When two or more users are trying to update the same record simultaneously.

36. Equijoin: Combines two or more tables based on a column that is common to the tables.

Example: Joining Client and Salesman tables that both contain the SalesmanID column which have the exact same values.

37. Foreign Key: When an attribute or group of attributes serves as the primary key of one relation and also appears in another relation.

38. Natural Join: Matches each row in a table against each row in another table based on common values found in columns sharing a common name and

data type.

39. Tuple: Rows/records are referred to as tuples when talking about relations. They serve the exact same function, it just has a ditterent name in the context of

relations.

40. What are the five basic principles of The Database Concept?: 1. The creation of a datacentric environment that is a significant

company resource, which can be shared inside and outside the company.

5 / 15

2. The ability to achieve data integration while storing data in a non-redundant fashion.

3. The ability to store data representing entities involved in multiple relationships w/o introducing data redundancy.

4. Managing data control issues such as data security, backup and recovery, and concurrency control.

5. High degree of data independence.

41. What are the four major DBMS approaches?: - Hierarchical

  • Network
  • Relational
  • Object-oriented

42. What are four key differences between a RELATION and a FILE?: - The columns of a relation can be arranged in any

order w/o attecting the meaning of the data. That is not true of a file.

  • Similarly, the rows of a relation can be arranged in any order, which is not true of a file.
  • Every row/column position, sometimes referred to as a "cell", can have only a single value, which is not necessarily true in a file.
  • No two rows of a relation are identical, which is not necessarily true in a file.

43. * in the SELECT clause: - It indicates that all attributes of the selected row are to be retrieved

44. AND operator: - It displays a record if more than one condition is true

45. AVG() function: - It returns the average value of a numeric column.

46. BETWEEN operator: - It allows you to specify a range of numeric values in a search.

7 / 15

  • SELECT

57. Write the basic SQL query command:: SELECT FROM

WHERE

58. Write the SQL query to "Find the commission percentage and year of hire of salesperson 186":: SELECT

COMMPERCT, YEARHIRE

FROM SALESPERSON WHERE

SPNUM=186;

59. Write the SQL query to "Retrieve the entire record for salesperson 186":: SELECT

FROM SALESPERSON WHERE

SPNUM=186;

60. Write the SQL query to "List the salesperson numbers and salesperson names of those salespersons who

have a commission percentage of 10.":: SELECT SPNUM, SPNAME FROM SALESPERSON WHERE COMMPERCT=10;

61. Write the SQL query to "List the salesperson numbers, salesperson names, and commission percentages

of the salespersons whose commission percent- age is less than 12.":: SELECT SPNUM, SPNAME, COMMPERCT FROM SALESPERSON WHERE COMMPERCT<12;

62. Write the SQL query to "List the customer numbers and headquarters cities of all customers that have a

customer number of at least 1700":: SELECT CUSTNUM, HQCITY

8 / 15

FROM CUSTOMER

WHERE CUSTNUM>=1700;

63. Write the SQL query to "List the customer numbers, customer names, and headquarters cities of the

customers that are headquartered in New York and that have a customer number higher than 1500":: SELECT CUSTNUM, CUSTNAME, HQCITY FROM CUSTOMER WHERE HQCITY='New York' AND CUSTNUM>1500;

64. Write the SQL query to "List the customer numbers, customer names, and headquarters cities of the

customers that are headquartered in New York OR that have customer numbers higher than 1500":: SELECT CUSTNUM, CUSTNAME, HQCITY FROM CUSTOMER WHERE HQCITY='New York' OR CUSTNUM>1500;

65. Write the SQL query to "List the customers, customer names, and headquar- ters cities of the customers

that are headquartered in New York or that satisfy the two conditions of having a customer number higher than 1500 and being headquartered in Atlanta":: SELECT CUSTNUM, CUSTNAME, HQCITY FROM CUSTOMER WHERE HQCITY='New York' OR (CUSTNUM> AND HQCITY='Atlanta');

66. Write the SQL query to "List the customer records for those customers whose names begin with the letter 'A'

":: SELECT *

10 / 15

71. Write the SQL query to "List the NAMES of the products of which salesperson Adams has sold more

than 2000 units":: SELECT PRODNAME FROM SALESPERSON, PRODUCT, SALES WHERE SALESPERSON.SPNUM=SALES.SPNUM AND SALES.PRODNUM=PRODUCT.PRODNUM AND SPNAME='Adams' AND QUANTITY>2000;

72. CREATE TABLE command: The command that creates base tables and tells the system what attributes will be in them.

73. CREATE VIEW command: Specifies the base tables on which the view is to be based and the attributes and rows of the table that are to be included

in the view.

74. DELETE command: Specify which row(s) of a table are to be deleted based on data values within those rows.

75. DROP TABLE command: Discards an entire table from a database.

76. DROP VIEW command: Discards views.

77. Normalization: The process of organizing the fields and tables of a relational database to minimize redun- dancy (duplication) and dependency.

78. Second Normal Form: All non-key attributes must be functionally dependent on the entire key of that table.

79. Third Normal Form: Non-key attributes are not allowed to define other non-key attributes.

80. What are three important points about Third Normal Form?: 1. It is completely free of redundancy

2. All foreign keys appear where needed to logically tie together related tables.

3. It is the same structure that would have been derived from a properly drawn entity-relationship diagram of the same business environment.

11 / 15

81. Write the SQL query to "Add a new salesperson into the SALESPERSON table whose salesperson number

is 489, name is Quinlan, commission percentage is 15, year of hire is 2011, and department number is 59.":: INSERT INTO SALESPERSON VALUES ('489','Quinlan',15,'2011','59'); *Hint, this is DML, so remember that INSERT is one of the keywords for DML.

82. Write the SQL query to "Delete the row for salesperson 186 from the SALES- PERSON table.":: DELETE

FROM SALESPERSON

WHERE SPNUM = '186';

83. What is the correct syntax of the INSERT command?: INSERT INTO table_name VALUES (value1,value2,value3,...):

84. What is the correct syntax of the CREATE VIEW command?: CREATE VIEW view_name AS

SELECT column_name(s) FROM table_name WHERE condition

85. What is called a decomposition process?: Data normalization

86. In which of the normal forms should every non-key attribute be fully func- tionally dependent on the

entire key of a table?: Second form

87. What is the correct syntax of the CREATE TABLE command?: CREATE TABLE table_name (

column_name data_type(size), );

88. What is the correct syntax of the UPDATE command?: UPDATE table_name SET

column1=value1,column2=value2,... WHERE some_column=some_value;

13 / 15

  • Used for analysis and not transactional processing.
  • Data is nonvolatile.
  • Target location for integrating data from multiple sources.

97. What is the general theme of the ETL process?: 1. Get the data

2. Map the data to staging area

3. Validate and clean the data

4. Apply necessary transformations

5. Map data to loading model

6. Move data to repository

7. Load data to warehouse

98. What is the key factor based on the need for linear scalability?: Performance

99. What is used for populating summaries or any cube dimensions that can be performed at the staging area

(ETL)?: Aggregation

100. What data mining activity is a process of assigning some continuously valued numeric value to an

object?: Estimation

101. What includes exploiting the discovery of table and foreign keys for repre- senting linkage between

different tables?: Integration

102. What data mining activity is the process of organizing data into predefined classes?: Classification

14 / 15

103. Which activity groups data members that have similarities?: Clustering

104. Data Warehouse: A data warehouse is the primary source of information that feeds the analytical processing within an organization.

105. Data Mart: A data mart is a subject-oriented data repository, similar in structure to the enterprise data warehouse, but it's main purpose is to serve

directed reporting and drill down into specific data.

106. OLAP: OLAP (Online Analytical Processing) is both a process of viewing comparative metrics via a multidimen- sional analysis of data and the

infrastructure to support that process.

107. OTAP: OTAP (online transaction processing) provides a means for presenting data sourced from a data ware- house or a data mart in a way that allows the

data consumer to view comparative metrics across multiple dimensions.

108. Cartesian product: Usually the result of a missing join condition or a method of expanding the data of 1 table by the number of rows in the second

table.

109. Data volatility: Describes how often stored data is updated.

110. DCL: Data control language is used to control access to data stored in a database.

111. Definer: Definer is a MySQL term where AuthID is the same for another DBMS

112. Domain of values: The shared values between a primary key and foreign key.

113. Extraction essentially boils down to two questions:: 1. What data should be extracted?

  1. How should that data be extracted?

114. Inner join: Shows row that have matches in both tables

115. Logical view: Logical view is a mapping onto a physical table or tables that allows an end user to access only a specified portion of data.

116. Outer join: Shows rows in one table that have no match in the other table. Two kinds of outer joins are left and right joins.

117. Referential Integrity: Referential integrity is a database concept that ensures that relationships between tables remain consistent.