homework 1(DBMS)
docx
School
California State University, East Bay *
*We aren’t endorsed by this school
Course
610
Subject
Statistics
Date
Feb 20, 2024
Type
docx
Pages
12
Uploaded by DrWorld13108
BAN 610 Problem set 1 – Normalization, ERD, Consistency, and Recovery
Edit your submission in this word document, attaching the screenshots of the codes
used for each question. Include narrative descriptions, outputs screenshot, or short
answers when requested.
Task 1
Suppose we are processing 100 data records on a CPU cache. Each data record is
32 bytes in size. And each I/O operation will fetch a 64-byte cache line. Suppose the 100 data records on the cache are contiguously stored.
In this case, is sequential reading faster than random reading? How much faster?
What if each data record is 64 bytes in size instead of 32 bytes?
Sequential reading is faster than random reading. As when we read sequentially, we will utilize each cache line but, random reading will incur more cache misses as it is not efficiently using the cache lines. So, while reading 64 bytes for every 32 bytes we need, we expect to max out the throughput at least 2x, it will fetch includes two consecutive data records at once.
If each data record is 64 bytes in size instead of 32 bytes, sequential and random reading would perform similarly in terms of cache utilization. The main difference would be related to the order in which data records are accessed.
Task 2
Suppose you are hosting a database server. A table in your database is accessed 20 times / sec on average. The size of the table is 1 GB. The hard drive allocated to store this table cost $10, and the throughput of the hard drive is 100 MB / sec.
The memory of your server cost $20 / MB. Should you keep the table on the hard disk or in memory?
Hint: calculate or identify what is the D, I, X, M, and P in the five-minutes rule formula.
Cdisk = D/(IX)
D = $10
I = 20 (database is accessed 20 times/sec meaning it can do 20 operations per second)
X = 1/20 (database is accessed 20 times/sec meaning it’s getting accessed in every 1/20 seconds)
Cdisk =10/ (20 * 1/20) = $10
Cmem = M/P
M = $20/MB
P = 1 (assuming it holds 1 page)
Cmem = 20/1 = $20
As, Cmem > Cdisk we should not keep the table in memory.
As the cost of storing the table in memory is more than the cost of storing it on the hard disk, it will be more cost-effective to store the table on the hard disk.
Task 3
We are looking to optimize our database performance by delaying the output of frequently used objects. In the following chart, the object X is frequently accessed by many transactions, and we must repeatedly read X from the disk to memory, update the value of X in memory, and then flush the updated value of X to the disk.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
As you can imagine, this is very inefficient because it results in a lot
of I/Os, which takes a long time.
Please design a better workflow to reduce the number of I/Os for frequently accessed values (considering using pseudocodes). Hint: think about pre-scanning the transactions
before executing it, and based on that, optimize the transactions
. A better workflow to access object X is storing x into memory (cache). This way we can reduce the number of I/O operations.
When object X is accessed by transaction, the database checks if it is in the
cache.
If X is present in the cache, it will directly return to the transaction, remove the need for a disk I/O and if X is not present in the cache, database recovers it from disk and keeps it in the cache before returning it to transaction.
When transaction updates the value of X, the database updates the cache and marks X as dirty, this indicates that block has modified but has not saved, it needs to be flushed to disk at some point.
The database regularly flushes dirty values from the cache to disk, this reduces the number of unnecessary I/O operations.
Task 4
We have a table below:
Note that branch No is the primary key of this table.
Please answer the following questions:
1.
What is the normal form of the table, why?
To determine the normal form, we need to check the table to see that the intersection of every column and record contains only one value or atomic value (1NF), and transitive dependencies and partial dependencies (2NF, 3NF). This the table is not in normal form. separating the table into two parts branch and branch telephone.
2.
Normalize the table to 3NF.
3.
Identify the primary keys and foreign keys in the 3NF relations.
The primary key in the branch table is branch no. In the branch address table branch no. primary key in the tables.
Task 5
We have a table below:
Note that staffNo and branchNo are the composite primary key of this table.
Also note that each member of staff works in each branch for a different hoursPerWeek.
1.What is the normal form of the table? Why?
To determine the normal form, we need to check the table to see that the
intersection of every column and record contains only one value or atomic value
(1NF) the table is in 1NF, but there is transitive dependencies and partial
dependencies. This the table is not in (2NF, 3NF). To normalize this table we need
to make three separate tables.
2.Normalize this table to 3NF and mark the primary keys and foreign keys.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Task 6
We have a table below (telNo is the branch telephone number):
Please answer the following questions:
1.
What is the normal form of the table? Why
To determine the normal form, we need to check the table to see that the intersection of every column and record contains only one value or atomic value (1NF) the table is in 1NF, partial dependencies 2NF. This the table is not
in (3NF) in which all non-primary-key column can be worked out from only the primary key column(s) and no other columns.
2.
Normalize this table to 3NF and mark the primary keys and foreign keys
Task 7
Please normalize the in the book loan table in Excel file, and then screenshot the output.
In this book loan system. Each unique Book_Title has a unique Book_ISBN, but many different Book_Call_No (a title in the library usually has multiple copies). It is possible for a student to borrow multiple book copies (identified by Book_Call_No) at one time or borrow the same book copies across different times.
This normalization eliminates data redundancy and allows for efficient storage and management of student and book-related information.
Task 8
Please draw ER diagram and convert it into relational schema:
1.
Each supermarket branch restocks products with multiple suppliers. Each supplier supplies products to multiple supermarket branch. The supermarket branch has attributes BID, and Location; each supplier has attribute SID, and location. 2.
Each supermarket branch hires many inventory managers to manage the product restocking. One inventory manager can only be hired by one supermarket branch. Each inventory manager is responsible for coordinating with only one supplier to restock the products. However, each supplier may work with multiple inventory managers at the same time. The supermarket branch has attributes BID, and Location; each inventory manager has attribute MID and name; each supplier has attribute SID, and location. Many to many relationships: the supermarket branch restocks products with multiple suppliers. Each supplier supplies products to multiple supermarket branchs.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Task 9
We store 8 same-sized data blocks (A1, A2, … A8) in three different storage architectures:
(1) In a single disk A1
A2
A3
A4
A5
A6
A7
A8
(2) In RAID 0 using two disks
A1
A3
A5
A7
A2
A4
A6
A8
(3) In RAID 1 using two disks
A1
A2
A3
A4
A5
A6
A7
A8
A1
A2
A3
A4
A5
A6
A7
A8
Suppose reading one block from the disk to the memory takes 1ms, what is the time needed to read A1, A2, A3, and A4 to the memory in each of the three-storage architecture? Ignore seeking time rotary latency.
In a single disk - it would take 4ms to read A1, A2, A3, and A4.
In RAID 0 - it would take 2ms to read A1, A2, A3, and A 4 simultaneously.
In RAID 1- it would take 2ms to read A1, A2, A3, and A 4 because we read from one of the mirrored disks. Task 10:
We are using undo/redo logging to recover the database after a system crash. The log on the disk looks like the following:
...
<T1, A, 10, 15>
<T1, end>
<checkpoint>
<T2, start>
<T2, A, 39, 10>
<T3, start>
<T3, B, 20,14>
<T3, commit>
<T2, C, 50, 20>
<T4, start>
<T3, end>
<T4, D, 12, 13>
<T2, commit>
Crash
How to recover the database (do you redo, undo, or ignore T1, T2, T3, and T4)? and what are the values of A, B, C, and D before and after the recovery (if the value is
unsure, type “unknown”)?
Please fill the two tables below.
Transaction
Recover Plan (redo, undo, or ignore)
T1
ignore
T2
Redo
T3
ignore
T4
Undo
Value
Value before Recovery
Value after Recovery
A
Unknown
39
B
14
20
C
Unknown
50
D
13
13
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Documents
Related Questions
Knowledge.Booster
arrow_forward
A family has two cars. The first car has a fuel efficiency of 40 miles per gallon of gas and the second has a fuel efficiency of 30 miles per gallon of gas. During
one particular week, the two cars went a combined total of 1650 miles, for a total gas consumption of 45 gallons. How many gallons were consumed by each of
the two cars that week?
Note that the ALEKS graphing calculator can be used to make computations easier.
Example
First car:gallons
Second car: gallons
Check
Save For Later
Submit Assignment
2021 McGr Edton Agns
Tarmsof Une Py 12
24
7]
a
g
V
alt
alt
ctrl
arrow_forward
Organize each item into the appropriate folder.
arrow_forward
Parts b and c please.
arrow_forward
simplify and show the steps
arrow_forward
Calculate 5,6 & 7 Please
do not give solution in images format
arrow_forward
The difference between the largest and smallest values in an ordered array is called the interquartile range.
Select one:
True
False
arrow_forward
How many instructions do i need in all?
arrow_forward
A manager of an oil refinery has 8 million barrels of crude oil A and 5 million barrels of crude oil B allocated for production during the coming month. These resources can be used to make either gasoline, which sells for $38 per barrel, or home heating oil, which sells for $33 per barrel. The three production processes have the characterstics in the pictured table. All quantities are in barrels. For example, with the first process, 3 barrels of crude A and5 barrels of crude B are used to produce 4 barrels of gasoline and 3 barrels of heating oil at a cost of $51. Formulate a linear programming problem that would help the manager maximize net revenue over the next month. Re-write this LP problem using matrix-vector notations.
This problem is an example from lecture that was never solved.
arrow_forward
The Gotham City Police Department employs 30police officers. Each officer works 5 days per week. Thecrime rate fluctuates with the day of the week, so the numberof police officers required each day depends on which dayof the week it is: Saturday, 28; Sunday, 18; Monday, 18;Tuesday, 24; Wednesday, 25; Thursday, 16; Friday, 21. Thepolice department wants to schedule police officers tominimize the number whose days off are not consecutive.Formulate an LP that will accomplish this goal. (Hint: Havea constraint for each day of the week that ensures that theproper number of officers are not working on the given day.)
arrow_forward
Sub parts 9 and 10
arrow_forward
solve. use a graphing calculator table or a graph to verify your work
40x= -16x2-25
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you

