Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [databases]

The tag has no usage guidance.

-1
votes
0answers
3 views

What is the time complexity for SQL Insert Statement? [on hold]

I am doing SQL Insert Statement. May I know: What is the time complexity for SQL Insert statement? Does O(m x log(n)) consider as time complexity for SQL Insert Statement? What is the best case and ...
0
votes
0answers
13 views

Analysing data from amazon textract - python [closed]

I am creating a piece of software for my company where I need to check the math on invoices we receive from companies. The pdf invoices vary from 20-100 pages. The invoice we receive from each company ...
1
vote
1answer
25 views

In a DBMS what are the implementation details that make set operations faster than cursors?

What are the low level implementation details that make set based operations exponentially faster than iterative processes, like cursors? At a memory level how does a set operation "touch" the data ...
1
vote
1answer
18 views

Adding an ordered into a relationship without violating the functional dependencies

Assuming that we have the relationship $R(A,B,C,D)$, the tuple $(W,X,Y,NULL)$ and the following functional dependencies: $$A \to C$$ $$A \to B,D$$ is it possible to insert a tuple with $NULL$ values,...
1
vote
1answer
21 views

Find candidate keys given functional dependencies

In my database class we practiced how to find the candidate keys, given the functional dependencies. However they were easy examples, based on a single attribute being functionally dependent on a ...
1
vote
1answer
37 views

How to find highest normal form of a relation, given its functional dependencies

Let's say that I have a relational model, defined as: $$X(A,B,C,D,E,F,G)$$ with the functional dependencies: $$f_1: \{A,B,C\} \to \{D,E,F,G\}$$ $$f_2: \{A,B\} \to \{C\}$$ Using this information I ...
0
votes
0answers
17 views

Need an optimized way to handle combination of entities to improve performance

So, I am working on a feature in a web application. The problem is like this- I have four different entities. Let's say those are - Item1, ...
0
votes
0answers
20 views

Doubt on Lossless or Lossy Decomposition

Consider a relation $R\left ( A,B,C,D,E \right )$ and functional dependencies are  $F=\left \{ AC\rightarrow B,C\rightarrow D,A\rightarrow E,C\rightarrow B \right \}$ Relation $R$ is decomposed into ...
0
votes
0answers
12 views

Doubt on the definition of Partial funtional dependency

I have some doubt regarding the definition of partial functional dependency. According to the book Fundamentals of Database Systems by Elmasri and Navathe the definition of partial functional ...
2
votes
1answer
115 views

Why do OS and DBMS have their own synchronisation mechanisms, when OS can alone do it and it sits at the bottom of DB?

I know that synchronization is important in the OS, but why do we need a separate topic synchronization and concurrency in the DBMS? The OS concentrates on program synchronization while the DBMS ...
0
votes
0answers
26 views

Relational Database to Aggregate Data Model

