A diagrammatic representation of the data model of an application is a very important part of designing a database schema. Creation of a database schema requires not only data modeling experts, but also domain experts who know the requirements of the application but may not be familiar with data modeling. An intuitive diagrammatic representation is particularly important since it eases communication of information between these groups of experts. 继续阅读“Database Design ~ Database Design and the E-R Model V”
Database Design ~ Database Design and the E-R Model IV
Although the basic E-R concepts can model most database features, some aspects of a database may be more aptly expressed by certain extensions to the basic E-R model. In this section, we discuss the extended E-R features of specialization, generalization, higher-and lower-level entity sets, attribute inheritance, and aggregation.
To help with the discussions, we shall use a slightly more elaborate database schema for the university. In particular, we shall model the various people within a university by defining an entity set person, with attributes ID, name, and address. 继续阅读“Database Design ~ Database Design and the E-R Model IV”
Database Design ~ Database Design and the E-R Model III
We can represent a database that conforms to an E-R database schema by a collection of relation schemas. For each entity set and for each relationship set in the database design, there is a unique relation schema to which we assign the name of the corresponding entity set or relationship set. 继续阅读“Database Design ~ Database Design and the E-R Model III”
Database Design ~ Database Design and the E-R Model II
As we saw briefly in Database System Concepts ~ Introduction I, an E-R diagram can express the overall logical structure of a database graphically. E-R diagrams are simple and clear——qualities that may well account in large part for the widespread use of the E-R model. 继续阅读“Database Design ~ Database Design and the E-R Model II”
Database Design ~ Database Design and the E-R Model I
Up to this point in the text, we have assumed a given database schema and studied how queries and updates are expressed. We now consider how to design a database schema in the first place. In this section, we focus on the entity-relationship data model (E-R), which provides a means of identifying entities to be represented in the database and how those entities are related. Ultimately, the database design will be expressed in terms of a relational database design and an associated set of constraints. We show in this section how an E-R design can be transformed into a set of relation schemas and how some of the constraints can be captured in that design. 继续阅读“Database Design ~ Database Design and the E-R Model I”
Relational Databases ~ Advanced SQL III
Consider the instance of the relation prereq shown in Figure 1 containing information about the various courses offered at the university and the prerequisite for each course.
Figure 1 The prereq relation. 继续阅读“Relational Databases ~ Advanced SQL III”
Relational Databases ~ Advanced SQL II
We have already seen several functions that are built into the SQL language. In this section, we show how developers can write their own functions and procedures, store them in the database, and then invoke them from SQL statements. 继续阅读“Relational Databases ~ Advanced SQL II”
Relational Databases ~ Advanced SQL I
In previous series, we provided detailed coverage of the basic structure of SQL. In this series, we cover some of the the more advanced features of SQL. We address the issue of how to access SQL from a general-purpose programming language, which is very important for building applications that use a database to store database, either by extending the SQL language to support procedural actions, or by allowing functions defined in procedural languages to be executed within the database. We describe triggers, which can be used to specify actions that are to be carried out automatically on certain events such as insertion, deletion, or update of tuples in a specified relation. We discuss recursive queries and advanced aggregation features supported by SQL. Finally, we describe online analytic processing (OLAP) systems, which support interactive analysis of very large datasets. 继续阅读“Relational Databases ~ Advanced SQL I”
Relational Databases ~ Intermediate SQL III
In previous series, we covered a number of built-in data types supported in SQL, such as integer types, real types, and character types. There are additional built-in data types supported by SQL, which we describe below. We also describe how to create basic user-defined types in SQL. 继续阅读“Relational Databases ~ Intermediate SQL III”