WhichWebHosting home

HomeGuidesHosting glossaryWhat is a database?

What is a database?

Published

Share

A database is a structured collection of data.1, source 1 To add, access and process data stored in a computer database, you need a database management system such as MySQL Server.1, source 1 In web development, most databases use a relational database management system (RDBMS) to organize data and are programmed in SQL.2, source 2

What is a database and what does it hold?

A database is a storage system that collects organized data, making it easier to search, structure, and extend.2, source 2 A database may be anything from a simple shopping list to a picture gallery or the vast amounts of information in a corporate network.1, source 1 Database management systems play a central role in computing, as standalone utilities or as parts of other applications.1, source 1 MySQL, MariaDB, SQL Server and Oracle Database are examples of server-side relational database management systems.2, source 2

Some databases do not organize data the relational way, and these are called NoSQL.2, source 2 MongoDB, Cassandra and Redis are examples of NoSQL databases.2, source 2

There are a number of other ways of organizing databases besides storing data in tables.3, source 3 Files and directories on Unix-like operating systems form an example of a hierarchical database.3, source 3 A more modern development is the object-oriented database.3, source 3

Browsers have their own database system called IndexedDB.2, source 2

How does a relational database store data?

A relational database stores data in separate tables rather than putting all the data in one big storeroom.1, source 1 PostgreSQL is a relational database management system (RDBMS).3, source 3 A relational system manages data stored in relations, and relation is essentially a mathematical term for table.3, source 3 In PostgreSQL, each table is a named collection of rows.3, source 3

In PostgreSQL, each row of a given table has the same set of named columns, and each column is of a specific data type.3, source 3 Those columns have a fixed order in each row, but SQL does not guarantee the order of the rows within a table, although rows can be explicitly sorted for display.3, source 3 In PostgreSQL, tables are grouped into databases, and a collection of databases managed by a single PostgreSQL server instance is called a database cluster.3, source 3

In MySQL, you set up rules governing the relationships between data fields, such as one-to-one, one-to-many, unique, required or optional.1, source 1 The database enforces the relationship rules, so that with a well-designed database an application never sees inconsistent, duplicate, orphan, out-of-date or missing data.1, source 1 MySQL's logical model has objects such as databases, tables, views, rows and columns, and its database structures are organized into physical files optimized for speed.1, source 1

An SQLite database with multiple tables, indices, triggers and views is contained in a single disk file.4, source 4

What is SQL and how do programs talk to a database?

In the name MySQL, the SQL part stands for Structured Query Language.1, source 1 SQL is the most common standardized language used to access databases.1, source 1 SQL is defined by the ANSI/ISO SQL Standard.1, source 1 The SQL standard has been evolving since 1986 and several versions exist.1, source 1

PostgreSQL supports a large part of the SQL standard.5, source 5 Depending on the programming environment, you might enter SQL directly (for example, to generate reports), embed SQL statements into code written in another language, or use a language-specific API that hides the SQL syntax.1, source 1 Most SQL database engines are client/server based.6, source 6

Programs that want to access a client/server database communicate with the server using some kind of interprocess communication, typically TCP/IP, to send requests to the server and receive back results.6, source 6 The MySQL database software is a client/server system that consists of a multithreaded SQL server that supports different back ends, several client programs and libraries, administrative tools, and a wide range of application programming interfaces (APIs).1, source 1 The mysql client program is an interactive program that lets you connect to a MySQL server, run queries and view the results.7, source 7 To see the options the mysql client provides, invoke it with the --help option.7, source 7

The mysql client can also run in batch mode, where you place your queries in a file beforehand and tell mysql to execute the contents of the file.7, source 7 phpMyAdmin can execute, edit and bookmark any SQL statement, even batch queries.8, source 8

What are MySQL, MariaDB and PostgreSQL?

MySQL is a database management system.1, source 1 MySQL is developed, distributed and supported by Oracle Corporation.1, source 1 Open source means that it is possible for anyone to use and modify the software.1, source 1 The MySQL software uses the GPL (GNU General Public License) to define what you may and may not do with the software in different situations.1, source 1