Can any application currently using a relational database be rewritten to use an Aggregate Data Model, by Focusing on data modelling aspects only (ignoring other features like salability or ...
1
vote
0answers
28 views

How do I implement fixed block storage file system in database from typical file-level file system?

I've a typical parent ID based file system in database and files are physically stored on disks. What I want is to store files in blocks (4096K) of fixed size. Chunking can be used I found, but how ...
0
votes
0answers
20 views

Understanding non repeatable read anomaly in databases

This paper discusses in detail ANSI isolation levels discussed in ANSI SQL standard on page 84. Paper introduces following shorthand for describing histories which contain reads, writes, commits and ...
0
votes
0answers
39 views

When cascadeless and / or recoverable schedules can contain blind writes?

Some quick definitions / theory: If instructions $I_i$ and $I_j$ of two different transactions operate on same data item and if any of them is a write operation then they are conflicting ...
1
vote
0answers
16 views

Understanding connection between different database concurrency control protocol

I have came across following diagram related to timestamp based concurrency control protocols in database systems: I don't know whether its correct or not. As per my interpretation, it means all ...
1
vote
0answers
25 views

Understanding validation based database concurrency control protocol

Database book by Korth explains validation protocol as follows : To perform the validation test, we need to know when the various phases of transactions took place. We shall, therefore, associate ...
0
votes
1answer
68 views

Why “ every non-prime attribute of R is non-transitively dependent on every key of R” in the original def of 3NF?

I have read the definition in of Third_normal_form here , which shows The third normal form (3NF) is a normal form used in database normalization. 3NF was originally defined by E.F. Codd in 1971.[2]...
1
vote
0answers
23 views

Why don't RDBMS use a quorum based solution to do failover

For RDBMS viz. MySql, PostgreSql a common solution for scalability and high availability is to run a primary instance as master that is a read-write instance and one or more read replicas. If the ...
0
votes
1answer
45 views

Doubt regarding foreign key and referential integrity

I am studying database from Database System Concepts. The author was explaining foreign keys and referential integrity with the help of following schemas: $$ instructor(\underline{ID},\space name,\...
0
votes
0answers
8 views

view serialisable and conflict serialisable

I recently was solving some problems on these topic and realised that in cases where conflict serialisable schedule existed; the number of view serialisable schedule was actually equal to the number ...
0
votes
0answers
53 views

When BCNF decomposition preserves Functional Dependencies?

It is known that BCNF decomposition does not preserve functional dependencies (FDs). For example, for FDs on R(A,B,C), ...
0
votes
3answers
78 views

Functional Dependencies

Let relational schema R(A,B,C,D,E,F,G,H,I). The functional dependencies are: A -> BC, AD -> BE, C ->F , A->F , D-> E Find the number of non-trivial functional dependencies ? I know that R has only ...
0
votes
0answers
74 views

How are these two definitions of the Third Normal Form (3NF) equivalent?

According to the textbook by Silberschatz, A relation schema R is in third normal form with respect to a set $F$ of functional dependencies if, for all functional dependencies in $F^+$ of the form $\...
0
votes
0answers
75 views

Any Recoverable schedule which is not a Cascadeless schedule?

When I read about Cascadeless schedule, it says "Every Cascadeless schedule is also recoverable schedule." and the examples are also almost same. I want to know an example of Recoverable schedule ...
0
votes
0answers
10 views

Is a schedule with autocommit and no aborts automatically recoverable?

As in the title, since we won't have problems with cascading aborts and each transaction is committed automatically, doesn't this mean that the schedule will always be recoverable?
0
votes
1answer
29 views

Given a relation and asked to enumerate all FD's and mark the trivial FD's

Given a relation R(A,B,C) and a FD set (A->B, B->C), find the FD Closure. Enumerate all the FD's and organize them accordingly to the LHS of the FD's. Mark all the trivial FD's. I am a little ...
0
votes
1answer
21 views

Maximum join of relations

I have a question as follows Consider the relations $r1(P, Q, R)$ and $r2(R, S, T)$ with primary keys $P$ and $R$ respectively. The relation $r1$ contains $2000$ tuples and $r2$ contains $2500$ ...
0
votes
1answer
74 views

How to decompose into BCNF while preserving all functional dependencies

I have a relation R = {A,B,C} and F={AB -> C , C -> B}. In order to check if R is in BCNF. I checked if AB and C are both superkeys and since C is not a superkey I conclude R is not in BCNF. After ...
1
vote
1answer
86 views

Is my decomposition of R into 3NF is lossless and preserving all dependencies?

I have a schema R = {A,B,C,D,E} and the set F of FDs: F = {A --> BCDE, CD --> E, EC --> B}. Candidate key = A Non - Prime Attributes = BCDE Prime Attributes = A According to me, there is no partial ...
0
votes
1answer
38 views

Did Date and Darwen's “Third Manifesto” have a lasting impact?

In 1995, two DB theory researchers, C.J. Date and H. Darwen, published a text with the rather impressive-sounding name "The Third Manifesto" with their ideas regarding future DBMSes, which would ...
-1
votes
2answers
269 views

Is it possible to do a NULL comparison in Relational Algebra?

Please consider the following question given in a booklet: I have read about databases from Database System Concepts - by Henry F. Korth, but never saw an instance where we could do a NULL comparison ...
1
vote
1answer
59 views

Raft algorithm: What's the data format of `term`?

Time is divided into terms, and each term begins with an election. After a successful election, a single leader manages the cluster until the end of the term. Some elections fail, in which case the ...
1
vote
0answers
67 views

How to determine conflict serializability without read and writes

I'm learning about conflict serializability in an introduction to databases class. I know how to check if a schema of transactions is conflict serializable when there's reads and writes. Draw the ...
1
vote
0answers
26 views

normalization: how does nf work?

I once did normalization for my Computer Science project, and I had to turn 0NF to 1NF, 2NF and 3NF. What must we actually do to convert 0NF to 1NF, 2NF and 3NF? Must we rearrange the information and ...
1
vote
0answers
22 views

Merge unstructured with structured data

We have a database with well-formated and structured data. From time to time we get Excel - files from our clients. This Excel Files have to be imported to the database. It it very important that we ...
-2
votes
1answer
36 views

How to find information quickly in a table

I have a table and asked me to add my information to it. And then asked me to find my information in the easiest way (after adding your details to the table, assume that the table is arranged ...
0
votes
0answers
92 views
0
votes
1answer
80 views

Where do you exactly use data structures?

I know what data structures is, How it works & importance of it. I just have some doubts on where do we actually use it. When database can do filtering, fetching, sorting efficiently, Why we ...
-3
votes
2answers
244 views

How many candidate keys are there in the table shown below?

One candidate key is (report_no, author_id). What are the other candidate keys?
0
votes
1answer
54 views

Checking claim in paper “A Read-Only Transaction Anomaly Under Snapshot Isolation” by Alan Fekete et al

In the 2004 paper "A Read-Only Transaction Anomaly Under Snapshot Isolation" by Alan Fekete et al. (which can be found here and here) the authors state: We also note that any execution of T1 and T2 ...
0
votes
1answer
60 views

What are the essential differences and similarities among “data”, “Information” and “knowledge” in the context of Computer Science?

The terms "data", "information" and "knowledge" are quite interchangeably used in Computer Science. Strictly speaking, they do carry a very different meaning. I want to know their precise meanings and ...
0
votes
1answer
28 views

Is relation following given characteristic already in 2NF, 3NF and BCNF?

The definitions of 2NF, 3NF and BCNF goes like this: 2 Normal Form (NF) definition A relation is in second normal form if and only if it is in first normal form and all the non-key attributes ...
0
votes
1answer
120 views

Use of existential quantifier in tuple relational calculus

It is somewhat confusing to me when to use quantifiers in tuple relational calculus (TRC). I stumbled upon following problem and I am still scratching my head thinking why not TRC query can be ...
-2
votes
1answer
129 views

Query Super Type and Subtype in Mysql

Assuming I have a schema depicted in the image , showing relationships(specialization) between Staffs, Academic Staffs and Non Academic Staffs. Is it possible to have a query that retrieves the ...
0
votes
0answers
105 views

Data structure for a single elimination tournament and its implementation

I want to implement a tournament managing software , something like challonge(https://challonge.com/) and am currently stuck at the data structure to be used. I read up on tournament trees and a ...
0
votes
0answers
78 views

Databases - How to generalize an sql query from a specific input? find project number, number of employees

Schema: http://comet.lehman.cuny.edu/jung/cmp420758/DBMidexamFa14-SelectedSolution.pdf Write SQL code to find the following details: For each project: find the project number and the number of ...
2
votes
1answer
84 views

Fastest way to search a word in a word list?

I have a word list like "English Open Word List" used to create word games. The list is in txt file with space between words, like; aa aah aahed .........and so on. I want to search it while typing ...
4
votes
0answers
33 views

Any elegant approach to search where users have permissions on subset of records?

I work in Search and have seen following problem appear in different forms. There are many users in an enterprise; they have ability to create records. Each user has variable level of access to some ...
-1
votes
1answer
141 views

What is the equivalent form of full outer join in relational algebra?

Considering only basic relational algebra operations, how can we implement the full outer-join ?
2
votes
1answer
87 views

How to do compare-and-increment different locations with in memory MVCC?

I'm reading the paper An Empirical Evaluation of In-Memory Multi-Version Concurrency Control which is about implementations of MVCC for in-memory databases. Section 3.3 on Two-phase Locking (MV2PL) ...