0% found this document useful (0 votes)
77 views1 page

Select Customer-Name, Borrower - Loan-Number As Loan-Id, Amount From Borrower, Loan Where Borrower - Loan-Number Loan - Loan-Number

The document discusses several SQL concepts: 1. Foreign keys, which link data between tables by matching a column to a primary key in another table. 2. The AS clause, which allows renaming columns or tables in SELECT and FROM clauses. 3. LIKE operator in WHERE clauses, which allows pattern matching on strings using % and _ wildcards. 4. Multivalued dependencies require separate tuples for every combination of independent attributes, like an employee's dependents and projects, to maintain data consistency.

Uploaded by

Mamun Rassal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views1 page

Select Customer-Name, Borrower - Loan-Number As Loan-Id, Amount From Borrower, Loan Where Borrower - Loan-Number Loan - Loan-Number

The document discusses several SQL concepts: 1. Foreign keys, which link data between tables by matching a column to a primary key in another table. 2. The AS clause, which allows renaming columns or tables in SELECT and FROM clauses. 3. LIKE operator in WHERE clauses, which allows pattern matching on strings using % and _ wildcards. 4. Multivalued dependencies require separate tuples for every combination of independent attributes, like an employee's dependents and projects, to maintain data consistency.

Uploaded by

Mamun Rassal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

FOREIGN KEY: A foreign key is a field in a relational table that matches the primary key column of another table.

The foreign key can be used to cross-reference tables. AS: SQL provides a mechanism for renaming both relations and attributes, it uses the AS clause for rename. The as clause can appear in both the select and from clauses. Example: old-name as new-name select customer-name, borrower.loan-number as loan-id, amount from borrower, loan where borrower.loan-number = loan.loan-number Like: The LIKE operator is used to search for a specified pattern in a column. LIKE is used in the WHERE clause. The most commonly used operation on strings is pattern matching using the operator like. We describe patterns by using two special characters: 1. Percent (%): The % character matches any substring. 2. Underscore ( _ ): The _ character matches any character. SELECT "column_name" FROM "table_name" WHERE "column_name" LIKE {PATTERN}
11.3 MULTIVALUED DEPENDENCIES Multivalued dependencies are a consequence of first normal form (lNF), which disallows an attribute in a tuple to have a set of values. If we have two or more multivalued independent attributes in the same relation schema, we get into a problem of having to repeat every value of one of the attributes with every value of the other attribute to keep the relation state consistent and to maintain the independence among the attributes involved. This constraint is specified by a multivalued dependency. For example, consider the relation EMP shown in Figure ll.4a. A tuple in this EMP relation represents the fact that an employee whose name is ENAME works on the project whose name is PNAME and has a dependent whose name is DNAME. An employee may work on several projects and may have several dependents, and the employee's projects and dependents are independent of one another. To keep the relation state consistent, we must have a separate tuple to represent every combination of an employee's dependent and an employee's project. This constraint is specified as a multivalued dependency on the EMP relation. Informally, whenever two independent l:N relationships A:B and A:C are mixed in the same relation, an MVD may arise.

You might also like