Changes

Jump to: navigation, search

Database Basics

40 bytes added, 13:29, 19 May 2009
no edit summary
The chances are that if you have ever logged into a web site or purchased an item on the internet you have interacted with a database in some way. Anything that involves the retrieval or storage of information on a computer system is most likely to involve a database. In fact, databases are the core of just about every application that relies on data of some form to complete a task.
The first step in learning MySQL is to understand the difference between a ''database'' and a ''database management system (DBMS)''. The term ''database'' refers to the entity which that stores the actual data (such as ID numbers, names and address addresses for example) in a structured way. A ''database management system (DBMS)'' on the other hand, refers to the software used to store, access and manipulate the data stored in the ''database''. All interactions with the database are always performed via the ''DBMS''.
Modern databases and database management systems are not restricted to storing just text. Today, databases are used to store such items as images, videos and software objects.
== Understanding Database Tables ==
<google>ADSDAQBOX_FLOW</google>
Database ''Tables'' provide the most basic level of data structure in a database. Each database can contain multiple tables and each table is designed to hold information of a specific type. For a example, a database may contain a ''customer'' table which contains the name, address and telephone number for all the customers of a particular business. The same database may also include a ''products'' table used to store the product descriptions with associated product codes for the items sold by the business.
Each table in a database is assigned a name which must be unique within that particular database. A table name, once assigned to a table in one database, may only be re-used within the context of a different database.
Each database table must contain one or more columns that can be used to uniquely identify each row in the table. This is known in database terminology as the ''Primary Key''. For example, a table may use a bank account number column as the primary key. Alternatively, a customer table may use the customer's social security number of the primary key.
Primary keys allow the database management system to uniquely identify a specific row in a table. Without a primary key it would not be possible to retrieve or delete a specific row in a table because there can be no certainty that the correct row has been selected. For example, suppose a table existed where the customer's last name had been defined as the primary key. Imagine then the problem that might arise if more than one customer called "Smith" was recorded in the database. Without some guaranteed way to uniquely identify a specific row it would be impossible to ensure the correct data was being accessed at any given time.
Primary keys can comprise a single column or multiple columns in a table. To qualify as a single column primary key, no two rows can contain matching primary key values. When using multiple columns to construct a primary key, individual column values do not need to be unique, but all the columns combined ''must be unique''.
Throughout the remainder of this book particular attention will be paid to explaining the key SQL commands so that the reader will be proficient in using SQL to read and write database data.
 
<google>BUY_MYSQL_BOTTOM</google>
<hr>

Navigation menu