Home > database >  What is a database? (reproduced)
What is a database? (reproduced)

Time:09-22

What is a database?

You may ask, my data is stored in their computers excel table, but also the database?

Excle data is very convenient, but for enterprise is different, a company may have tens of thousands of Excel spreadsheet, also on different computers, and their employees and customers needs to see real-time enterprise to provide them with all of the data, this method of file management is very troublesome, every minute can't send a new enormous Excel file to all customers,

Database, is the place where data is stored, like refrigerator is a place to store food, it is because of the database, all the people can directly find data and modify the data on the system, for example, you use every day balance treasure to see their own account earnings, after the data is read from the backend database for you.


Again, for example, hydra organization will against humanity in the movie the great pressure on the "insight into plan", the super grade antique computer storage Dr Sola, brain, and developed an algorithm, called the sola algorithm, this algorithm can read from the database of SHIELD past data, the forecast each person's future,

Database of English name is called the DB (Database), the Database there is what east east?

In fact, the database typically contains one or more tables, if you use Excel, you will know the Excel is a piece of a two-dimensional table, each table is made up of columns and rows, in which each column are identified by name, in the same way, a a list is stored in the database, but there is a link between each table, so, in short:

Database=more tables + the relationship between each table

In fact the concept of database is logically, it is a pile of interrelated data, on the physical entity, is written in a file on disk, a pile of data file, the most basic data of the table (table),

So how do you learn to database? Learn database you need to master the following two points:

1) the structure of the database table

2) the relationship between each table

We next respectively to look at these two points,

1. The structure of the database table

Table structure is refers to understanding the database each table looks like,

Logo, name each table in the database by a table contains a column column, and record the data line, we can be clear at a glance, a concrete example here is "the monkey data analysis community members" table (table name), recorded the breakthrough progress of each member information,


Each column in the table above, there is a name to identify the column, line recording the data, which, with "member ID" is used to uniquely identifies the user, 'recruit progress' is used to record every member to learn which closed,

You might ask, why a user id to show the uniqueness of the data, use name can also ah?

Actually, the name is not the only identified as a user, noticed that there are two members in the table below are called "jingwei", so that it can not only determine a user by name, so that the database table will add an ID field is used to represent the uniqueness of the data,


ID are important concepts in the database, called a unique identifier or primary keys, used to represent the uniqueness of the data, in fact, in life we will use the ID to uniquely identify the data a unique identifier, the most typical example is the national ID CARDS to uniquely identifies a person, even if you have a twin brother, as long as you are two different ID, you are two people, you see, in the TV series "in the name of the name" interviews is rely on ID number to look up the relevant criminal,


Similarly, the ID is also one of the function of database, uniquely identifies a data, we put this unique identification data in the database only ID is called the primary key, ID does not have real business sense, is a series of pure digital, each table can have only one primary key,

2. The relationship between each table

What is the connection? You are the son of your father, you are the son of your father, this is the life, in fact, there is a connection between data, how to establish connections between each table in the database?

Database table is a collection of more than can put in a database, and between table and table can contact each other, we look at the following two tables (table) data analysis community member list, education background, can you tell me a link between them?

Below is the table 1: data analysis community members


Below is a table 2: education background


Relate the two tables through the member ID, in order to more clearly see the relationship between the two tables, I use the same color in the picture shown above represent the same membership information, for example in the member table name is the monkey's ID is 1, so I want to know the member education background, I can in the education background of this list to find "member ID" value is 1 line, finally found the ID is 2 rows of education background, to find the corresponding member of the education background information,


Through the example above you should probably know about the connection between the table, now, we come back to specific see: each table is how to connect,

Contact is data to corresponding matching, formal name in the database connection, the corresponding operation called join,

Database, if you want to link to other tables, usually with (table name _ID) as a link, just as we joined the above "education background" list "member ID" is to relate two tables,

Join (Join) is the core concept in the relational database, is the basis of the operation, be sure to remember this concept, are used in SQL learning behind,

Described above are the basic theory of database principle, theory had, of course, there's the corresponding software implementation to use up, or more powerful theory is a lump of useless crap, it's like, if only architect design sketch is unable to build buildings, had to have specific construction team to build buildings,


So, the above database principle is "sketches", then the corresponding "construction team" who is it?

Implementation of database principle "construction team" is commonly used database software, such as MySQL, Oracle, SQL Server database is to realize the above theory, such as various database software the use of the difference is very much the same, but because the MySQL is open source, has become the mainstream in the companies to use, the interview also mainly MySQL,

We conclude this part of the learning content:

1. What is a database?

Database=more tables + the relationship between each table

2. The database table look like?

Logo, name each table in the database by a table contains a column column, and record the data line,

ID is an important concept of the database, called a unique identifier or primary keys, used to represent the uniqueness of the data,

3. How to build a connection between each table in the database?

Database, if you want to link to other tables, usually with (table name _ID) as a link,

Contact is data to corresponding matching, formal name in the database connection, the corresponding operation called join,

4. What's the relationship between database and SQL.

, put the data in the database and SQL is the language used to operating data in the database (tools),

For example, have a bowl of rice (bowl is mysql, inside put rice is data), do you want to eat a bowl of rice, what to eat? Take chopsticks (SQL), using chopsticks (SQL) (mysql) operating a bowl of rice (data)
  • Related