MySQL Server can run on a desktop or laptop alongside other applications and web servers, requiring little or no attention.1, source 1 MariaDB is a fork of MySQL.2, source 2 phpMyAdmin handles the administration of a MySQL or MariaDB database server.8, source 8

PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department.5, source 5 It is an open-source descendant of the original Berkeley code.5, source 5 PostgreSQL offers features including complex queries, foreign keys, triggers, updatable views, transactional integrity and multiversion concurrency control.5, source 5

PostgreSQL can be extended in many ways, for example by adding additional data types, functions, operators, aggregate functions, index methods and procedural languages.5, source 5 Because of its liberal license, PostgreSQL can be used, modified and distributed by anyone free of charge for any purpose, whether private, commercial or academic.5, source 5

How is SQLite different from other databases?

SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.4, source 4 Unlike most other SQL databases, SQLite does not have a separate server process.4, source 4 In a classic serverless database, the database engine runs within the same process, thread and address space as the application, with no message passing or network activity.6, source 6

SQLite reads and writes directly to ordinary disk files.4, source 4 Any program that is able to access the disk is able to use an SQLite database.6, source 6 The SQLite database file format is cross-platform, so you can copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures.4, source 4 SQLite transactions are ACID even if interrupted by system crashes or power failures.4, source 4

The main advantage of being serverless is that there is no separate server process to install, set up, configure, initialize, manage and troubleshoot.6, source 6 A database engine that uses a server can provide better protection from bugs in the client application.6, source 6 Because a server is a single persistent process, it is able to control database access with more precision, allowing finer-grained locking and better concurrency.6, source 6

Client/server SQL database engines strive to implement a shared repository of enterprise data and emphasize scalability, concurrency, centralization and control.9, source 9 SQLite strives to provide local data storage for individual applications and devices, and emphasizes economy, efficiency, reliability, independence and simplicity.9, source 9

When does SQLite fit, and when does a client/server database fit better?

Because an SQLite database requires no administration, it works well in devices that must operate without expert human support.9, source 9 SQLite is often used as the on-disk file format for desktop applications such as version control systems, financial analysis tools, media cataloging and editing suites, and CAD packages.9, source 9 SQLite is also often used as a container for transferring content from one system to another, because an SQLite database is a single compact file in a well-defined cross-platform format.9, source 9

SQLite works great as the database engine for most low to medium traffic websites.9, source 9 Generally speaking, any site that gets fewer than 100K hits per day should work fine with SQLite, and that figure is a conservative estimate, not a hard upper bound.9, source 9 If a website is write-intensive or so busy that it requires multiple servers, an enterprise-class client/server database engine is worth considering instead of SQLite.9, source 9

If many client programs send SQL to the same database over a network, or if the data is separated from the application by a network, use a client/server database engine instead of SQLite.9, source 9 File locking logic is buggy in many network filesystem implementations, on both Unix and Windows.9, source 9 If file locking does not work correctly, two or more clients might try to modify the same part of the same database at the same time, resulting in corruption.9, source 9

An SQLite database is limited in size to 281 terabytes.9, source 9 SQLite supports an unlimited number of simultaneous readers, but it allows only one writer at any instant in time.9, source 9 With SQLite, writers queue up and, in many situations, no lock lasts for more than a few dozen milliseconds.9, source 9

How do you create and manage a database in cPanel?

In cPanel, the MySQL Databases interface is used to create, manage and delete MySQL databases and database accounts.10, source 10 In cPanel & WHM version 120 and later, the MySQL Databases interface is named Manage My Databases.10, source 10 cPanel recommends the MySQL Database Wizard interface for creating your first database and account.10, source 10 In cPanel, a database name may contain a maximum of 64 characters, and each underscore requires two characters of that limit.10, source 10

To create a database in cPanel, enter a name for the database in the New Database text box.10, source 10 After you click Create Database and then Go Back in cPanel, the created database appears in the Current Databases table.10, source 10

