TAILIEUCHUNG - Học php, mysql và javascript - p 23

Chương 8 cung cấp cho bạn một nền tảng tốt trong việc thực hành sử dụng cơ sở dữ liệu quan hệ với ngôn ngữ truy vấn cấu trúc. Bạn đã học về việc tạo cơ sở dữ liệu và các bảng đó bao gồm họ, cũng như chèn, nhìn lên, thay đổi, và xóa dữ liệu. Với những kiến thức thuộc vành đai của bạn, chúng ta cần xem xét làm thế nào để thiết kế cơ sở dữ liệu cho tốc độ tối đa và hiệu quả. . | CHAPTER 9 Mastering MySQL Chapter 8 provided you with a good grounding in the practice of using relational databases with structured query language. You ve learned about creating databases and the tables that comprise them as well as inserting looking up changing and deleting data. With that knowledge under your belt we now need to look at how to design databases for maximum speed and efficiency. For example how do you decide what data to place in which table Well over the years a number of guidelines have been developed that if you follow them ensure that your databases will be efficient and capable of growing as you feed them more and more data. Database Design It s very important that you design a database correctly before you start to create it otherwise you are almost certainly going to have to go back and change it by splitting up some tables merging others and moving various columns about in order to achieve sensible relationships that MySQL can easily use. Sitting down with a sheet of paper and a pencil and writing down a selection of the queries that you think you and your users are likely to ask is an excellent starting point. In the case of an online bookstore s database some of the questions you write down could be How many authors books and customers are in the database Which author wrote a certain book Which books were written by a certain author What is the most expensive book 201 What is the best-selling book Which books have not sold this year Which books did a certain customer buy Which books have been purchased along with the same other books Of course there are many more queries that could be made on such a database but even this small sample will begin to give you insights into how to lay out your tables. For example books and ISBNs can probably be combined into one table because they are closely linked we ll examine some of the subtleties later . In contrast books and customers should be in separate tables because their connection is very .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.