lint all files
This commit is contained in:
@@ -75,7 +75,7 @@ WHERE security-level = "normal"
|
||||
ORDER BY age DESC;
|
||||
```
|
||||
|
||||
2. List the name of each bank which has a branch whose address starts with the word Eccles. The list should not include any duplicates.
|
||||
1. List the name of each bank which has a branch whose address starts with the word Eccles. The list should not include any duplicates.
|
||||
|
||||
```sql
|
||||
SELECT DISTINCT name
|
||||
@@ -84,7 +84,7 @@ WHERE Bank.bankID = Branch.bankID
|
||||
AND address LIKE "Eccles*";
|
||||
```
|
||||
|
||||
3. Calculate the average age of the ATMs with low or normal levels of security. Name the results column “Average age”.
|
||||
1. Calculate the average age of the ATMs with low or normal levels of security. Name the results column “Average age”.
|
||||
|
||||
```sql
|
||||
SELECT AVG(age) AS "Average Age"
|
||||
@@ -92,37 +92,38 @@ FROM atm
|
||||
WHERE security-level = "low" OR security-level = "normal";
|
||||
```
|
||||
|
||||
4. Remove the tuple from the relation ATM whose identifier is atm04.
|
||||
1. Remove the tuple from the relation ATM whose identifier is atm04.
|
||||
|
||||
```sql
|
||||
DELETE FROM atm
|
||||
WHERE atmID = "atm04";
|
||||
```
|
||||
|
||||
5. Add a row for an ATM, whose atmID is atm05, whose security level is high and which is located at branch T1.
|
||||
1. Add a row for an ATM, whose atmID is atm05, whose security level is high and which is located at branch T1.
|
||||
|
||||
```sql
|
||||
INSERT INTO atm
|
||||
VALUES ("atm05", "high", "0", "T1");
|
||||
```
|
||||
|
||||
6. Add an attribute called telephone number to the relation Branch.
|
||||
1. Add an attribute called telephone number to the relation Branch.
|
||||
|
||||
```sql
|
||||
ALTER TABLE branch
|
||||
ADD telephone CHAR(15)
|
||||
```
|
||||
|
||||
7. Set the address of every branch to the value Salford.
|
||||
1. Set the address of every branch to the value Salford.
|
||||
|
||||
```sql
|
||||
UPDATE branch
|
||||
SET address = "Salford";
|
||||
```
|
||||
|
||||
1) Bank LEFT OUTER JOIN Branch
|
||||
1. Bank LEFT OUTER JOIN Branch
|
||||
|
||||
```sql
|
||||
SELECT *
|
||||
FROM bank
|
||||
INNER JOIN
|
||||
```
|
||||
```
|
||||
|
Reference in New Issue
Block a user