In cPanel, you must create MySQL accounts separately from mail and web administrator accounts.10, source 10 You must also create a database account before you can add that account to an existing database.10, source 10 In cPanel, MariaDB limits the database username to 47 characters.10, source 10

cPanel does not reveal a database account's password, so if you forget it, you must change it.10, source 10 In cPanel, after adding an account to a database you select the checkboxes for the privileges to grant, and the ALL PRIVILEGES checkbox grants all available privileges.10, source 10 In cPanel, Repair Database makes the system attempt to automatically repair a corrupt database.10, source 10 MySQL does not allow you to rename a database.10, source 10

When cPanel & WHM renames a database, the system creates another database and moves the data from the old database to the second one.10, source 10 When you rename a database in cPanel, the system terminates all active connections to the database.10, source 10 After renaming a database in cPanel, you must manually update configuration files and applications to use the updated database name.10, source 10 cPanel strongly recommends a backup of the MySQL database in the Backup interface before you rename it.10, source 10

In cPanel, to permanently delete a database you click Delete Database.10, source 10

What is phpMyAdmin?

phpMyAdmin is a free software tool written in PHP.8, source 8 You can use phpMyAdmin to perform most administration tasks, including creating a database, running queries and adding accounts.8, source 8 It can create, browse, edit and drop databases, tables, views, columns and indexes, import data from XML, CSV and SQL files, and export data to formats including CSV, XML and PDF.8, source 8

When a person logs in to phpMyAdmin, the username and password are passed directly to MySQL.8, source 8 phpMyAdmin does no account management on its own, other than allowing one to manipulate the MySQL account information.8, source 8 phpMyAdmin can add, edit and remove MySQL accounts and privileges.8, source 8

The phpMyAdmin interface is at cPanel » Home » Databases » phpMyAdmin.10, source 10 In cPanel, you use the phpMyAdmin interface to access and manage the databases that you create, add or delete information in existing databases, copy a database, or run MySQL queries and scripts.10, source 10 Do not use cPanel's phpMyAdmin to create databases or database accounts, because it does not map databases, which stops backups and restorations from working.10, source 10

Common questions

What is a database in simple terms?

A database is a structured collection of data. It may be anything from a simple shopping list to a picture gallery or the vast amounts of information in a corporate network. To add, access and process the data, you need a database management system.

What does SQL stand for?

SQL stands for Structured Query Language. It is the most common standardized language used to access databases.

Is MySQL a database?

No, MySQL is a database management system. A database is a structured collection of data, and to add, access and process that data you need a database management system such as MySQL Server.

Does SQLite need a server?

No, SQLite does not have a separate server process. It is an in-process library that implements a self-contained database engine. It reads and writes directly to ordinary disk files.

What is phpMyAdmin used for?

It handles the administration of a MySQL or MariaDB database server. You can use it for tasks such as creating a database, running queries and adding accounts. It can also create, browse, edit and drop tables, columns and indexes. In cPanel, though, do not use it to create databases or database accounts, because that stops backups and restorations from working.

Can you rename a database in cPanel?

Yes, cPanel can rename a database. MySQL itself does not allow renaming, so cPanel creates another database and moves the data from the old one into it. The system also terminates all active connections to the database.

Sources

Every fact on this page comes from one of these, checked before it goes live.

More guides

Hosting glossary

How to build a website

Learn how to build a website by planning its look, getting hosting and a domain name, setting up files with HTML or WordPress, and publishing it live.

· Mateo Cardenas

Hosting glossary

What is an IP address?

An IP address is a number used to address each device on an IP network. Read about IPv4, IPv6, private blocks, and DHCP allocation mechanisms.

· Mateo Cardenas

Email hosting

Does 123 Reg hosting include email?

123 Reg's Web Hosting, Hosting for WordPress and Premium Hosting plans include email addresses, and 123 Reg sells Titan and Microsoft 365 email plans.

· Mateo Cardenas

Email hosting

Does web hosting include business email?

Web hosting sometimes includes business email. See what SiteGround, Namecheap and HostGator state, then how MX records and SPF records work.

· Mateo Cardenas