1. Home
  2. Explore
  3. Computer Science
  4. Database Systems Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Database Systems Fundamentals

Speaker 1Speaker 2

Database Systems Fundamentals

13:03
0:00-13:03
  1. Corey

    Welcome to the database systems course. Before we get into the technical details, let’s map out the journey. The course is organized into roughly eight modules, with several lectures in each module, and the plan is to avoid starting a new module partway through a lecture.

  2. Anna

    And the central theme is relational databases. The modules include an introduction, the relational model, the entity-relationship model, tuple relational calculus, and SQL, which is the database language standard. We’ll also cover file systems and the physical representation of databases, database design and normal forms, query optimization, and finally transaction processing and error recovery.

  3. Corey

    That gives us a useful arc: first, how to describe data and ask questions about it; then how to store it, design it well, retrieve it efficiently, and protect it when things go wrong.

  4. Anna

    So let’s begin with the basic question: what is a database? It’s a collection of related pieces of data that capture information about some real-world enterprise, or part of one. The word “related” matters: a university database about academic activity wouldn’t normally include unrelated weather data.

  5. Corey

    And an enterprise can be large enough that one database doesn’t capture all of its information. A database is built for a particular purpose: to meet some of the enterprise’s data-management needs and support its day-to-day activities.

  6. Anna

    The database also changes as the enterprise changes. If something happens in the organization that affects the information it tracks, the database needs to be updated so it continues to reflect the current state of affairs.

  7. Corey

    Take a university database focused on academic matters. It might keep information about students and faculty, the courses offered, research laboratories, and which students enroll in which courses. Its purpose would be to accurately track the university’s academic activities, not necessarily every aspect of the institution.

  8. Anna

    Now let’s separate two ideas that are easy to blur together: a database and a database management system, or DBMS. The database is the collection of related data. In principle, someone could keep that information in paper ledgers; the DBMS is the software used to create and manage databases on computer systems.

  9. Corey

    A DBMS is general-purpose software that helps create large databases stored on disk. Disk storage matters because a database is meant to preserve information over time. Main memory is volatile, so its contents can disappear when an application closes or the system loses power.

  10. Anna

    Disks can fail too, and the course will return to that problem later. But secondary storage is still the mainstay for databases because persistent information must remain available beyond the lifetime of a running program.

  11. Corey

    A DBMS also lets users ask questions of the stored data. Suppose you want to know whether a student in a particular semester completed a particular course. You express that need as a query, and the system returns information from the database.

  12. Anna

    SQL provides a standard way to express many database queries. It’s more than a language used by one product: it is an internationally recognized standard for describing database operations and requests. The DBMS supports that standard and works to produce query results efficiently.

  13. Corey

    Efficiency becomes important when the database is large. Finding one particular fact among a great deal of stored information can take time, so the DBMS has to process queries in a way that aims to return the answer as quickly as possible.

  14. Anna

    Another major challenge is that many people may use the same database at once. A system that handled only one person’s request at a time would be inefficient, so a DBMS supports concurrent use: many users can make requests while each experiences the system as responding to their own question.

  15. Corey

    But answering many requests concurrently isn’t enough. The system also has to preserve consistency, and the exact consistency requirement depends on the application.

  16. Anna

    A railway reservation system makes that concrete. If several people request seats between the same two stations at nearly the same time, the system must not assign one particular seat to two different people. That rule is a consistency requirement for that application.

  17. Corey

    So consistency isn’t one identical rule for every database. It depends on what the data represents and what the organization needs to guarantee. The DBMS has to manage concurrent requests without violating those application-specific requirements.

  18. Anna

    The system also needs to make data available despite failures. One kind of failure is damage to the storage medium itself. A disk can fail, but an organization can’t simply accept that its data is lost.

  19. Corey

    For serious disasters, one possible measure is to replicate an entire database at a geographically separate location. If a fire, storm, or other catastrophic event destroys the physical server in one place, a copy elsewhere can help keep the data available.

  20. Anna

    There are also failures during the work being done on the database. A program might crash partway through a change. If only part of its work has taken effect, the database could be left in an inconsistent state.

  21. Corey

    The system therefore needs to handle incomplete operations so that partial changes don’t undermine consistency. Transaction processing and recovery will examine these issues in much more detail later in the course.

  22. Anna

    At this point, you might ask why we need special database software at all. Programmers can create files of records using languages such as C or C++, and operating systems already provide file handling. Why not write programs to manage everything ourselves?

  23. Corey

    One difficulty is redundant data. Imagine one application tracking students’ courses and grades, and another tracking their health records for a university hospital. Both might store a student’s name, phone number, and address.

  24. Anna

    Storing a fact in two places isn’t necessarily a problem just because it takes up space. The harder problem is keeping the copies consistent. If a student changes their phone number, each copy must be updated; otherwise, one part of the organization may have the old number while another has the new one.

  25. Corey

    With separate, independently written programs, coordinating those updates becomes difficult. Changes have to be communicated and applied everywhere the data appears. That creates opportunities for inconsistent information.

  26. Anna

    Another problem is that record structures tend to be hard-coded into programs. In a typical program, you define a structure before creating and using records of that type. If the structure changes, the software may need to be changed and recompiled.

  27. Corey

    That makes even a modest change in how information is organized burdensome. A DBMS addresses this by separating descriptions of the data from the programs that work with it, which gives more flexibility when the structure changes.

  28. Anna

    Handling queries by writing a separate program for each possible question is another problem. Each program would need to search through the records in its own way, and it’s hard to anticipate every question an end user might ask in advance.

  29. Corey

    And the burden wouldn’t stop there. Programmers would also have to manage concurrent access and recover from failures themselves. Those are difficult tasks, especially when many users and large amounts of data are involved.

  30. Anna

    That’s why building a database system out of a collection of custom file-processing programs requires enormous effort and is very difficult to scale to the needs of a real database. A DBMS provides the shared capabilities instead of making every application reinvent them.

  31. Corey

    One key DBMS idea is separating data from metadata. Metadata is information that describes the data, including how records are structured. Rather than embedding all of those descriptions inside each application, the DBMS maintains them separately in a system catalog.

  32. Anna

    A program can consult the catalog to find out how information is stored, then operate on the data according to that description. Because the description is separate, changing the metadata doesn’t necessarily mean rewriting every program that uses the data.

  33. Corey

    That separation is called program-data independence. The programs are, in an important sense, less tightly bound to the details of the data’s structure. If the structure changes, the catalog can be updated, and programs can use the revised description.

  34. Anna

    It also helps explain why a DBMS is general-purpose. One DBMS can manage different databases—for example, hospital records, staff accounts and salaries, and students’ academic records—while each database has its own descriptive information in the catalog.

  35. Corey

    The standard query language is another part of the benefit. Relational database theory gives us a foundation for expressing queries, and SQL gives users a widely recognized way to state their data needs.

  36. Anna

    Under the hood, the course will study ideas such as tuple relational calculus and relational algebra. The point is that these formal approaches help describe what kinds of queries can be expressed; once a DBMS implements the language’s constructs, users can formulate many different queries without requiring a special program for each one.

  37. Corey

    That changes the work of designing a system, too. For a university academic database, designers can talk with the academic section to learn what information it needs to track and what queries it routinely needs.

  38. Anna

    Then they can focus on the logical design: what information should be represented and how it should be organized. The DBMS takes care of much of the underlying storage organization, query processing, and management of concurrent users.

  39. Corey

    So the designers still have important choices to make. They need to understand the enterprise and its data, and identify the useful day-to-day queries. But they don’t have to build every storage and processing mechanism from scratch.

  40. Anna

    There are many available DBMS products. Examples mentioned in the course include Oracle, IBM’s DB2, and Microsoft SQL Server. The broader lesson is that database management systems are now a standard tool, even if it’s easy to take their capabilities for granted.

  41. Corey

    That brings us to a new concept: the data model. A data model is a collection of conceptual tools for describing a database at a particular level of abstraction.

  42. Anna

    Why do we need different levels? Because people need to discuss a database for different purposes. When gathering requirements, we need a clear, high-level picture. When designing its logical organization, we need more detail. And when implementing it, we need to specify the physical storage.

  43. Corey

    At the conceptual level, the description is high-level and useful for understanding requirements. Database designers can use it to discuss with people who know the organization’s needs, even if those people aren’t computer scientists.

  44. Anna

    The entity-relationship model is one popular conceptual data model, and it will receive its own module. It uses the ideas of entities, relationships, and attributes—concepts that can be explained and discussed with nontechnical stakeholders.

  45. Corey

    In the university example, entities might include students, faculty members, courses, and departments. A relationship might represent students enrolling in courses, or faculty members being employed by departments.

  46. Anna

    Attributes describe details associated with those entities. A student, for instance, might have a name, a role number that distinguishes them from other students, and an address. These are the kinds of details designers can identify while gathering requirements.

  47. Corey

    A representational data model describes the database at a logical level, while setting aside many details of physical storage. That helps designers concentrate on how data is represented logically, rather than on the files and record formats that will eventually hold it.

  48. Anna

    That distinction matters because a poor logical design can cause problems even before we consider physical implementation. A representational model gives us a way to focus on the design itself without getting distracted by lower-level storage details.

  49. Corey

    At the physical level, we describe those details directly: record formats, files, and the external data structures used to represent and organize the database. This is where we specify how the information is actually represented in storage.

  50. Anna

    So the levels build on one another: conceptual tools help us understand and communicate requirements; representational tools help us design the logical organization; and physical models describe the implementation details.

  51. Corey

    And that’s the foundation for the course: what databases are, what a DBMS contributes, why dependable and consistent management matters, and how data models let us describe a database at different levels. With those ideas in place, we’re ready to study the relational model and the other modules in more depth.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent