Compare commits
No commits in common. "e55e55e1e13244578bf59438d1fde558844fdfd0" and "35995f60e947fa1995760315c39a5f154ce36afb" have entirely different histories.
e55e55e1e1
...
35995f60e9
@ -127,22 +127,20 @@ FROM Borrower JOIN Depositor ON Borrower.cust_name = Depositor.cust_name;
|
||||
SELECT * FROM View3;
|
||||
|
||||
-- Insert operation
|
||||
INSERT INTO Customer (cust_name, cust_street, cust_city) VALUES ("Macho", "Pedgaon", "Ahemadnagar");
|
||||
INSERT INTO Account (acc_no, branch_name, balance) VALUES (2502, "Hadapsar", 3000);
|
||||
INSERT INTO Loan (loan_no, branch_name, amount) VALUES (160, "Hadapsar", 500);
|
||||
INSERT INTO Borrower (cust_name, loan_no) VALUES ("Macho", 160);
|
||||
INSERT INTO Depositor(cust_name, Acc_no) VALUES("Macho", 2502);
|
||||
// NEED TO FIX THIS
|
||||
INSERT INTO Customer (cust_name, cust_street, cust_city) VALUES ("Sandy", "Pedgaon", "Ahemadnagar");
|
||||
INSERT INTO Borrower (cust_name, loan_no) VALUES ("Sandy", 160);
|
||||
INSERT INTO Depositor(cust_name, Acc_no) VALUES("Sandy", 2502);
|
||||
SELECT * FROM View3;
|
||||
|
||||
-- Update operation
|
||||
INSERT INTO Account (acc_no, branch_name, balance) VALUES (2566, 'Hadapsar', 3000);
|
||||
UPDATE Depositor SET acc_no = 2566 WHERE cust_name = 'Macho';
|
||||
UPDATE View3 SET acc_no = 102 WHERE cust_name = 'John_Doe';
|
||||
SELECT * FROM View3;
|
||||
|
||||
-- Delete operation
|
||||
DELETE FROM Borrower WHERE cust_name = 'Macho';
|
||||
DELETE FROM Depositor WHERE cust_name = 'Macho';
|
||||
DELETE FROM View3 WHERE cust_name = 'John_Doe';
|
||||
SELECT * FROM View3;
|
||||
//
|
||||
```
|
||||
|
||||
4. Create Union of left and right joint for all customers who have an account or loan or both at bank
|
||||
@ -240,7 +238,6 @@ SELECT name, cost FROM Companies UNION SELECT domain, quantity FROM Orders;
|
||||
5. Create View View1 by selecting both tables to show company name and quantities.
|
||||
```sql
|
||||
CREATE VIEW view1 AS SELECT name, quantity FROM Companies JOIN Orders ON Companies.comp_id = Orders.comp_id;
|
||||
SELECT * FROM view1;
|
||||
|
||||
```
|
||||
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user