In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The content of this article comes from Liu Xin's official account of "programmers turn over", which is highly recommended by Liu Xin. Xiao Li is a well-known student in the department of computer science and technology in this university. His programming ability is excellent, and he is excellent in using Pascal. This is the foundation laid by participating in the National Youth Informatics Olympiad in high school. Although he has never won a prize, in the late 1980s and early 1990s, many people did not know what a computer was. People can write programs on it, which is a very admirable thing. So as soon as he entered school, the counselor asked Xiao Li to help develop an information system for the department to record student information, course information, and elective courses, so that he could work without paper. Xiao Li thought that this was just a program based on the command line, and it was nothing more than adding, deleting, changing and checking, so he promised it all, and then offered a Pascal to prepare for a big fight. The counselor also sent the relevant materials, and the student information is nothing more than [student number, name, gender, ID number, date of admission, class] and other information. The course information is [course number, course name, instructor], and the course selection is [course number, course number, grade]. With the basic data structure, Xiao Li decided to use three separate text files to store this information. For example, the content in student.txt is like this: the first line is the header, and the other lines are contents, separated by commas. The format of the remaining two files is similar to this one. Programming is going very well, and the most important part is reading and writing files in Pascal, which is completed in less than a week, and now the program architecture is like this: this stand-alone information system is running, and the effect is good. Redundancy and inconsistency of data the director of the business school heard that the department of planning had such a system, so the counselor asked Xiao Li to copy a copy of the past on a floppy disk, and the business school used it smoothly. However, when some engineering students go to business schools to take economics courses, they find that they have to enter student information again, which is really annoying. There is nothing Xiao Li can do. After all, these are two systems. We can only use local methods to copy a copy of the student.txt of the department of engineering to the business school. As a result, duplication of data is hard to avoid, and there are more likely to be data inconsistencies, such as address information changed in the department of planning, but not in business schools. Later, the counselor said that the mathematics department had set up a similar system, which was written not in Pascal but in C. the data format was not the same as that defined by Xiao Li, and it was impossible for Xiao Li to copy the Student.txt. Xiao Li wants all the departments of the school to use such a system. In fact, school leaders have also seen this problem, but the local area network in the school has not yet been established, and it is not realistic for everyone to use the same system. When Li's inquiry reached the end of the term, teachers from the department of planning and business school called Xiao Li one after another: "Xiao Li, I'd like to count who failed the operating system course this semester and how many are above 80. Can you help me with it?" "Xiao Li, I'd like to calculate the average score of economics. Can you program it? there are too many students, so it's too troublesome to calculate by hand." In order to meet the needs of these "perverts", Xiao Li hardly had much rest during the holidays and kept writing various functions with PASCAL. But this demand seems endless, to sum up, it is nothing more than a variety of queries for these documents. Is it possible for teachers to go directly to the documents to find and calculate? Obviously not. Xiao Li remembered a sentence: "all computer problems can be solved by adding a middle layer." then provide a middle layer, block out the file layer, and let teachers query in this middle layer in terms they are familiar with. There should be a logical data structure on the middle tier, which is actually these things: student information: [student number, name, gender, date of admission, class, address] course information: [course number, course name, teacher] elective: [student number, course number, grades] Xiao Li decided to call these things "tables", each of which is called "columns" / "fields" / "attributes". Each column has a type, such as character type, date type, numeric type, etc. Query is carried out with something like this: SELECT student number, name FROM student information WHERE enrollment date = '1991-9-1' you can also query several tables if you want: SELECT student number, name, course name, grade FROM student information s, course information c, course selection sc ON s. Student number = sc. Student number AND c. Course number = sc. Course number WHERE course name = 'operating system' AND score
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
xml version= "1.0" encoding= "utf-8"? >
© 2024 shulou.com SLNews company. All rights reserved.