Elementary Geometry for College Students
Geometry
ISBN:9781285195698
Author:Daniel C. Alexander, Geralyn M. Koeberlein
Publisher:Cengage Learning

Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell

Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,
Related Questions
- Knowledge.Boosterarrow_forwardA family has two cars. The first car has a fuel efficiency of 40 miles per gallon of gas and the second has a fuel efficiency of 30 miles per gallon of gas. During one particular week, the two cars went a combined total of 1650 miles, for a total gas consumption of 45 gallons. How many gallons were consumed by each of the two cars that week? Note that the ALEKS graphing calculator can be used to make computations easier. Example First car:gallons Second car: gallons Check Save For Later Submit Assignment 2021 McGr Edton Agns Tarmsof Une Py 12 24 7] a g V alt alt ctrlarrow_forwardOrganize each item into the appropriate folder.arrow_forward
- The difference between the largest and smallest values in an ordered array is called the interquartile range. Select one: True Falsearrow_forwardHow many instructions do i need in all?arrow_forwardA manager of an oil refinery has 8 million barrels of crude oil A and 5 million barrels of crude oil B allocated for production during the coming month. These resources can be used to make either gasoline, which sells for $38 per barrel, or home heating oil, which sells for $33 per barrel. The three production processes have the characterstics in the pictured table. All quantities are in barrels. For example, with the first process, 3 barrels of crude A and5 barrels of crude B are used to produce 4 barrels of gasoline and 3 barrels of heating oil at a cost of $51. Formulate a linear programming problem that would help the manager maximize net revenue over the next month. Re-write this LP problem using matrix-vector notations. This problem is an example from lecture that was never solved.arrow_forward
- The Gotham City Police Department employs 30police officers. Each officer works 5 days per week. Thecrime rate fluctuates with the day of the week, so the numberof police officers required each day depends on which dayof the week it is: Saturday, 28; Sunday, 18; Monday, 18;Tuesday, 24; Wednesday, 25; Thursday, 16; Friday, 21. Thepolice department wants to schedule police officers tominimize the number whose days off are not consecutive.Formulate an LP that will accomplish this goal. (Hint: Havea constraint for each day of the week that ensures that theproper number of officers are not working on the given day.)arrow_forwardSub parts 9 and 10arrow_forwardsolve. use a graphing calculator table or a graph to verify your work 40x= -16x2-25arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Elementary Geometry for College StudentsGeometryISBN:9781285195698Author:Daniel C. Alexander, Geralyn M. KoeberleinPublisher:Cengage LearningAlgebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal LittellMathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,

Elementary Geometry for College Students
Geometry
ISBN:9781285195698
Author:Daniel C. Alexander, Geralyn M. Koeberlein
Publisher:Cengage Learning

Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell

Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,