正在加载图片...
Projection The select clause corresponds to the projection operation of the relational algebra. It is used to list the attributes desired in the result of a query Find the names of all branches in the loan relation select branch-name from loan Equivalent to: I lbranch-name (loan) An asterisk in the select clause denotes all attributes select from loan Note: for our examples we use the tables: Branch(branch-name, branch-city, assets) Customer(customer-name, customer-street, customer-city) Loan(loan- number, amount, branch-name) Account(account-number, balance branch-name Borrower(customer-name, loan-number) Depositor(customer-name account-number COMP3311 Fall 2011 CSE, HKUST Slide 5COMP3311 Fall 2011 CSE, HKUST Slide 5 Projection • The select clause corresponds to the projection operation of the relational algebra. It is used to list the attributes desired in the result of a query. • Find the names of all branches in the loan relation select branch-name from loan Equivalent to: branch-name(loan) • An asterisk in the select clause denotes “all attributes” select * from loan • Note: for our examples we use the tables: – Branch (branch-name, branch-city, assets) – Customer (customer-name, customer-street, customer-city) – Loan (loan-number, amount, branch-name) – Account (account-number, balance, branch-name) – Borrower (customer-name, loan-number) – Depositor (customer-name, account-number)
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有