File notes/lectures_notes.md changed (mode: 100644) (index c352277..4bc8dc8) |
... |
... |
A typical (metting twice a week, ±17 weeks, ±30 classes) semester is divided a |
76 |
76 |
- Lecture 29: Introduction to NoSQL |
- Lecture 29: Introduction to NoSQL |
77 |
77 |
- Lecture 30: Introduction to MongoDB |
- Lecture 30: Introduction to MongoDB |
78 |
78 |
|
|
79 |
|
For information purposes, a straight line like this: |
|
|
79 |
|
For information purposes, an indication like this: |
80 |
80 |
|
|
81 |
81 |
--- |
--- |
82 |
82 |
|
|
|
... |
... |
To give you a sense of what you will be asked to do during the exams, please fin |
102 |
102 |
- [%D %n (%T)](#problem:NormalizeContact) |
- [%D %n (%T)](#problem:NormalizeContact) |
103 |
103 |
- A variation on [%D %n (%T)](#problem:ERtoRELCountry) |
- A variation on [%D %n (%T)](#problem:ERtoRELCountry) |
104 |
104 |
- Final: |
- Final: |
105 |
|
- A variation on [%D %n (%T)](#exercise:ErrorsInCode) |
|
|
105 |
|
- A variation on (@exercise:ErrorsInCode) |
106 |
106 |
- A variation on [%D %n (%T)](#problem:coffee) |
- A variation on [%D %n (%T)](#problem:coffee) |
107 |
107 |
- A variation on [%D %n (%T)](#problem:UMLtoRELDriver): students were asked to draw the ER diagram for that schema. |
- A variation on [%D %n (%T)](#problem:UMLtoRELDriver): students were asked to draw the ER diagram for that schema. |
108 |
108 |
- [%D %n (%T)](#problem:book) |
- [%D %n (%T)](#problem:book) |
|
... |
... |
To give you a sense of what you will be asked to do during the exams, please fin |
111 |
111 |
### Spring 2018 {-} |
### Spring 2018 {-} |
112 |
112 |
|
|
113 |
113 |
- Exam #1: |
- Exam #1: |
114 |
|
- [%D %n (%T)](#problem:cinema), except that I gave some of the relatins and attributes, to help getting started with the problem. |
|
|
114 |
|
- [%D %n (%T)](#problem:cinema), except that I gave some of the relations and attributes, to help getting started with the problem. |
115 |
115 |
- [%D %n (%T)](#problem:designforprof) |
- [%D %n (%T)](#problem:designforprof) |
116 |
116 |
- [%D %n (%T)](#problem:train) |
- [%D %n (%T)](#problem:train) |
117 |
117 |
- [%D %n (%T)](#problem:coffee) |
- [%D %n (%T)](#problem:coffee) |
|
... |
... |
To give you a sense of what you will be asked to do during the exams, please fin |
128 |
128 |
- A variation on [%D %n (%T)](#problem:BusinessToEr) |
- A variation on [%D %n (%T)](#problem:BusinessToEr) |
129 |
129 |
- A variation on [%D %n (%T)](#problem:UMLtoRELDriver): students were asked to draw the ER diagram for that schema. |
- A variation on [%D %n (%T)](#problem:UMLtoRELDriver): students were asked to draw the ER diagram for that schema. |
130 |
130 |
|
|
|
131 |
|
### Fall 2019 {-} |
|
132 |
|
|
|
133 |
|
- Exam #1: |
|
134 |
|
- [%D %n (%T)](#problem:sqlBooks) |
|
135 |
|
- Five exercises (@exercise:nameDBMS, @exercise:diff_op_trans, @exercise:dealing_with_violations, @exercise:twice_row_sql) |
|
136 |
|
- A variation on [%D %n (%T)](#problem:rel_model_bills) |
|
137 |
|
|
131 |
138 |
|
|
132 |
139 |
## Typesetting and Acknowledgments {-} |
## Typesetting and Acknowledgments {-} |
133 |
140 |
|
|
|
... |
... |
Exercise +.# |
327 |
334 |
|
|
328 |
335 |
: What is a virtual data? How can I access it? |
: What is a virtual data? How can I access it? |
329 |
336 |
|
|
|
337 |
|
Exercise +.#nameDBMS |
|
338 |
|
|
|
339 |
|
: Name two DBMS. |
|
340 |
|
|
330 |
341 |
Exercise +.# |
Exercise +.# |
331 |
342 |
|
|
332 |
343 |
: Why do DBMS include concurrency control? |
: Why do DBMS include concurrency control? |
|
... |
... |
Solution +.# |
376 |
387 |
|
|
377 |
388 |
Solution +.# |
Solution +.# |
378 |
389 |
|
|
|
390 |
|
: Oracle RDBMS, IBM DB2, Microsoft SQL Server, MySQL, PostgreSQL, Microsoft Access, etc., are valid answers. Are not valid "SQL", "NoSQL", "Relational Model", or such: we are asking for the names of actual softwares! |
|
391 |
|
|
|
392 |
|
Solution +.# |
|
393 |
|
|
379 |
394 |
: To ensure that several users trying to update the same data will do so in a controlled manner. To avoid inconsistency. |
: To ensure that several users trying to update the same data will do so in a controlled manner. To avoid inconsistency. |
380 |
395 |
|
|
381 |
396 |
Solution +.# |
Solution +.# |
|
... |
... |
Tuples can't be equal, so a subset of values must distinguish them, we study the |
594 |
609 |
- A **candidate key** is a key, a **primary key** is the selected candidate key (it is u͟n͟d͟e͟r͟l͟i͟n͟e͟d͟^[For technical reasons, underlined words cannot be searched in the document.]). |
- A **candidate key** is a key, a **primary key** is the selected candidate key (it is u͟n͟d͟e͟r͟l͟i͟n͟e͟d͟^[For technical reasons, underlined words cannot be searched in the document.]). |
595 |
610 |
|
|
596 |
611 |
Note: here we "retro-fit" those definitions, in DB design, they come first! |
Note: here we "retro-fit" those definitions, in DB design, they come first! |
|
612 |
|
We are making the assumption that the data pre-exist to the specification to make the concept clearer. |
597 |
613 |
|
|
598 |
614 |
| A | B | C | D | |
| A | B | C | D | |
599 |
615 |
| :---: | :---: | :---: | :---: | |
| :---: | :---: | :---: | :---: | |
|
... |
... |
Note: here we "retro-fit" those definitions, in DB design, they come first! |
608 |
624 |
|
|
609 |
625 |
### Foreign Keys |
### Foreign Keys |
610 |
626 |
|
|
611 |
|
A **foreign key** is a set of attributes FK in the relation schema R$_1$ is a foreign key of R$_1$ ("referencing relation") that references R$_2$ ("referenced relation") if |
|
|
627 |
|
A **foreign key** (FK) is a set of attributes denoted FK in the relation schema R$_1$, such that FK is a foreign key of R$_1$ ("referencing relation") that references R$_2$ ("referenced relation") if |
612 |
628 |
|
|
613 |
629 |
- FK refers to R$_2$ (i.e., the attributes in FK have the same domain(s) as the primary key PK of R$_2$) |
- FK refers to R$_2$ (i.e., the attributes in FK have the same domain(s) as the primary key PK of R$_2$) |
614 |
630 |
- a value of FK in a tuple t$_1$ of r$_1$(R$_1$) either |
- a value of FK in a tuple t$_1$ of r$_1$(R$_1$) either |
|
... |
... |
Exercise +.# |
749 |
765 |
|
|
750 |
766 |
: Give three examples of operations. |
: Give three examples of operations. |
751 |
767 |
|
|
|
768 |
|
Exercise +.#diff_op_trans |
|
769 |
|
|
|
770 |
|
: What is the difference between an operation and a transaction? |
|
771 |
|
|
|
772 |
|
Exercise +.#dealing_with_violations |
|
773 |
|
|
|
774 |
|
: Give three different ways to deal with operations whose execution in isolation would result in the violation of one of the constraint. |
|
775 |
|
|
752 |
776 |
Exercise +.# |
Exercise +.# |
753 |
777 |
~ |
~ |
754 |
778 |
Consider the following two relations: |
Consider the following two relations: |
|
... |
... |
Solution +.# |
867 |
891 |
a) COMPUTER has for arity $4$, and OS has for arity $3$. |
a) COMPUTER has for arity $4$, and OS has for arity $3$. |
868 |
892 |
b) ("Linda McFather", 32, 2017, "Purism"), and ("Debian", "Stable", "amd64") |
b) ("Linda McFather", 32, 2017, "Purism"), and ("Debian", "Stable", "amd64") |
869 |
893 |
|
|
|
894 |
|
|
|
895 |
|
Solution +.# |
|
896 |
|
|
|
897 |
|
: An operation is an "atomic action" that can be performed on the database (adding an element, updating a value, removing an element, etc.). A transaction is a series of such operations, and the assumption is that, even if it can be made of operations that, taken individually, could violate a constraint, an operation will leave the database in a consistent state. |
|
898 |
|
|
|
899 |
|
Solution +.# |
|
900 |
|
|
|
901 |
|
: An operation whose execution in isolation would result in the violation of a constraint can either a) be "restricted" (i.e., not executed), b) result in a propagation (i.e., the tuples that would violate a constraint are updated or deleted accordingly), or c) result in some values in tuples that would violate a constraint to be set to a default value, or the `NULL` value (this last option works only if the constraint violated is the referential entity constraint). |
|
902 |
|
|
870 |
903 |
Solution +.# |
Solution +.# |
871 |
904 |
|
|
872 |
905 |
: The requirement that each tuple must have for an attribute $A$ an atomic value from the domain dom($A$), or `NULL`{.sqlmysql}. |
: The requirement that each tuple must have for an attribute $A$ an atomic value from the domain dom($A$), or `NULL`{.sqlmysql}. |
|
... |
... |
Problem (Relational model for a cinema company) +.#cinema |
946 |
979 |
- Each theater can schedule movies at show-times. Each show-time has a unique id, a start time, and is for a specific movie, at a theater auditorium. |
- Each theater can schedule movies at show-times. Each show-time has a unique id, a start time, and is for a specific movie, at a theater auditorium. |
947 |
980 |
- The company sells tickets for scheduled show-times. Each ticket has a unique ticket id, and a price. |
- The company sells tickets for scheduled show-times. Each ticket has a unique ticket id, and a price. |
948 |
981 |
|
|
|
982 |
|
--- |
|
983 |
|
|
|
984 |
|
Problem (Relational model for bills) +.#rel_model_bills |
|
985 |
|
~ |
|
986 |
|
Propose a relational model for the following situation: |
|
987 |
|
|
|
988 |
|
- You want to store the bills that are debated and voted on at the U.S. House of Representatives. Each bill has a name, a (unique) sponsor which needs to be a member of the house, a date when it was discussed (which may not have been fixed yet). |
|
989 |
|
- You want to record the name, political group, beginning and (expected) end of the term of the members of the house. |
|
990 |
|
- You also want to record the name of the Speaker, Majority Leader, Minority Leader, Majority Whip, and Minority Whip, which are all members of the house. |
|
991 |
|
- Finally, for each bill, you want to record the vote of every member of the house. |
|
992 |
|
|
949 |
993 |
## Solution to Selected Problems {-} |
## Solution to Selected Problems {-} |
950 |
994 |
|
|
951 |
995 |
Solution to @problem:cinema |
Solution to @problem:cinema |
952 |
996 |
|
|
953 |
|
 |
|
961 |
|
\ |
|
|
997 |
|
~ |
|
998 |
|
|
|
999 |
|
 |
|
1007 |
|
\ |
|
1008 |
|
|
|
1009 |
|
--- |
|
1010 |
|
|
|
1011 |
|
Solution to @problem:rel_model_bills |
|
1012 |
|
|
|
1013 |
|
~ |
|
1014 |
|
|
|
1015 |
|
Be careful: saying that a bill has a unique sponsor does *not* imply that a the sponsor is a good primary key for the bills: a house member could very well be the sponsor of multiple bills! It just implies that a single attribute is enough to hold the name of the sponsor. |
|
1016 |
|
|
|
1017 |
|
 |
|
1022 |
|
\ |
|
1023 |
|
|
|
1024 |
|
For simplicity, we added an `Id` to our `MEMBER` and `BILL` relations. Note that having a "role" in the `MEMBER` relation to store the information about speaker, etc., would be extremely inefficient, since we would add an attribute to the ~435 members that would be `NULL` in ~430 of them. |
962 |
1025 |
|
|
963 |
1026 |
# The SQL Programming Language |
# The SQL Programming Language |
964 |
1027 |
|
|
|
... |
... |
CREATE TABLE Table_default( |
1270 |
1333 |
FOREIGN KEY (Attribute2) REFERENCES F_Key(Attribute) |
FOREIGN KEY (Attribute2) REFERENCES F_Key(Attribute) |
1271 |
1334 |
); |
); |
1272 |
1335 |
|
|
1273 |
|
|
|
|
1336 |
|
-- By default, this foreign key will restrict. |
|
1337 |
|
|
1274 |
1338 |
CREATE TABLE Table_restrict( |
CREATE TABLE Table_restrict( |
1275 |
1339 |
Attribute1 VARCHAR(25) PRIMARY KEY, |
Attribute1 VARCHAR(25) PRIMARY KEY, |
1276 |
1340 |
Attribute2 VARCHAR(25), |
Attribute2 VARCHAR(25), |
|
... |
... |
SELECT Name FROM PROF |
1549 |
1613 |
|
|
1550 |
1614 |
--- |
--- |
1551 |
1615 |
|
|
|
1616 |
|
|
|
1617 |
|
## Three-Valued Logic |
|
1618 |
|
|
|
1619 |
|
Cf. [@Textbook6, 5.1.1], [@Textbook7, 7.1.1] |
|
1620 |
|
|
|
1621 |
|
### Meaning of `NULL` |
|
1622 |
|
|
|
1623 |
|
`NULL` is |
|
1624 |
|
|
|
1625 |
|
#. Unknown value ("Nobody knows") |
|
1626 |
|
|
|
1627 |
|
> What is the date of birth of [Jack the Ripper](https://en.wikipedia.org/wiki/Jack_the_Ripper)? |
|
1628 |
|
|
|
1629 |
|
> [Does P equal NP?](https://en.wikipedia.org/wiki/List_of_unsolved_problems_in_computer_science) |
|
1630 |
|
|
|
1631 |
|
#. Unavailable / Withheld ("I don't have that information with me at the moment") |
|
1632 |
|
|
|
1633 |
|
> What is the number of english spies in France? |
|
1634 |
|
|
|
1635 |
|
> What is the VIN of your car? |
|
1636 |
|
|
|
1637 |
|
> What is the identity of the Tiananmen Square person? |
|
1638 |
|
|
|
1639 |
|
#. Not Applicable ("Your question doesn't make sense") |
|
1640 |
|
|
|
1641 |
|
> What is the US SSN of a french person? |
|
1642 |
|
|
|
1643 |
|
> What is the email address of an author of the XIXth century? |
|
1644 |
|
|
|
1645 |
|
### Comparison with unknown values {truth_tables} |
|
1646 |
|
|
|
1647 |
|
If `NULL` is involved in a comparison, the result evaluates to "**U**nknown". |
|
1648 |
|
|
|
1649 |
|
|||| |
|
1650 |
|
:--: | :--: | :--: | :--: |
|
1651 |
|
**AND** | T | F | U |
|
1652 |
|
T | T | F | U |
|
1653 |
|
F | F | F | F |
|
1654 |
|
U | U | F | U |
|
1655 |
|
|
|
1656 |
|
|||| |
|
1657 |
|
:--: | :--: | :--: | :--: |
|
1658 |
|
**OR** | T | F | U |
|
1659 |
|
T | T | T | T |
|
1660 |
|
F | T | F | U |
|
1661 |
|
U | T | U | U |
|
1662 |
|
|
|
1663 |
|
|
|
1664 |
|
|| |
|
1665 |
|
:--: | :--: |
|
1666 |
|
**NOT** | \ |
|
1667 |
|
T | F |
|
1668 |
|
F | T |
|
1669 |
|
U | U |
|
1670 |
|
|
|
1671 |
|
You can test if a value is `NULL` with `IS NULL`. |
|
1672 |
|
|
|
1673 |
|
~~~{.sqlmysql .numberLines} |
|
1674 |
|
INSERT INTO DEPARTMENT Values ('Hist', 'History', NULL); |
|
1675 |
|
SELECT * FROM DEPARTMENT WHERE Head IS NULL; |
|
1676 |
|
SELECT * FROM DEPARTMENT WHERE Head IS NOT NULL; |
|
1677 |
|
SELECT COUNT(*) FROM GRADE WHERE Grade IS NULL; |
|
1678 |
|
~~~ |
|
1679 |
|
|
1552 |
1680 |
## Various Tools |
## Various Tools |
1553 |
1681 |
|
|
1554 |
1682 |
For `DISTINCT`, `ALL` and `UNION`, cf. [@Textbook6, 4.3.4] or [@Textbook7, 6.3.4]. |
For `DISTINCT`, `ALL` and `UNION`, cf. [@Textbook6, 4.3.4] or [@Textbook7, 6.3.4]. |
|
... |
... |
SELECT Login AS Username FROM PROF; |
1654 |
1782 |
|
|
1655 |
1783 |
The purpose of aliases will be clearer as we study select-project-join queries. |
The purpose of aliases will be clearer as we study select-project-join queries. |
1656 |
1784 |
|
|
1657 |
|
## Three-Valued Logic |
|
1658 |
|
|
|
1659 |
|
Cf. [@Textbook6, 5.1.1], [@Textbook7, 7.1.1] |
|
1660 |
|
|
|
1661 |
|
### Meaning of `NULL` |
|
1662 |
|
|
|
1663 |
|
`NULL` is |
|
1664 |
|
|
|
1665 |
|
#. Unknown value ("Nobody knows") |
|
1666 |
|
|
|
1667 |
|
> What is the date of birth of [Jack the Ripper](https://en.wikipedia.org/wiki/Jack_the_Ripper)? |
|
1668 |
|
|
|
1669 |
|
> [Does P equal NP?](https://en.wikipedia.org/wiki/List_of_unsolved_problems_in_computer_science) |
|
1670 |
|
|
|
1671 |
|
#. Unavailable / Withheld ("I don't have that information with me at the moment") |
|
1672 |
|
|
|
1673 |
|
> What is the number of english spies in France? |
|
1674 |
|
|
|
1675 |
|
> What is the VIN of your car? |
|
1676 |
|
|
|
1677 |
|
> What is the identity of the Tiananmen Square person? |
|
1678 |
|
|
|
1679 |
|
#. Not Applicable ("Your question doesn't make sense") |
|
1680 |
|
|
|
1681 |
|
> What is the US SSN of a french person? |
|
1682 |
|
|
|
1683 |
|
> What is the email address of an author of the XIXth century? |
|
1684 |
|
|
|
1685 |
|
### Comparison with unknown values |
|
1686 |
|
|
|
1687 |
|
If `NULL` is involved in a comparison, the result evaluates to "**U**nknown". |
|
1688 |
|
|
|
1689 |
|
|||| |
|
1690 |
|
:--: | :--: | :--: | :--: |
|
1691 |
|
**AND** | T | F | U |
|
1692 |
|
T | T | F | U |
|
1693 |
|
F | F | F | F |
|
1694 |
|
U | U | F | U |
|
1695 |
|
|
|
1696 |
|
|||| |
|
1697 |
|
:--: | :--: | :--: | :--: |
|
1698 |
|
**OR** | T | F | U |
|
1699 |
|
T | T | T | T |
|
1700 |
|
F | T | F | U |
|
1701 |
|
U | T | U | U |
|
1702 |
|
|
|
1703 |
|
|
|
1704 |
|
|| |
|
1705 |
|
:--: | :--: |
|
1706 |
|
**NOT** | \ |
|
1707 |
|
T | F |
|
1708 |
|
F | T |
|
1709 |
|
U | U |
|
1710 |
|
|
|
1711 |
|
You can test if a value is `NULL` with `IS NULL`. |
|
1712 |
|
|
|
1713 |
|
~~~{.sqlmysql .numberLines} |
|
1714 |
|
INSERT INTO DEPARTMENT Values ('Hist', 'History', NULL); |
|
1715 |
|
SELECT * FROM DEPARTMENT WHERE Head IS NULL; |
|
1716 |
|
SELECT * FROM DEPARTMENT WHERE Head IS NOT NULL; |
|
1717 |
|
SELECT COUNT(*) FROM GRADE WHERE Grade IS NULL; |
|
1718 |
|
~~~ |
|
1719 |
|
|
|
1720 |
1785 |
|
|
1721 |
1786 |
## More Select Queries |
## More Select Queries |
1722 |
1787 |
|
|
|
... |
... |
WHERE DEPARTMENT = ( SELECT Major |
1836 |
1901 |
becomes |
becomes |
1837 |
1902 |
|
|
1838 |
1903 |
~~~{.sqlmysql .numberLines} |
~~~{.sqlmysql .numberLines} |
1839 |
|
SELECT STUDENT.Login |
|
|
1904 |
|
SELECT PROF.Login |
1840 |
1905 |
FROM PROF, STUDENT |
FROM PROF, STUDENT |
1841 |
1906 |
WHERE DEPARTMENT = Major AND STUDENT.Login = "cjoella"; |
WHERE DEPARTMENT = Major AND STUDENT.Login = "cjoella"; |
1842 |
1907 |
~~~ |
~~~ |
|
... |
... |
Exercise +.# |
2212 |
2277 |
|
|
2213 |
2278 |
: Write a statement that inserts the values `"Thomas"` and `4` into the table `TRAINS`. |
: Write a statement that inserts the values `"Thomas"` and `4` into the table `TRAINS`. |
2214 |
2279 |
|
|
2215 |
|
Exercise +.# |
|
|
2280 |
|
Exercise +.#explainfk |
2216 |
2281 |
~ |
~ |
2217 |
2282 |
|
|
2218 |
2283 |
If `PkgName` is the primary key in the table `MYTABLE`, what can you tell about the number of rows returned by the following statement? |
If `PkgName` is the primary key in the table `MYTABLE`, what can you tell about the number of rows returned by the following statement? |
|
... |
... |
Exercise +.# |
2340 |
2405 |
- `NOT UNKNOWN` |
- `NOT UNKNOWN` |
2341 |
2406 |
- `FALSE OR UNKNOWN` |
- `FALSE OR UNKNOWN` |
2342 |
2407 |
|
|
|
2408 |
|
Exercise +.#truthTableAnd |
|
2409 |
|
|
|
2410 |
|
: Write the truth table for `AND`{.sqlmysql} for the three-valued logic of `SQL`. |
|
2411 |
|
|
2343 |
2412 |
Exercise +.# |
Exercise +.# |
2344 |
2413 |
|
|
2345 |
2414 |
: What comparison expression should you use to test if a value is different from `NULL`? |
: What comparison expression should you use to test if a value is different from `NULL`? |
|
... |
... |
Exercise +.# |
2382 |
2451 |
|
|
2383 |
2452 |
: Write a query that removes the default value for a `Pages` attribute in a `BOOK` table. |
: Write a query that removes the default value for a `Pages` attribute in a `BOOK` table. |
2384 |
2453 |
|
|
|
2454 |
|
Exercise +.#twice_row_sql |
|
2455 |
|
|
|
2456 |
|
: Under which conditions does `SQL` allow you to enter the same row in a table twice? |
|
2457 |
|
|
2385 |
2458 |
#### Exercises {-} |
#### Exercises {-} |
2386 |
2459 |
|
|
2387 |
2460 |
## Solution to Exercises {-} |
## Solution to Exercises {-} |
2388 |
2461 |
|
|
2389 |
2462 |
Solution +.# |
Solution +.# |
2390 |
2463 |
|
|
2391 |
|
: It can specify the conceptual and internal schema, **and** it can manipulate the data. |
|
|
2464 |
|
: It can specify the conceptual and internal schema, **and** it can manipulate the data. |
2392 |
2465 |
|
|
2393 |
2466 |
Solution +.# |
Solution +.# |
2394 |
2467 |
|
|
|
... |
... |
Solution +.# |
2531 |
2604 |
- `FALSE OR UNKNOWN`{.sqlmysql} → `FALSE`{.sqlmysql} |
- `FALSE OR UNKNOWN`{.sqlmysql} → `FALSE`{.sqlmysql} |
2532 |
2605 |
|
|
2533 |
2606 |
|
|
|
2607 |
|
Solution +.# |
|
2608 |
|
~ |
|
2609 |
|
|
|
2610 |
|
- `TRUE AND TRUE`{.sqlmysql} → `TRUE`{.sqlmysql} |
|
2611 |
|
- `TRUE AND FALSE`{.sqlmysql} → `FALSE`{.sqlmysql} |
|
2612 |
|
- `TRUE AND UNKNOWN`{.sqlmysql} → `UNKNOWN`{.sqlmysql} |
|
2613 |
|
- `FALSE AND FALSE`{.sqlmysql} → `FALSE`{.sqlmysql} |
|
2614 |
|
- `UNKNOWN AND UNKNOWN`{.sqlmysql} → `UNKNOWN`{.sqlmysql} |
|
2615 |
|
- `FALSE AND UNKNOWN`{.sqlmysql} → `FALSE`{.sqlmysql} |
|
2616 |
|
- The other cases can be deduced by symmetry. |
|
2617 |
|
|
|
2618 |
|
For a more compact presentation, refer to (#truth_tables). |
|
2619 |
|
|
2534 |
2620 |
Solution +.# |
Solution +.# |
2535 |
2621 |
|
|
2536 |
2622 |
: `IS NOT`{.sqlmysql} |
: `IS NOT`{.sqlmysql} |
|
... |
... |
Solution +.# |
2563 |
2649 |
|
|
2564 |
2650 |
: `ALTER TABLE BOOK ALTER COLUMN Pages DROP DEFAULT;`{.sqlmysql} |
: `ALTER TABLE BOOK ALTER COLUMN Pages DROP DEFAULT;`{.sqlmysql} |
2565 |
2651 |
|
|
|
2652 |
|
Solution +.# |
|
2653 |
|
|
|
2654 |
|
: Essentially, if there are no primary key in the relation, and if no attribute has the `UNIQUE`{.sqlmysql} constraint. Cf. also [%D %n (%T)](#problem:repetition). |
|
2655 |
|
|
2566 |
2656 |
|
|
2567 |
2657 |
## Problems {-} |
## Problems {-} |
2568 |
2658 |
|
|