Database Principles and Applications

Source: Internet
Author: User
Tags most popular database

4. What are the categories of computers? What are their characteristics?
Traditionally, there are three types: Large hosts, minicomputers, and minicomputers. Large hosts are generally high-performance parallel processing systems with large storage capacity and strong transaction processing capabilities, providing services for many users. Minicomputers have certain data processing capabilities and provide information services of a certain user scale as the Department's Information Service Center. Minicomputers generally refer to desktop or removable Computing Systems in the office or home. They are small in size, low in price, have industrial standard architecture, and have good compatibility.

5. What are the meanings of data, information, and data processing?
Data is a symbolic record describing all kinds of information in the real world. It is a carrier of information and a specific manifestation of information. Its specific manifestations include numbers, texts, graphics, images, and sounds.
Information is the form or motion of a thing in the real world. It is a data that has been processed as a specific form.
Data Processing refers to the use of computers to extract valuable information from a large amount of raw data as the basis for behavior and decision-making.

6. Briefly describe the relationship between data and information.
(1) Information is the meaning of various data, and data is the physical symbol of the load information.
(2) Different data forms can be used to express the same data, and the information does not change with the data representation.
(3) Information and data can be mixed.

7. What are the characteristics of data management in the manual management phase?
(1) data is not stored on the machine
(2) No special software for data management
(3) there is only a program concept, and there is no file concept.
(4) data programming

8. What are the characteristics of data management in the file system phase?
(1) data can be stored on an external disk for a long time.
(2) the logical and physical structures of data are different.
(3) The document organizations have been diversified. Index, link, and hash files
(4) data no longer belongs to a specific program and can be reused.

9. What are some defects in data management in the file system phase? Example.
The file system has three defects:
(1) data redundancy (redundancy ). Due to the lack of links between files, each application has a corresponding file, and the same data may be stored repeatedly in multiple files.
(2) inconsistency ). This is often caused by data redundancy. When performing update operations, you may make the same data different from each other.
(3) Weak data connection (poor data relationship ). No centralized management. This is caused by the lack of association between files.

