Questions tagged [database]

A database is an organized collection of data. It is the collection of schemas, tables, queries, reports, views, and other objects. The data are typically organized to model aspects of reality in a way that supports processes requiring information. Use this tag if you have questions about designing a database. If it is about a particular database management system, (e.g., MySQL), please use that tag instead.

From Wikipedia:

A database is an organized collection of data. It is the collection of tables, queries, reports, views and other objects. The data is typically organized to model aspects of reality in a way that supports processes requiring information, such as modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies.

A large proportion of websites and applications rely on databases. They are a crucial component of telecommunications systems, banking systems, video games, and just about any other software system or electronic device that maintains some amount of persistent information. In addition to persistence, database systems provide a number of other properties that make them exceptionally useful and convenient: reliability, efficiency, scalability, concurrency control, data abstraction, and high-level query languages. Databases are so ubiquitous and important that computer science graduates frequently cite their database class as the one most useful to them in their industry or graduate-school careers.2

The term database should not be confused with Database Management System (DBMS). A DBMS is the system software used to create and manage databases and provide users and applications with access to the database(s). A database is to a DBMS as a document is to a word processor.

Database Languages

Database languages are special-purpose languages, which do one or more of the following:

###ACID In computer science, ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties of database transactions.

  1. Atomicity - Atomicity requires that each transaction be "all or nothing": if one part of the transaction fails, then the entire transaction fails, and the database state is left unchanged. An atomic system must guarantee atomicity in each and every situation, including power failures, errors, and crashes. To the outside world, a committed transaction appears (by its effects on the database) to be indivisible ("atomic"), and an aborted transaction does not happen.

  2. Consistency - The consistency property ensures that any transaction will bring the database from one valid state to another. Any data written to the database must be valid according to all defined rules, including constraints, cascades, triggers, and any combination thereof. This does not guarantee correctness of the transaction in all ways the application programmer might have wanted (that is the responsibility of application-level code) but merely that any programming errors cannot result in the violation of any defined rules.

  3. Isolation - The isolation property ensures that the concurrent execution of transactions results in a system state that would be obtained if transactions were executed serially, i.e., one after the other. Providing isolation is the main goal of concurrency control. Depending on the concurrency control method (i.e., if it uses strict - as opposed to relaxed - serializability), the effects of an incomplete transaction might not even be visible to another transaction.

  4. Durability - The durability property ensures that once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors. In a relational database, for instance, once a group of SQL statements execute, the results need to be stored permanently (even if the database crashes immediately thereafter). To defend against power loss, transactions (or their effects) must be recorded in a non-volatile memory.

A few notable DBMSs:

Popular Database tools

Some useful references:

Free online database courses:

193843 questions
38
votes
6 answers

Are there any ORM tools for Haskell?

What is the best way to interact with a database using Haskell? I'm accustomed to using some sort of ORM (Django's ORM, hibernate, etc.) and something similar would be nice when creating apps with HAppS. Edit: I'd like to be free to choose from…
rcreswick
  • 16,483
  • 15
  • 59
  • 70
37
votes
8 answers

Update MySQL version from 5.1 to 5.5 in CentOS 6.2

I tried to update MySQL from 5.1 to 5.5 in CentOS 6.2. The following is the process I did: 1. rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm 2. yum install libmysqlclient15 --enablerepo=webtatic 3. yum remove mysql mysql-* 4. yum install…
Dilip Rajkumar
  • 7,006
  • 6
  • 60
  • 76
37
votes
5 answers

Database - (rows or records, columns or fields)?

In database terminology: What is the difference between a row and a record? Likewise, aren't columns and fields the same thing? On the blog Joe Celko The SQL Apprentice , I noticed that the banner mentions that they are different things.
toop
  • 10,834
  • 24
  • 66
  • 87
37
votes
5 answers

How can I access Amazon DynamoDB via Python?

I'm currently using hbase with my Python apps and wanted to try out Amazon DynamoDB. Is there a way to use Python to read, write and query data?
Lostsoul
  • 25,013
  • 48
  • 144
  • 239
37
votes
7 answers

Spring Security:password encoding in DB and in applicationContext

Have config (applicationContext-security.xml):
sergionni
  • 13,290
  • 42
  • 132
  • 189
37
votes
6 answers

cursor.rowcount always -1 in sqlite3 in python3k

I am trying to get the rowcount of a sqlite3 cursor in my Python3k program, but I am puzzled, as the rowcount is always -1, despite what Python3 docs say (actually it is contradictory, it should be None). Even after fetching all the rows, rowcount…
Hiperi0n
  • 427
  • 1
  • 6
  • 11
37
votes
4 answers

How to set transaction isolation level (MySQL)

How do I set the isolation level of MySQL 5.1 InnoDB? By entering: mysql> show variables like '%isola%'; The default level set for InnoDB is repeatable read. How do I change the isolation level?
Wen Jun
  • 522
  • 3
  • 9
  • 19
37
votes
6 answers

Strange Characters in database text: Ã, Ã, ¢, â‚ €,

I'm not certain when this first occured. I have a new drop-shipping affiliate website, and receive an exported copy of the product catalog from the wholesaler. I format and import this into Prestashop 1.4.4. The front end of the website contains…
Steve
  • 2,066
  • 13
  • 60
  • 115
37
votes
8 answers

Connect PHP to IBM i (AS/400)

I've got an upcoming project wherein I will need to connect our website (PHP5/Apache 1.3/OpenBSD 4.1) to our back-end system running on an iSeries with OS400 V5R3 so that I can access some tables stored there. I've done some checking around but am…
dragonmantank
  • 15,243
  • 20
  • 84
  • 92
37
votes
11 answers

MS Access (MDB) concurrency

For a small project I need to utilize a simple database with very light requirements: few tables, no more than few thousands of records in total, 2 or 3 users. I am working in .NET environment. As a database server (even those Express editions)…
petr k.
  • 8,040
  • 7
  • 41
  • 52
37
votes
6 answers

What is the MySQL equivalent of PostgreSQL's EXPLAIN ANALYZE

I'd like to get a detailed query plan in MySQL similar to EXPLAIN ANALYZE shows in PostgreSQL. Is there an equivalent?
foolish
  • 373
  • 1
  • 3
  • 4
37
votes
2 answers

Where does WAMP server store database files

My hard-drive has encountered some problems and I am unable to boot Windows with it. I am able to view the drive's contents by connecting it to another PC as an external drive. On the culprit drive I was running a local WAMP server for dev purposes…
irishbuzz
  • 2,420
  • 1
  • 19
  • 16
37
votes
5 answers

SQL LIKE operator in Cloud Firestore?

I have been using Firebase Real Time Fatabase for a while and I come across Cloud Firestore today. I can't figure out on how to use LIKE operator on Firestore. Firebase Real Time…
Manjok
  • 381
  • 1
  • 3
  • 6
37
votes
5 answers

Database schema for chat: private and group

I'm trying to design the database schema with the ability to both private chat and group chat. Here's what I've got so far: So - the theory is that even if the user is just in a one on one private chat, they are still assigned a 'roomID', and each…
Chud37
  • 4,907
  • 13
  • 64
  • 116
37
votes
6 answers

Should many to many tables have a primary key?

If I have two objects that have a many-to-many relationship, I would typically model them in my database schema with a many-to-many table to relate the two. But should that many-to-many table (or "join table") have a primary key of its own (integer…
ashes999
  • 9,925
  • 16
  • 73
  • 124