Thursday, August 27, 2009

How Databases Work

How Databases Work Almost all the most useful sites on the web databases of their content, and are often with them, allowing users to register and post comments. Each time you do something about it, it seems that a web site to "remember", the next time the chance to make a database. However, despite how common databases, are not well understood. Every day new webmaster DBAs, without understanding the first thing about databases. If you have a database on the Inteet is not just a database: it is that are about the concept, which has decades of development of database and validated. Here are some of these concepts. Databases common relational data model in use today, is that the relational database - some are hierarchical databases (where data are available in the "trees" as an organizational structure for management), databases and files flat (if the data in "voices" in a text document). In a relational database, the data in the tables. The columns are called fields and rows are called records. Thus, for example, a table with two fields: name and suame. If you take a row in this table, which could be 'Bob' and 'Smith'. Instead of using only that data that you have marked as to what it is, and you can relate to them and looking through it is much easier. If the "relational" is very important, however, when it comes to tables in a database refer to other tables. Each row of the table has an ID number (technically known as a "primary key") - for example, Bob Smith may 123rd ID number then you can refer to its inclusion in a new table. Let's say you are keeping records of orders. You can use two columns: customer number, and date. This can easily store 123 and the date in the table, every time, Bob Smith orders from you - the nature of the relational database will tell you later that the customer number 123 is Bob Smith. When it comes to things such as the storage of many places of the authors, this is powerful. SQL Database SQL stands for Structured Query Language ". It 'the most popular query language for relational database systems. What is a query? This is essentially a way of asking the database to find a record for games that you give. Let us retu to our example, the first and last name table - say that the table was described as "names". To see the name Bob Smith in the beginning, we used SQL, for example: INSERT INTO names VALUES ( 'Bob', 'Smith'); The ID number will be assigned automatically to the database. Then, later, when we tried to find out who has 123 clients, you could run this SQL: SELECT * FROM names WHERE id ='123 '; This would give us 123 customer records from the database - Bob Smith's. SQL might look complicated, and can be, but the complexity is compounded by the fact that there are many SQL commands you are likely ever need. In fact, most of the sites you can link with the following statements: CREATE. Used to add new database tables. If I have to tell the database which fields (columns) you want and what type of data (text, data, etc.) of each field is included. SELECT. This command is used for lookup tables. You can use operators such as = (equals), <(less than) and> (greater) in order to find the entry. For example, if you wanted to know your sales this week, you should be from the date of a week ago and the use of SELECT * FROM sales WHERE date> - that is, "all records of the table, where tuover is higher. .. ". INS. Here you can create new entries in the table UPDATE. If the data are inserted, updated, you can change parts of it. Very useful if, for example, Bob Smith tells you that he prefers to be known as Robert Smith. You can update the data without the disposal and put it back in, which means that the records exist for their religious identity DELETE. Removes existing rows in the table, with the same basic syntax as SELECT.

No comments:

Post a Comment