10. What are the characteristics of data management in the database stage?
(1) Use a complex data model to represent the data structure.
(2) high data independence (the data structure is divided into three levels: the user's logical structure, the overall logical structure, and the physical structure ).
(3) The database system provides users with convenient user interfaces. You can use the query language, terminal commands, or programs to operate data or the database.
(4) The system provides four data control functions: Database restoration, concurrency control, data integrity, and data security, to ensure that the data in the database is secure, correct, and reliable.
(5) operations on data may not necessarily take records as units, but also data items as units, increasing the flexibility of the system.

11. Briefly describe the features of data management in the database system phase (especially relative to the file system )?
(1) good data sharing
(2) Data structuring for the entire Organization
(3) high data independence
(4) Low redundancy and controllable
(5) data is centrally managed and controlled by DBMS

12. Differences between file systems and database systems.
(1) The file system uses files to store data for a long time, and the database system uses the database to store data in a unified manner;
(2) programs in the file system are related to data, and programs and data in the database system are separated;
(3) the file system uses the access method in the operating system to manage data, and the database system uses DBMS to manage and control data in a unified manner;
(4) the file system shares data in files. The database system shares data in records and fields.

13. Relationship between the file system and the database system:
(1) management technologies for data organizations;
(2) Data is managed by data management software, and data is converted between programs and data by means of access;
(3) The database system is developed on the basis of the file system.

14. What is data redundancy?
Data Redundancy refers to repeated data in each data file.

15. How can we reduce redundancy between database systems and file systems?
(1) In the file management system, data is organized in an independent data file. Each file has a complete Architecture and Data operations are accessed by file name. There is no connection between data files. data files are oriented to applications. Each application owns and uses its own data files. Many data files are duplicated, data redundancy is relatively large.
(2) The database system manages a large amount of shared data in the form of a database. The database system consists of many separate files with a complete internal structure, but it focuses more on the relationship between files. Data in the database system is shared. The database system is built for data sharing across the system. The data of each application is centrally stored and used together, and database files are closely linked. Therefore, data duplication is avoided as much as possible, reduces and controls data redundancy.

16. Briefly describe the features of the database.
(1) organize data according to the Data Model
(2) Smaller Redundancy
(3) Independence and scalability
(4) data sharing

17. Explain the meaning and connection of the three concepts dB, DBMS, and DBS respectively?
(1) databases (databases) are a collection of organized and shareable data that has been stored in computers for a long time.
(2) Database Management System (DBMS) is a database management software used to establish, use, and maintain databases. It is located between users and operating systems.
(3) database system (DBS) refers to the system structure after a database is introduced into a computer system. Its overall purpose is to store and generate the required information, generally, it consists of a database, a database management system, a user, and a hardware environment.
(4) The database system is composed of databases and database management systems. The database management system is used to manage the database. The database is the work object of the database system.

18. What components does the database system consist?
(1) A database system is a system consisting of a database, a database management system, a user, and a hardware environment.
(2) databases are the objects of Work of the database system.
(3) The database management system is a database management software used to establish, use, and maintain databases. It is located between users and operating systems.
(4) There are three types of users in the database system: end users, application programmers, and database administrators. The database management system is a software system responsible for database access, maintenance, and management.
(5) The hardware environment ensures the operation of the database system.

19. What are the advantages of using a database system?
(1) fast and accurate query, saving a lot of paper files.
(2) structured data and managed by DBMS
(3) low data redundancy
(4) high data independence
(5) good data sharing
(6) DBMS also provides data control functions

20. What does a three-level structure and two-level image in the database architecture mean?
The database architecture is divided into three levels: internal level, concept level, and external level.
(1) User Data logic structure level: it is the closest to the user and is the data feature that a single user can see. The description of the data view used by a single user is called "external mode ".
(2) overall logical structure level: it involves data definitions of all users and is a global data view. The description of the global data view is called "concept mode ".
(3) physical storage structure level: it is the most suitable for physical storage devices and involves the actual data storage structure. The description of the physical storage data view is called "internal mode ".
To achieve the association and transformation of these three abstract levels, DBMS provides two layers of Images Between level structures: external mode/mode image, mode/internal mode image.

21. What is the meaning of second-level data independence?
(1) Data independence indicates that there is no dependency between the application and the data stored in the database, including the logical independence of the data and the physical independence of the data.
(2) The logical independence of data refers to the independence between the local Logical Data Structure (external view) and the Global Logical Data Structure (conceptual view. When the Global Logical Data Structure (concept view) of the database changes (data definition changes, data association changes, or new data types, as long as the image relationship between the external mode and the logical mode is changed to ensure that the external mode remains unchanged, the applications established in the external mode can also remain unchanged, that is, the applications are independent of the changes in the logical mode.
(3) The physical independence of data is to change the elbow of the index data storage structure and access method (internal view), and to the Global Logical Structure (concept view) of the database) and the application does not need to be modified. When the storage structure of data changes, you only need to change the image relationship from the conceptual mode to the internal mode, so that the conceptual mode remains unchanged and the application does not need to be modified, that is, the application is independent from the change of the physical storage structure.

22. What are the benefits of Data independence?
The physical storage device of the data is updated, and the physical representation and access method are changed, but the logical mode of the data does not change. The logic mode of the data has changed, but the user mode can be unchanged, so the application can also remain unchanged. This makes program maintenance easy. In addition, different user modes can be established for the logic mode of the same database to improve data sharing and make the database system more scalable, it is convenient for DBAs to maintain and change the physical storage of databases.

23. Briefly describe the advantages of the Three-Level schema of the database system (benefits brought to the database system ).
(1) ensures data independence
(2) Simplified users' excuses and made it easier for users to use
(3) conducive to data sharing
(4) data security and confidentiality

24. Briefly describe the differences and connections between the three-level structure of the database.
(1) The three-level structure of a database refers to the architecture of a database system consisting of an internal view, a conceptual view, and an external view.
(2) The internal view is the layer closest to the physical storage in the three abstract layers of the database. It reflects the actual storage mode of data and represents the actual storage of the entire database.
(3) The conceptual view is the intermediate layer of the three abstract layers of the database between the internal and external layers. It is a common view of all individual user views, it is the smallest union of all external views and is the abstract representation of the actual storage of the entire database.
(4) The external view is the layer closest to the user in the three abstract layers of the database. It reflects the way each user views the database and is an abstract representation of a part of the conceptual view.
(5) The view corresponding to the level-3 structure is the three layers of the architecture. The external view reflects how each user views the database. The conceptual view is a common view of all individual users. The internal view reflects the actual data storage mode.
(6) The external view is a partial abstract representation of the conceptual view, and the conceptual view is an abstract representation of the internal view.

25. What are the differences between data independence and data connection?
Data independence means that applications and data are independent from each other and are not affected.
Data connection refers to the connection between fields in the same record and between records.

26. Main Functions of DBMS:
(1) database definition function: DBMS provides a Data Definition Language (DDL) to define the three-level structure of a database and its image, integrity, security control, and other constraints.
(2) database manipulation: DBMS provides a data manipulation language (DML) to operate data in the database.
(3) database protection function: DBMS protects databases mainly through four aspects: database recovery, database concurrency control, database integrity control, and database security control.
(4) database storage management: the DBMS storage management subsystem provides an interface for data and applications in the database. It is responsible for converting various DML statements into low-level file system commands, it stores, retrieves, and updates data.
(5) database maintenance functions: the DBMS provides the database maintenance functions mainly including data loading programs, backup programs, file re-organizing programs, and performance monitoring programs.
(6) Data Dictionary (dd): the database that stores the three-level structure definition in the database system is called a data dictionary. operations on the database must be performed by accessing the DD.

27. Briefly describe the primary responsibilities of the database administrator (DBA.
(1) participate in the whole process of database design and design the structure and content of the database
(2) determine and optimize database storage and read policies
(3) define data security and integrity
(4) supervise and control the use and operation of databases and handle problems in a timely manner
(5) Improve and reconstruct the Database System

28. Briefly describe the advantages of relational databases.
(1) relational models are based on strict mathematical concepts and have a solid theoretical foundation;
(2) The relational model (table) is used as the data organization mode. The concept is simple, clear, and intuitive;
(3) Multiple-to-multiple connections between entities;
(4) Better Data independence;
(5) users do not need to understand complex access paths, and do not need to explain "How to Do". They only need to explain "what to do", which is easy to understand and learn.

29. Briefly describe the data access process of DBMS.
(1) The user sends an access request to the DBMS using a specific data operation language;
(2) DBMS accepts this request and explains it;
(3) DBMS checks the outer mode, external/conceptual image, conceptual mode, conceptual/inner image, and storage structure definition in sequence;
(4) DBMS performs necessary access operations on the storage database.

30. describe the role of the data dictionary.
(1) allows the database management system to quickly find information about objects. When processing user access, the database management system should frequently check the user table, submode table, and mode table in the data dictionary.
(2) The database administrator can query the operation of the entire system.
(3) supports database design and system analysis.

31. Briefly describe the role of DBMS in the database access process.
The user operates the database. The DBMS takes the operation from the application to the external level, concept level, and internal level, and then operates the data in the memory.

32. Test the database protection function of DBMS.
DBMS protects databases in four aspects:
(1) database recovery.
(2) database concurrency control.
(3) Data Warehouse integrity control.
(4) database security control.

33. Test the database maintenance function of DBMS.
DBMS provides some programs for database administrators to run the database system. These programs provide database maintenance functions.
There are mainly four utilities:
(1) Loading)
(2) backup program)
(3) document re-organizing procedures
(4) Performance Monitoring Program

34. What kind of person is DBA?
DBA is the person who controls the overall data structure and is responsible for the normal operation of DBS. A dba can be a single person or a group composed of several persons in a large system. DBA is responsible for creating, monitoring, and maintaining the entire database structure.

35. What qualities should DBA have?
(1) familiar with the nature and use of all the enterprise data;
(2) have a full understanding of user needs;
(3) familiar with system performance.

36. What are the main responsibilities of DBA?
(1) Definition of conceptual patterns
(2) internal mode definition
(3) modify the conceptual and internal modes of the database as required
(4) Database Access Authorization
(5) Description of integrity constraints

37. What types of DBS users are there?
DBS are used in four categories:
(1) DBA
(2) professional users
(3) application programmers
(4) End User

38. What functions does the DBMS query processor provide?
The query processor of DBMS can be divided into four components:
(1) DML Compiler
(2) embedded DML pre-Compiler
(3) DDL Compiler
(4) query and run the core program

39. What are the functions of the DBMS storage processor?
The DBMS storage processor provides an interface for applications to access data in the database, which can be divided into four components:
(1) Authorization and integrity Manager
(2) Transaction Manager
(3) File Manager
(4) buffer manager

40. What are the four main types of data structures in disk storage?
(1) Data Files: stores data in the database;
(2) Data Dictionary (dd): stores the description of a three-level structure;
(3) index file: the logical sorting method set to improve the query speed;
(4) Statistical Data Organization: stores statistical analysis data during DBS running.

41. explain the importance of the concept mode in the database structure.
Conceptual mode is the description of the overall logical structure of all data in the database. It consists of several conceptual record types. The conceptual mode not only describes the conceptual record type, but also describes the relationship between records, operations, data integrity, security, and other requirements. Data is described in the external mode and stored in the disk according to the internal mode. The conceptual mode provides a relatively stable intermediate point of view for connecting the two levels, in addition, any level-1 change of the two levels will not be restrained by another level.

43. Data describes the relationships between the three fields:
From the characteristics of things to the Data Representation in computers, we have gone through three fields: the real world, the information world, and the machine world.
(1) Real World: an objective world exists outside people's minds and is called the real world.
(2) Information World: reflects the real world in people's minds.
(3) machine world: Information in the information world is stored as data in the machine world.
In the information world, the terms of data description include entity, entity set, attribute, and entity identifier.
The terms described in the machine world include fields, records, files, and key codes.
Each concept in a database is differentiated between types and values. types are the meaning of concepts, and values are the extension of concepts.

44. What is entity )?
It refers to the objective existence of things that can be different from each other. Entities can be specific objects, such as a student or a car. They can also be abstract events, such as a loan or a football match.

