homework 1(DBMS)
docx
keyboard_arrow_up
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
Find how many quarts of
6%
butterfat milk and
1%
butterfat milk should be mixed to yield
100
quarts of
5%
butterfat milk.
Part 1
The mixture should contain___quarts of the
6%
butterfat milk.
The mixture should contain___quarts of the
1%
butterfat milk.
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
If there are about 5,000,000 red blood cells in every one cubic millimeter of Mrs. Garcia's blood and there are about 4, 600, 000 cubic millimeters of blood in her body. How many red blood cells does Mrs. Garcia has in her body? Write your final answer both in standard notation and scientific notation.Step 1: Write the given data found in the problem.Step 2: Determine what is asked from the problem.
Step 3: Decide on the operation and the equation to be used.
Step 4: Show your solution.
Step 5: Write your final answer.
arrow_forward
aOct 4
A knewton.com
Content attribution
Come on.
Question
Professor Hamer is on a low cholesterol diet. During lunch at the college cafeteria, he always chooses between two meals,
Pasta or Tofu. The table below lists the amount of protein and vitamins each meal provides along with the amount of
cholesterol. Professor Hamer needs at least 200 grams of protein and 40 grams of vitamins for lunch each month. Over this
time period, how many days should Professor Hamer eat the Tofu meal so that he gets the adequate amount of protein and
vitamins and at the same time minimizes his cholesterol intake? Do not include units. (Assume 30 days per month)
PASTA
TOFU
PROTEIN
8g
391
VITAMINS
CHOLESTEROL
60mg
50mg
Provide your answer below:
arrow_forward
An automobile dealer expects to sell 200 cars a year. The cars cost $9000 plus a fixed charge of $1000 per delivery. If it costs $1000 to store a car for a year, find the order size and the number of orders that minimize inventory costs.
Cars per order= ?
Orders per year= ?
arrow_forward
Organize each item into the appropriate folder.
arrow_forward
Line
Three postal workers can sort a stack of mail in 10 minutes, 35 minutes, and 70 minutes, respectively. Find how long it takes them to sort the mail if
all three work together.
The time it takes for all three to complete the job is
(Type a whole number.)
minutes.
C...
arrow_forward
help with questions 1,2,3 and 4
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
Please solve related problems in the attached file. Show every step and do not skip even one step. The right answer is already in the attached file, so I need your steps of solution. THANKS!
(PLEASE DO NOT USE HAND-WRITING)
arrow_forward
Number Systems Worksheet
Make a data table with 6 equal columns.
Column 1-write the numbers as shown below
Column 2- convert each of these numbers into a whole number or fraction
Column 3- sort these converted numbers and fractions from lowest value on top to highest
value on bottom
Column 4- convert these sorted numbers and fractions as a decimal or N/A if not applicable.
Column 5- convert these sorted numbers and fractions into scientific notation.
Do NOT reduce these numbers/fractions when converting into scientific notation.
Column 6 - write these sorted numbers and fractions with the appropriate Metric Prefix
(eg. Kilo, milli, etc. Be sure to include any numerical value if appropriate (eg. 5 Kilo, 33
milli, etc)
1. 10
2. 2x 10
3. .03
4. 2 Mega
5. .005
6.
.000001
7. 78 nano
8. 417 x 10
9. 4x 10
10. 6 Tera
11. .000000003
12..1
13. 12 x 10
14. 9,9930
15. 102
16. 37 x 10
17..00000009
18. 88 Hecto
19.77 Deka
20. 0
arrow_forward
Assignment 2
Q.1\ Suppose that I want to purchase a tablet computer. I can choose either a large or small
screen; a 64GB, 128GB, or 256GB storage capacity, and black or white cover. How many
different options do I have.
Q.2\ I need to choose a password for a computer account. The rule is that the password must
consist of two lowercase letter (a to z) followed by one capital letter (A to Z) followed by
four digits (0,1,.,9) for example, the following is a valid password: rgM2808. Find the total
number of possible passwords, N.
Q.3\ Shuffle a deck of 52 cards. How many outcomes are possible? (In other words, how
many different ways can you order 52 distinct cards?)
Q.4| I choose 3 cards from the standard deck of cards. What is the probability that these cards
contain at least one ace?
Q.5\ How many distinct sequence can we make using 3 letters "A"s and 5 letters "B"s?
(АААВВВВB, ААВBBBBA, etc.)
Q.6\ Suppose that I have a coin for which P(H)-p and P(T)=1-p. I toss the coin 5 times.
a)…
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
Write the number 240 as a sum of three numbers so that the sum of the products taken two at a time is a maximum. (Enter the three numbers as a comma-
separated list.)
arrow_forward
there is 3 parts of this question please answer all parts
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
- Find how many quarts of 6% butterfat milk and 1% butterfat milk should be mixed to yield 100 quarts of 5% butterfat milk. Part 1 The mixture should contain___quarts of the 6% butterfat milk. The mixture should contain___quarts of the 1% butterfat milk.arrow_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_forwardIf there are about 5,000,000 red blood cells in every one cubic millimeter of Mrs. Garcia's blood and there are about 4, 600, 000 cubic millimeters of blood in her body. How many red blood cells does Mrs. Garcia has in her body? Write your final answer both in standard notation and scientific notation.Step 1: Write the given data found in the problem.Step 2: Determine what is asked from the problem. Step 3: Decide on the operation and the equation to be used. Step 4: Show your solution. Step 5: Write your final answer.arrow_forward
- aOct 4 A knewton.com Content attribution Come on. Question Professor Hamer is on a low cholesterol diet. During lunch at the college cafeteria, he always chooses between two meals, Pasta or Tofu. The table below lists the amount of protein and vitamins each meal provides along with the amount of cholesterol. Professor Hamer needs at least 200 grams of protein and 40 grams of vitamins for lunch each month. Over this time period, how many days should Professor Hamer eat the Tofu meal so that he gets the adequate amount of protein and vitamins and at the same time minimizes his cholesterol intake? Do not include units. (Assume 30 days per month) PASTA TOFU PROTEIN 8g 391 VITAMINS CHOLESTEROL 60mg 50mg Provide your answer below:arrow_forwardAn automobile dealer expects to sell 200 cars a year. The cars cost $9000 plus a fixed charge of $1000 per delivery. If it costs $1000 to store a car for a year, find the order size and the number of orders that minimize inventory costs. Cars per order= ? Orders per year= ?arrow_forwardOrganize each item into the appropriate folder.arrow_forward
- Line Three postal workers can sort a stack of mail in 10 minutes, 35 minutes, and 70 minutes, respectively. Find how long it takes them to sort the mail if all three work together. The time it takes for all three to complete the job is (Type a whole number.) minutes. C...arrow_forwardhelp with questions 1,2,3 and 4arrow_forwardsimplify and show the stepsarrow_forward
- Calculate 5,6 & 7 Please do not give solution in images formatarrow_forwardThe difference between the largest and smallest values in an ordered array is called the interquartile range. Select one: True Falsearrow_forwardPlease solve related problems in the attached file. Show every step and do not skip even one step. The right answer is already in the attached file, so I need your steps of solution. THANKS! (PLEASE DO NOT USE HAND-WRITING)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
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,