relational database domain relational calculus language QBE

Source: Internet
Author: User

Qbe:query by Example
? Query Language based on the screen table
? Query Request: Construct a query as a form
? use sample elements (domain variables) to represent possible scenarios for query results
? Query results: Display in tabular format

QBE operating Framework

Constructing several elements of a query

Example element: Field variable, must be underlined

The sample element is a possible value in this field, which does not have to be an element in the query result
Print operator P.: Specifies the attribute columns that are included in the query result
Query criteria: Do not underline
You can use comparison operators >,≥,<,≤,= and ≠ where = can be omitted
Sorting requirements

Conditional query


common set functions:

function name function
cnt tuple count
sum sum
avg averaging
max max
min minimum


inquiry information is the average age of students.

sort the results of a query

Sort Ascending:

To sort the results of a query in ascending order of a property value, simply fill in the corresponding column. AO.?

Sort Descending:

Sort by descending? Do.

Sort multiple columns:

If you sort by multiple columns, use the? AO (i).? Or? Do (i).? Indicates that I is the priority of the sort, the lower the I value, the higher the priority level

Check the names of all the boys, the query results are ordered in ascending order of the department , and the students of the same department are sorted by age.

Modify Operation

two lines representing the pre-and post-change sample elements

Must be operator? U.? Put it on the relationship.

Eg: The age of all students in the computer system is changed to 18 years old

Eg: increase the age of 95001 students by 1 years

Eg: increase the age of all students in the computer system by 1 years

Insert Operation

Eg: the information is 95701 girls, name Zhang San, age 17 years old into the database.

Delete operation

Eg: Delete student 95089

To ensure referential integrity, delete all courses selected by 95089 Students before deleting 95089 students

relational database domain relational calculus language QBE

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: info-contact@alibabacloud.com 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.