45. What is attribute )?
An object has many features, each of which is called an attribute. Each attribute has a value field. Its type can be integer, real, or string. For example, a student (entity) has attributes such as student ID, name, age, and gender. The value range is character, String, integer, and string.

46. What is field )?
The name unit marking object properties is called a field or data item. It is the smallest unit of information that can be named. Therefore, it is also called a data element or an elementary item. Field names are often the same as attribute names. For example, students have student IDs, names, ages, and genders.
47. What is record )?
An ordered set of fields is called a record. Generally, a record is used to describe an object. Therefore, a record can be defined as a field set that can fully describe an object. For example, a student record is composed of an ordered field set (student ID, name, age, and gender.

48. In the E-R model, what types of links are divided?
(1) Contact: if each entity in entity set E1 can only be associated with one entity in entity set E2, and vice versa, the link between entity set E1 and E2 is called "one-to-one link", which is recorded ".
(2) 1: N: if each entity in entity set E1 is associated with any (zero or multiple) entity in entity set E2, in E2, each entity is at most associated with one entity in E1, so the link between E1 and E2 is "one-to-many", which is marked as "1: N ".
(3) M: N: if each entity in entity set E1 is associated with any (zero or multiple) entity in entity set E2, and vice versa, the E1-to-E2 contact is "many-to-many" and is marked as "M: N ".


49. What is a data model?
Data Model: The model is an abstraction of the real world. In database technology, a model that represents the relationship between object types and object types is called a "data model ". It can be divided into two types: Conceptual Data Model and structural data model.

50. What is a conceptual data model?
Conceptual Data Model: A model independent of a computer system that does not involve information representation in the system. It is only used to describe the information structure that a particular organization cares about.

51. What is a structure data model?
Structure Data Model: A logical structure directly oriented to databases. It is the second abstraction of the real world. This type of model involves computer systems and database management systems, so it is called "Structured Data Model ". The Structure Data Model consists of three parts: data structure, data operations, and data integrity constraints. It mainly includes three models: hierarchy, mesh, and relationship.

52. What are the meanings of the hierarchical model, mesh model, and relational model?
Hierarchical Model: uses a tree structure to represent the data model of the object type and the association between objects.
Mesh Model: A directed graph structure is used to represent the data model of the object type and the association between objects.
Relational Model: it is currently the most popular database model. Its main feature is to use a two-dimensional table structure to express the object set, and use an external vertex to represent the relationship between objects. A relational model is a set of several relational patterns.

53. Two forms of data description:
Data description can be in the form of physical description and logical description.
The description of physical data refers to the storage method of data on the storage device. Physical data is actually stored on the storage device.
Logical Data Description refers to the data form that a programmer or user uses to operate. It is abstract conceptual data.
One of the functions of data management software is to convert logical data into physical data and convert physical data into logical data.

54. What are the three components of the structure data model?
Data structure, data operations, and data integrity constraints are three components of the structure data model.
Data Structure: refers to the expression and implementation of the relationship between object types and objects.
Data operation: it refers to the implementation of two types of operations for database retrieval and updating (insertion, deletion, and modification ).
Data integrity constraints: Provide the constraints and dependency rules for data and its contact.

55. What is the development process of formatting the data model?
Generation 1: hierarchical model and mesh model
Generation 2nd: Relational Model
Generation 2.5: object-relational model
3rd Generation: Object-oriented Data Model

56. describes the relationships and differences between models, models, and specific values.
(1) A data model is used to represent the abstract description of entities in the information world and their relationships in the data world. It describes the logical structure of data.
(2) The subject of the mode is the data model of the database. Both data models and models belong to the type category.
(3) the so-called "type" refers to a type that only contains the name of the property and does not contain the property value. The so-called "value" refers to the specific instance value of the type, that is, the type with the value assigned. In VFP, the medium type is the structure of the database table, and the value is the record stored in the database table.

57. Briefly describe the abstract process of the Data Model
(1) The data model has gone through two levels of abstraction and transformation.
(2) In the first stage, abstract objective objects in the real world into conceptual models in the information world.
(3) In the second-level process, the conceptual model in the information world is converted into the data model in the machine world.

58. Which of the following basic data models are divided?
(1) The data model is an objective reflection of the links between various entities in the real world. It is the basic structure of entity information described by records. It requires that entities correspond to records one by one. The same record type describes the same class of entities and must be homogeneous.
(2) Currently, the models used in database technology are relational, mesh, and hierarchical. They are divided based on different ways to describe the relationship between entities.
(3) A relational model uses a two-dimensional table to represent the relationship between an object and an object. A graph structure is used to represent the relationship between an object and an object. A mesh model is called a mesh model, A tree structure is used to represent the relationship between an object and an object.

59. Briefly describe the characteristics of the relational data model.
(1) Description consistency: describes not only the object itself, but also the relationship between objects.
(2) Multiple-to-multiple connections can be expressed directly.
(3) The relationship must be a canonicalized relationship, which simplifies the structure and operation of the relationship model.
(4) relational models are based on mathematical concepts and have a strong theoretical basis.

60. What are the characteristics of the ER model?
Main features of the ER Model:
Advantages: It is close to human thinking and easy to understand. It has nothing to do with computers and is easy for users to accept.
Disadvantage: Only semantic links between entities can be described, and detailed data structures cannot be further described.

61. What are the main features of the relational model?
It is easy to use tables and easy to understand. Programming does not involve details such as storage structures and access technologies.

62. What are the characteristics of a layered model?
A data model that uses a tree structure to represent the relationship between object types and objects is called a hierarchical model.
Hierarchies are characterized by pointer-based connections between records, resulting in high query efficiency.
Disadvantage: (1) Only 1: N contact
(2) due to the strict and complex hierarchy of tree structures, Data Query and update operations are also complicated, so compiling applications is also complicated.

63. What are the characteristics of the mesh model? :
The data model that uses a directed graph structure to represent the relationship between object types and objects is called a mesh model.
The characteristics of the mesh model are that the connections between records are implemented through pointers, and M: N connections are also easy to implement, resulting in high query efficiency.
Disadvantages: writing applications is complicated. programmers must be familiar with the logical structure of databases.

64. What is a link?
A link is a subset of the actual meanings extracted from the flute credits of a domain. It is a two-dimensional table with a relational name.

65. What is a relational model?
The link mode describes the link structure. It describes the attributes that constitute the link, the domains from which these attributes are mapped to the domain, and the integrity constraints of the link. The format is: link name (attribute 1, attribute 2 ,......, Attribute name N ). A link mode corresponds to the structure of a link file.

66. Comparison and Relationship Mode
(1) The relational model refers to the relational model (structure), while the relational model generally refers to the value corresponding to the pattern.
(2) The link mode is static, while the link is dynamic.
(3) link modes and relationships can be collectively referred to as links.

67. What is a domain?
A value field is a set of values of the same data type. It is used to indicate the value range of an attribute in a link.

68. What is the base?
The base number is the number of values contained in the field.

69. What is an attribute?
An attribute is a feature of an object, including its type and value. An object is described by several attributes.
70. What is a tuples?
The rows in the table are called tuples, and a row is a tuples, corresponding to a record value in the storage file.

71. What is a keyword?
A keyword is one or a group of attributes that uniquely identify the tuples in a link. In this way, the corresponding (combination) attribute values in different tuples are different.

72. What is a superkey?
Super key: the attribute set that uniquely identifies a tuples in a link is called the super key of the link mode.

73. What is a candidate key?
Candidate Key: A super key without redundant attributes is called a candidate key. (There can be multiple candidate keys)

74. What is a primary key?
Primary Key (primary key): A candidate key selected as a tuples is called a primary key. (The primary key is one of the candidate keys)

75. What is an external keyword?
Foreign keywords: The corresponding attribute of the primary key of a link appears in another relational system. At this time, the primary key is the foreign key of another link. If there are two relations, S and SC, s # is the primary key of link S, and the corresponding attribute s # also appears in the Link SC. In this case, s # Is the foreign key of The Link SC.

76. describes the nature of a link.
(1) The column is homogeneous: the attribute values under the same attribute are of the same type and must come from the same domain.
(2) attributes must have different attribute names. different attributes can come from the same domain.
(3) The order of attributes is unordered: the order of columns does not matter and can be exchanged at will.
(4) tuples are unique: any two tuples cannot be identical.
(5) The order of tuples is irrelevant: the order of tuples can be exchanged randomly.
(6) All attribute values are atomic: Each component must be an inseparable data item.

77. Why do we only use the canonicalized relationship?
(1) There is no actual limit on the content to be represented;
(2) From the mathematical point of view, a normalized relationship has a simpler data structure than a non-normalized relationship, which leads to a series of other problems.

78. test the integrity constraints of the primary key and the external key, and explain the causes.
(1) The integrity constraints of the primary key are Entity integrity, which means that the value of the primary key cannot be blank or partially empty.
(2) If the attribute value of a primary link key is null or some of the values are null, it violates the definition conditions of the primary link key and loses the role of the Identity tuples and even the entity, this is in conflict with the fact that entities in the real world can be distinguished.
(3) Constraints on the integrity of the external key, that is, the integrity of the reference, that is, the foreign key in the link must be consistent with the key of the reference link, so there is a value in the reference link, or the null value is used.
(4) The ing between the external link key and the primary link key provides a method to achieve two link connections. Because the two links are related, if there is no reference value in the reference relationship, the reference will not be available; and the foreign key takes a null value without reference, which is allowed.
79. Link mode, link submode, and storage mode:
The relational model basically follows the three-level architecture of the database. Conceptual patterns are a set of relational patterns, external patterns are a set of relational subpatterns, and internal patterns are a set of storage patterns.
(1) relational mode: the relational mode is actually a record type. It defines the schema name, attribute name, Value Domain Name, and primary key of the schema.
(2) relational submode: describes the data used by the user. In addition to user data, the correspondence between the mode and the sub-mode should also be pointed out.
(3) storage mode: During relational storage, the basic organization mode is file, and the tuples are records in the file. You can use the hash or index method to store a link. If the number of groups in the link is small, you can use the heap file method.

80. Three types of integrity rules of the relational model:
(1) entity integrity rule: This rule requires that the element group in the link cannot have null values on the attributes that constitute the primary key.
(2) Reference integrity rules: This rule requires "no reference to nonexistent entities ".
(3) User-Defined integrity rules: they reflect the semantic requirements that must be met for the data involved in a specific application.

81. definitions in the form of integrity rules:
If attribute set K is the primary key of relational model R1, and K is also the foreign key of relational model R2, then in the relationship of R2, the value of K can be only two possibilities, or is empty, or equal to a primary key value in the R1 relationship.
Pay attention to three points when using this rule:
(1) Foreign keys and corresponding primary keys can have different names, as long as they are defined on the same value range.
(2) R1 and R2 can also be in the same link mode, indicating the relationship between attributes.
(3) whether the foreign key value is allowed to be null depends on the specific problem.
In the formal definition above, the relational model R1 is called the "reference relationship" mode, and R2 is called the "dependency relationship" mode.

82. What is relational algebra?
Is a set of algebra operations applied to links. Each operation uses one or more links as the calculation object and generates another link as the result of the relational operation.

83. What are the traditional relational operations? What are their meanings?
(1) Union of relations: merge all tuples of relations R and S, and delete duplicate tuples to form a new relationship, which is called R and S and is recorded as R ∪ S.
(2) relationship difference: the difference between relationship R and relationship S is a set of all tuples belonging to R but not S, that is, delete the same tuples In the relation R from the relation s to form a new relation, which is recorded as r-s.
(3) relationship intersection: The intersection of relationship R and relationship S is a set of tuples that belong to both R and S, that is, the same tuples are obtained in the R and S relations to form a new relationship, which is recorded as R ∩ S.

84. What is a selection operation?
The selection operation selects several tuples Based on the given conditions in the specified link to form a new relational operation. This operation extracts tuples from the perspective of rows (horizontal. The relational model of the new and old relationships is the same as that of the original relationship.

85. What is a projection operation?
Select an attribute column in the link and delete duplicate rows to form a new link. It selects a given link in the vertical direction. If the new system contains duplicate tuples, delete them.

86. What is join operation?
Join is to concatenate the attribute names of two links into a wider link through the Cartesian product. The generated new Link contains the tuples that meet the connection conditions. The calculation process is controlled by the join condition, and the public attribute names in different links appear in the join condition.

87. What is natural connection?
A natural connection is a multi-value connection that removes duplicate attributes. It is a special case of connection operations and is the most common connection operation.

88. What are the two types of relational query languages based on their theoretical basis?
Relational algebra language: A Query operation is a DML Language Based on a set operation. (Non-procedural weak)
Relational algorithm language: the query operation is a DML language based on the predicate algorithm. (Non-procedural)

89. What are the operations in relational algebra?
Operations in relational algebra can be divided into two types:
Traditional set operations: Sum, difference, intersection, Cartesian Product
Expanded set operations: vertical (projection), horizontal (select), link combination (join, natural join), Cartesian Product inverse (Division), etc.

90. What are the five basic operations in relational algebra?
And, difference, Cartesian Product, projection, and selection.

91. What are the four commonly used combined operations in relational algebra?
Intersection, connection, natural connection, Division
Two extended relational algebra operations are: External join and external join

92. What are the two types of relational calculus?
Relational calculus can be divided into tuples relational calculus and domain relational calculus. The former uses tuples as variables, and the latter uses attributes (fields) as variables.

93. Describe the differences and connections between equivalent connections and natural connections
(1) Contact: A natural connection is an equivalent connection that removes duplicate attributes.
(2) differences:
Natural connections must be equivalent connections, but they are not necessarily natural connections.
Equivalent connections require equal components, not necessarily public attributes. Natural connections require equal components to be public attributes.
The equijoin does not remove duplicate attributes, but the natural connection removes duplicate attributes.

94. Why are there no sequence of tuples in the link?
Because the relationship is a set of tuples, the order of tuples in the set does not matter. Therefore, the order between tuples is not considered, that is, there is no row order.

95. Why are duplicate tuples not allowed in the link?
Because a link is a set of tuples, and the elements in the set cannot appear repeatedly, the relationship is restricted in the relational model, and the tuples in the relationship cannot be repeated, you can use keys to identify unique tuples.

96. What is the difference between a link and a common table or file?
A relational table is a standardized two-dimensional table. In a relational model, the following normative constraints are imposed on the relational table:
(1) Each attribute value in a link cannot be decomposed.
(2) Duplicate tuples are not allowed in the link ).
(3) because the relationship is a set, the order between tuples is not considered, that is, there is no row order.
(4) In tuples, attributes are theoretically unordered, but columns are used in order.

97. What are the differences among cartesian products, equijoin, and natural join?
Cartesian Product performs a multiplication operation on the R and S of two relations. The number of groups in the generated relationship is the product of the number of groups in the two relations.
The equijoin operation is performed on the result of the Cartesian product, and the tuples with the same attribute values are selected from the flute points of the relationship R and S;
A natural join is to perform a projection operation on the basis of an equijoin (with all public attribute values equal as the condition) and remove duplicate public attribute columns. When two links have no public attributes, the natural join is converted to Cartesian product.

98. What is security calculation?
In database technology, operations that do not produce infinite relationships or infinite verifications are called security operations. The corresponding expressions are called security expressions and the measures taken are called security constraints.
In relational calculus, it is agreed that an operation only operates on the formulas in an expression within the range of values of the involved relationships. In this way, there will be no infinite relationship and infinite verification issues, and relational calculus is safe.

99. Why optimize relational algebra expressions?
Query optimization is a combination of relational algebra expressions by DBMS to improve the system efficiency of DBMS. The reason for optimizing relational algebra is that relational algebra expressions are composed of relational algebra operations. In relational algebra operations, it is the most time-consuming to execute cartesian products and join operations, and a large number of intermediate results will be generated during the execution, so that the system execution efficiency is low. Before execution, the DBMS query and processing subsystem first optimizes the relational algebra expressions and performs selection and projection operations as early as possible to obtain a small intermediate relationship, reduces the amount of computing and the number of read external memory blocks, saves the system execution time, and improves the execution efficiency.

100. Briefly describe the optimization strategy for query optimization?
(1) perform the selection operation as early as possible in the relational Algebra Expression.
(2) Merge cartesian products and subsequent selection operations into F join operations.
(3) calculate a series of selection and projection operations at the same time, so as not to scan files multiple times separately, thus saving operation time.
(4) If a subexpression appears multiple times in an expression, it should be pre-calculated and saved. To avoid repeated computation.
(5) pre-process the relational files as appropriate.
(6) estimate how to calculate the cost before calculating the expression.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.