The database-theory tag has no wiki summary.
6
votes
1answer
456 views
Find the highest graded student, using Tuple Relational Calculus
Suppose I have a table of students, containing their ID and their grade:
-----------------
| id | grade |
-----------------
| 1 | 83 |
| 2 | 94 |
| 3 | 92 |
| 4 | 78 |
...
0
votes
2answers
50 views
What does <> mean in Relational Calculus?
I saw a Tuple Relational Calculus formula, and it contained the symbol <>
I couldn't find any reference to it anywhere - can anyone tell me what this means?
(perhaps this question will be a ...
0
votes
1answer
39 views
Database design implementing support for different languages [closed]
Today I was practicing database design, for example I was trying to build a database design where I would like to store my favorite shows. I have normlaised this database to the third form (at least I ...
1
vote
0answers
35 views
How to merge rows based on how much data they have?
I am cleaning data and I formed a table something like this:
file | product | color | product_id
---------------------------------------------
one.csv pipe blue null
...
1
vote
1answer
64 views
Why add indexes to these columns in the Database?
I am trying to get my head around this code. It's from the Rails Tutorial Book and is part of the process of making a twitter like application.
class CreateRelationships < ...
4
votes
1answer
89 views
Probable circular dependency, but query still runs
I built this ER diagram in MySQL Workbench and it will run and generate the database. My concern is that the relationship between the employees, departments, positions, and employment_statuses is a ...
7
votes
4answers
259 views
how to explain indexes
This question is about teaching: When I learned databases, we talked about indexes being like the card catalog in the town library. We had at least an author index, a title index, then the Dewey ...
-1
votes
2answers
136 views
Relationship between professor and course [closed]
I'm designing a database where I have a Course table and and Professor table.
The business rules are :
1) A professor can teach many courses. (This is obvious).
However, I get stuck in the second ...
1
vote
0answers
45 views
Where should a default setting field be?
I am creating a database to track occurrences of incidents on buses based on an existing system. Currently the drivers can set a default bus number, which is used to pre-populate the bus number on the ...
0
votes
1answer
97 views
Database with insert data every 2 minutes
I have a site to develop into PHP and mysql where I take, with a cron, every two minutes 10 xml from a server parse each and insert data into my database.
Well this data are simple string (maximum 10) ...
-4
votes
0answers
58 views
Why is LRU is not suitable for joining 2 relations in DBMS [closed]
In DBMS, can someone please explain how the LRU (least recently used) buffer replacement policy acts when joining 2 relations in a database?
I have read that LRU is not efficient when joining two ...
1
vote
1answer
87 views
Approach for a 2,000 table migration
What might be the best approach when converting or migrating a database containing over 2,000 tables? Where would you begin to tackle such an issue? Steps to take in the first weeks of designing? ...
0
votes
3answers
75 views
Column partially determining accepted values of another column, should be somehow normalized?
I have a table that describes a set of properties (yes it's metadata, in this case there's a valid reason to have it in the database); among other things I tell the type of the data that can be ...
1
vote
1answer
47 views
Adding users to a list and sort by category?
I'm using SQL-Server 2012 and I would like to know how to solve this program.
So:
I want to create a page that allows admins to manage a project, and part of it, would be to add members/employees to ...
0
votes
2answers
75 views
Multiple instances in Oracle
I'm really confuse with the term instance and database. So, my first question is how database and Instance are related in Oracle, I mean, whether an instance is associated with one/multiple ...
1
vote
0answers
69 views
Closure of attributes definition clarification
A databases book I am using states [1]:
The closure of {A1, A2, ..., An} under the FD's in S is the set of attributes B such that every relation that satisfies all the FD's in set S also satisfies ...
-1
votes
1answer
151 views
How can I move 5 GB data from one database to another faster?
I'm using MySQL as database with Windows server. I'm having 5 GB of data in database. Now I need to change my server and the question is that how can I transfer complete 5 GB data to one mysql ...
0
votes
0answers
42 views
Examples of a database with no consistency measures that ensures consistency through schema alone
To clarify, the database can be any type RDBMS, NoSQL/BigTable. However, it must not employ any usual consistency measures such as locks, or synchronization, but the inconsistency-invincibility must ...
0
votes
0answers
88 views
In DBMS binary relationship is better than ternary
For which reasons (Features/points) binary relationship is better than ternary one in Database ER modeling? I got something by searching in website but those are not precise and meaningful!
1
vote
2answers
253 views
Reflexivity axiom for inferring functional dependencies
As you know there are three Armstrong's Axioms for inferring all the functional dependencies on a relational database. (X, Y and Z are set of attributes)
Reflexivity: If X ⊆ Y, then Y → X
...
2
votes
1answer
150 views
Deriving formulas for input/output
I'm currently enrolled in a DBS class and am having problem with an assignment. I've searched around and have been unable to understand what it is I'm meant to be doing with this derivation formula.
...
0
votes
1answer
347 views
Keep total transaction in invoice application
I want to make an application called as Invoice Application with MySQL database. Now I have designed this database. Now I want to know is this database good for Invoice Application. I will use MySQL ...
1
vote
1answer
923 views
Planning simple CMS: How much relation?
I'm currently in the process of designing the database for a rather minimalistic Content Management System I'm working on alone. It should allow scalability while remaining speed, especially on boxes ...
-1
votes
2answers
146 views
Information sources for multiple hierachy trees in a single table
I need some quality sources - books, websites etc. - to educate myself about putting multiple hierarchy trees in a single table using SQL.
I'm looking for some good theoretical and practical ...
0
votes
1answer
132 views
Database column vs row size
I have Column A and Column B in a single table.
I need to add 1,000,000 records to this table.
I have 2 options:
Keep 2 columns and add 1,000,000 records
Add more columns and flatten out the ...
3
votes
2answers
178 views
how is synchronization maintained between different write and read database
One of my friends was asked this question in interview. Given two different databases one on which only write is done and the other on which only read is done. How does one maintain synchronization ...
3
votes
5answers
935 views
Does 'Cities' deserve a separate table?
I have the following Customers table:
customer_id - int
company_name - nvarchar
street - nvarchar
city - nvarchar
comments - nvarchar
The app will only be used in part of one small country ...
2
votes
1answer
462 views
Under what conditions are polymorphic associations used? What are the alternatives?
As I understand it, polymorphic relationships among tables in a database allow one table to have one foreign key that references many tables.
I have found that tags are a common application of this ...
3
votes
4answers
159 views
Complete list of possible database “objects”?
When I finished my degree in Programming and Database I remember there being a general list of database "objects" like this:
data types (a list unto itself)
fields
records
tables
views (sort of like ...
8
votes
4answers
324 views
What is a database?
There was lot of discussion in this question: What database technologies do big search engines use?
So much discussion that it made me confused. So... what is a database, anyway? Are only relational ...
3
votes
1answer
219 views
to what “scale” of applications does nosql support?
Recently i came across the Nosql database concept, though i learnt how to and why of it, i did not get a proper answer to the question , to what scale of project does it support?
Will it support ...
2
votes
1answer
223 views
Postgres synchronized backup - what's with the archive?
I am setting up a Postgres 9.1 master and a hot standby-server. I read the documentation but I'm not quite sure yet what I should do with my WAL files.
Every commit is done on both servers before ...
3
votes
2answers
613 views
Ready-to-Use Database models example
Where can I find ready-to-use database models ?
I don't need a database with data in it, but only schemas (UML diagrams). Perhaps something like the data models at this link, but much more complex ...
1
vote
1answer
168 views
Is an anomaly free relation necessarily normalized?
A normalized relation can still suffer anomalies. Going the other way, which (if any) normal forms can be violated by a relation that's free from anomalies? If such exist,
For each such normal form ...
0
votes
3answers
376 views
SQL Server : primary keys advice to my whitepaper needed
I've tired to explain to every new junior developer in our r&d team why he should use Primary Keys and how to do that. So I decided to write small whitepaper, which every new developer should ...
1
vote
1answer
111 views
Overlapping Transactions
Apolgies in advance if this has been discussed before, or is even fundamental enough for it to be outlined on, say, Wikipedia. I just felt that asking would be more efficient!
Anyway, I want to ask ...
5
votes
3answers
2k views
Why are NULLs sorted first?
Why is it that when we have a NULL value in a column and we order by the value ascending, the NULLs are sorted first?
select 1 as test
union all
select 2
union all
select NULL
union all
select 3
...
7
votes
1answer
528 views
Is DB Normalization done purely based on the primary key or is it done based on all the candidate keys?
I have come across two flavours of the normalization procedure while referring the internet and textbooks. viz.
Type 1. Normal forms based only on the primary key.
In this type,
-> 2NF disallows ...
4
votes
2answers
558 views
Right Full Outer Join Query
I came across 1 query which is
Select * from R Natural Outer Join S
Where R=(A,B) has tuples {(1,2),(1,2),(3,4)} and S=(B,C) has tuples {(2,5),(2,5),(4,6),(7,10)}.
To implement this I created 2 ...
2
votes
2answers
956 views
Does the SELECT statement count into DML?
Looking at the name Data Manipulation Language (DML) I would assume, that all contained statements are actually for manipulating data.
As far as I know the SELECT statement can only be used to query ...
39
votes
5answers
9k views
When to use TINYINT over INT?
In general, I always use Ints. I know that in theory this is not the best practice, though, since you should use the smallest data type that will be guaranteed to store the data.
For example, it's ...
3
votes
1answer
372 views
Transaction and data consistency during a failure
When a database begins a transaction, all statements executed in that transaction are isolated and atomic (and consistent and durable). These are pretty much the definition of a transaction.
...
16
votes
1answer
545 views
What is the reasoning behind the CAP theorem?
http://en.wikipedia.org/wiki/CAP_theorem
http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf
I think it is not very straightforward why only two of
Consistency
Availability
Partition ...
9
votes
8answers
350 views
Pioneers in Database Research
Who all people have made life changing contributions to database research? I want to know more about them.