Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
8 views
Experiment8 Dbms
Uploaded by
mystifyingdhawan9
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download now
Download
Save Experiment8 dbms For Later
Download
Save
Save Experiment8 dbms For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
8 views
Experiment8 Dbms
Uploaded by
mystifyingdhawan9
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download now
Download
Save Experiment8 dbms For Later
Carousel Previous
Carousel Next
Save
Save Experiment8 dbms For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
Name - Sourabh Suresh Bandgar
Roll no - 10
Title: Views, Constraints and Subqueries
mysql> create database Exp8;
Query OK, 1 row affected (0.01 sec)
mysql> use Exp8;
Database changed
mysql> create table loan(loan_no int primary key,branchname
varchar(50), amount int);
Query OK, 0 rows affected (0.04 sec)
mysql> insert into loan values
-> (363,'Kolhapur',35000),
-> (797,'Sangli',8578),
-> (825,'Latur',7845);
Query OK, 3 rows affected (0.01 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> create table depositor(customerName varchar(50),accountNumber
int);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into depositor values
-> ('Shreyas',12),
-> ('Sourabh',53),
-> ('Sharad',47),
-> ('Uddhav',53),
-> ('Narendra',45),
-> ('Rahul',49),
-> ('Arvind',54);
Query OK, 7 rows affected (0.01 sec)
Records: 7 Duplicates: 0 Warnings: 0
mysql> create table borrower(CustomerName varchar(50),loanNumber
int);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into borrower values
-> ('Omkar',345),
-> ('Ayush',797),
-> ('Avishkar',586),
-> ('Raviraj',825),
-> ('Viraj',363);
Query OK, 5 rows affected (0.01 sec)
Records: 5 Duplicates: 0 Warnings: 0
mysql> create table account(accountNumber int primary Key,branchname
varchar
(50),balance int);
Query OK, 0 rows affected (0.03 sec)
mysql> insert into account values
-> (12,'Kolhapur',5454),
-> (16,'Latur',8792),
-> (32,'Rajarampuri',2525),
-> (45,'Latur',5647),
-> (47,'Latur',3853),
-> (49,'Latur',5315),
-> (53,'Shahupuri',4586),
-> (67,'Ichalkaranji',7474);
Query OK, 8 rows affected (0.04 sec)
Records: 8 Duplicates: 0 Warnings: 0
mysql> select * from account;
+---------------+--------------+---------+
| accountNumber | branchname | balance |
+---------------+--------------+---------+
| 12 | Kolhapur | 5454 |
| 16 | Latur | 8792 |
| 32 | Rajarampuri | 2525 |
| 45 | Latur | 5647 |
| 47 | Latur | 3853 |
| 49 | Latur | 5315 |
| 53 | Shahupuri | 4586 |
| 67 | Ichalkaranji | 7474 |
+---------------+--------------+---------+
8 rows in set (0.01 sec)
mysql> select * from borrower;
+--------------+------------+
| CustomerName | loanNumber |
+--------------+------------+
| Omkar | 345 |
| Ayush | 797 |
| Avishkar | 586 |
| Raviraj | 825 |
| Viraj | 363 |
+--------------+------------+
5 rows in set (0.00 sec)
mysql> select * from depositor;
+--------------+---------------+
| customerName | accountNumber |
+--------------+---------------+
| Shreyas | 12 |
| Sourabh | 53 |
| Sharad | 47 |
| Uddhav | 53 |
| Narendra | 45 |
| Rahul | 49 |
| Arvind | 54 |
+--------------+---------------+
7 rows in set (0.00 sec)
mysql> select * from loan;
+---------+------------+--------+
| loan_no | branchname | amount |
+---------+------------+--------+
| 363 | Kolhapur | 35000 |
| 797 | Sangli | 8578 |
| 825 | Latur | 7845 |
+---------+------------+--------+
3 rows in set (0.00 sec)
1.Create a view ‘all-customers’ consisting of branch names and the
names of customers who have either an account or a loan or both.
mysql> create view all_customers as select
depositor.customerName,account.branchname from depositor natural
join account union select borrower.customername,loan.branchname from
borrower natural join loan;
Query OK, 0 rows affected (0.03 sec)
mysql> select * from all_customers;
+--------------+------------+
| customerName | branchname |
+--------------+------------+
| Shreyas | Kolhapur |
| Sourabh | Shahupuri |
| Sharad | Latur |
| Uddhav | Shahupuri |
| Narendra | Latur |
| Rahul | Latur |
| Omkar | Latur |
| Omkar | Sangli |
| Omkar | Kolhapur |
| Ayush | Latur |
| Ayush | Sangli |
| Ayush | Kolhapur |
| Avishkar | Latur |
| Avishkar | Sangli |
| Avishkar | Kolhapur |
| Raviraj | Latur |
| Raviraj | Sangli |
| Raviraj | Kolhapur |
| Viraj | Latur |
| Viraj | Sangli |
| Viraj | Kolhapur |
+--------------+------------+
21 rows in set (0.01 sec)
2.Using view ‘all-customers’, list in alphabetic order, the
customers of ‘Latur’ branch.
mysql> SELECT customerName
-> FROM all_customers
-> WHERE branchName = 'Latur'
-> ORDER BY customerName;
+--------------+
| customerName |
+--------------+
| Avishkar |
| Ayush |
| Narendra |
| Omkar |
| Rahul |
| Raviraj |
| Sharad |
| Viraj |
+--------------+
8 rows in set (0.01 sec)
3.Create a view consisting of sum of the amounts of all the loans
for each branch.
mysql> CREATE VIEW Total AS
-> SELECT branchName, SUM(amount)
-> FROM Loan
-> GROUP BY branchName;
Query OK, 0 rows affected (0.01 sec)
mysql> select * from Total;
+------------+-------------+
| branchName | SUM(amount) |
+------------+-------------+
| Kolhapur | 35000 |
| Sangli | 8578 |
| Latur | 7845 |
+------------+-------------+
3 rows in set (0.01 sec)
You might also like
This Study Resource Was
PDF
62% (13)
This Study Resource Was
5 pages
USKT Documentation
PDF
No ratings yet
USKT Documentation
22 pages
Queries On BANK Database
PDF
No ratings yet
Queries On BANK Database
8 pages
Oracle Database Security Interview Questions, Answers, and Explanations: Oracle Database Security Certification Review
From Everand
Oracle Database Security Interview Questions, Answers, and Explanations: Oracle Database Security Certification Review
equitypress
No ratings yet
Cambridge Read This Intro Students Book PDF
PDF
100% (5)
Cambridge Read This Intro Students Book PDF
136 pages
Practical No 09
PDF
No ratings yet
Practical No 09
9 pages
R 73
PDF
No ratings yet
R 73
8 pages
10SQL DML
PDF
No ratings yet
10SQL DML
5 pages
Create Database Practical1
PDF
No ratings yet
Create Database Practical1
6 pages
EXP7 Dbms Final
PDF
No ratings yet
EXP7 Dbms Final
5 pages
DBMS Solution
PDF
No ratings yet
DBMS Solution
9 pages
Lab6 To Lab9
PDF
No ratings yet
Lab6 To Lab9
19 pages
Bank Tables
PDF
No ratings yet
Bank Tables
8 pages
2
PDF
No ratings yet
2
14 pages
Database Lab Program
PDF
No ratings yet
Database Lab Program
6 pages
DBML 2
PDF
No ratings yet
DBML 2
9 pages
L04 1a
PDF
No ratings yet
L04 1a
11 pages
2019 Final Experiment Test - Solution
PDF
No ratings yet
2019 Final Experiment Test - Solution
4 pages
LAB4
PDF
No ratings yet
LAB4
10 pages
Cse2074 DBMS Lab Manual
PDF
No ratings yet
Cse2074 DBMS Lab Manual
19 pages
SQL Queries 2
PDF
No ratings yet
SQL Queries 2
8 pages
Create Database Bank': Banking Example (Primary Key Is Underlined)
PDF
No ratings yet
Create Database Bank': Banking Example (Primary Key Is Underlined)
6 pages
Untitled Document
PDF
No ratings yet
Untitled Document
27 pages
DB 1 10
PDF
No ratings yet
DB 1 10
3 pages
DB 1 12
PDF
No ratings yet
DB 1 12
3 pages
Bank Database
PDF
No ratings yet
Bank Database
3 pages
data of sql
PDF
No ratings yet
data of sql
4 pages
DBMS Experiment-6
PDF
No ratings yet
DBMS Experiment-6
8 pages
Venkat DB Bank Project
PDF
No ratings yet
Venkat DB Bank Project
6 pages
SQL Final
PDF
No ratings yet
SQL Final
76 pages
bhikas dbms 3 (1)
PDF
No ratings yet
bhikas dbms 3 (1)
3 pages
Iit2021034 Assignment DBMS
PDF
No ratings yet
Iit2021034 Assignment DBMS
7 pages
Labfile ADBMS
PDF
No ratings yet
Labfile ADBMS
27 pages
Banking System
PDF
No ratings yet
Banking System
6 pages
Prac 1,2,3
PDF
No ratings yet
Prac 1,2,3
19 pages
NITIN Rdbms Assignment
PDF
No ratings yet
NITIN Rdbms Assignment
131 pages
Dbms Lab1
PDF
No ratings yet
Dbms Lab1
9 pages
Assignment 2
PDF
No ratings yet
Assignment 2
8 pages
Library Database
PDF
No ratings yet
Library Database
6 pages
Assignment 2
PDF
No ratings yet
Assignment 2
3 pages
DBMS Lab Record 2017-18 2.0
PDF
No ratings yet
DBMS Lab Record 2017-18 2.0
57 pages
Database Lab 02
PDF
No ratings yet
Database Lab 02
5 pages
DB 1 11
PDF
No ratings yet
DB 1 11
3 pages
Bank Database: Table Queries
PDF
No ratings yet
Bank Database: Table Queries
22 pages
DBMS Practical 1
PDF
No ratings yet
DBMS Practical 1
6 pages
Assignment No 2 Dbmsss
PDF
No ratings yet
Assignment No 2 Dbmsss
6 pages
Ss Dbms
PDF
No ratings yet
Ss Dbms
6 pages
Dbms 1
PDF
No ratings yet
Dbms 1
19 pages
Noteshub (Noteshub - Co.In) : Dbms Lab File 4 Semester
PDF
No ratings yet
Noteshub (Noteshub - Co.In) : Dbms Lab File 4 Semester
41 pages
Week2-Assessment
PDF
No ratings yet
Week2-Assessment
3 pages
Lab Experiment 8 & 9
PDF
No ratings yet
Lab Experiment 8 & 9
5 pages
4.introduction To SQL
PDF
No ratings yet
4.introduction To SQL
53 pages
Assignment 2
PDF
No ratings yet
Assignment 2
8 pages
Program-9: To Create View and Use of Insert, Delete, Select and Update Commands in View Viewing Contents of Employee Table
PDF
No ratings yet
Program-9: To Create View and Use of Insert, Delete, Select and Update Commands in View Viewing Contents of Employee Table
6 pages
ASSIGNMENT -2
PDF
No ratings yet
ASSIGNMENT -2
4 pages
DEMAND
PDF
No ratings yet
DEMAND
9 pages
Bank
PDF
No ratings yet
Bank
14 pages
DBMS Practicals Sem 3 Mca Idol - Shree Ram College
PDF
100% (3)
DBMS Practicals Sem 3 Mca Idol - Shree Ram College
34 pages
92 lab 4
PDF
No ratings yet
92 lab 4
22 pages
Database Lab Questions On Views
PDF
No ratings yet
Database Lab Questions On Views
6 pages
01-BANK-DB
PDF
No ratings yet
01-BANK-DB
2 pages
IBM System 360 RPG Debugging Template and Keypunch Card
From Everand
IBM System 360 RPG Debugging Template and Keypunch Card
Archive Classics
No ratings yet
Microsoft SC-300: Identity and Access Administrator - Certification Exam Prep
From Everand
Microsoft SC-300: Identity and Access Administrator - Certification Exam Prep
Steve Brown
No ratings yet
Orihinal Na Texto
PDF
No ratings yet
Orihinal Na Texto
2 pages
Final CV Resume (1)
PDF
No ratings yet
Final CV Resume (1)
1 page
Computation of General Weighted Average Gwa
PDF
No ratings yet
Computation of General Weighted Average Gwa
4 pages
Complete CG Project PDF
PDF
No ratings yet
Complete CG Project PDF
32 pages
Judges of Israel
PDF
No ratings yet
Judges of Israel
1 page
Netcat Command
PDF
No ratings yet
Netcat Command
17 pages
Orders, Decorations, and Medals of Brunei
PDF
No ratings yet
Orders, Decorations, and Medals of Brunei
7 pages
No. FRU FRU No. Rohs ID CRU ID: Parts List
PDF
No ratings yet
No. FRU FRU No. Rohs ID CRU ID: Parts List
44 pages
Z Test PowerPoint April 25 2023
PDF
No ratings yet
Z Test PowerPoint April 25 2023
22 pages
An Analysis of Main Characters in Novel Twilight by Stephenie Meyer
PDF
0% (1)
An Analysis of Main Characters in Novel Twilight by Stephenie Meyer
6 pages
Simple Sentence
PDF
No ratings yet
Simple Sentence
2 pages
Fats Waller Ain - 'T Misbehaving Sheetmusic Trade Com
PDF
No ratings yet
Fats Waller Ain - 'T Misbehaving Sheetmusic Trade Com
1 page
Mid-Point Integration Rule
PDF
No ratings yet
Mid-Point Integration Rule
2 pages
Social and Moral Values in African Literature: A Study of Ikechukwu Asika'S Tamara
PDF
No ratings yet
Social and Moral Values in African Literature: A Study of Ikechukwu Asika'S Tamara
20 pages
Universidad Cristiana Autónoma de Nicaragua UCAN - Estelí: Classroom Speaking Activities Survey
PDF
No ratings yet
Universidad Cristiana Autónoma de Nicaragua UCAN - Estelí: Classroom Speaking Activities Survey
3 pages
Wajib Ditulis Selepas Setiap Satu Sesi Pengajaran Dan Ditampal Dalam Buku Rekod Mengajar Selepas Slot P&P Berkenaan
PDF
No ratings yet
Wajib Ditulis Selepas Setiap Satu Sesi Pengajaran Dan Ditampal Dalam Buku Rekod Mengajar Selepas Slot P&P Berkenaan
1 page
Bhajans Collection
PDF
100% (1)
Bhajans Collection
784 pages
Hebraic Analysis For Proverbs 8-1-4-22-3 PDF
PDF
No ratings yet
Hebraic Analysis For Proverbs 8-1-4-22-3 PDF
32 pages
LP ENG9 Week 27 The Eye of A Neddle
PDF
100% (1)
LP ENG9 Week 27 The Eye of A Neddle
3 pages
SQL Query Statements
PDF
No ratings yet
SQL Query Statements
20 pages
DOCKER
PDF
No ratings yet
DOCKER
10 pages
Exercises For Task 3 (English Grammar)
PDF
No ratings yet
Exercises For Task 3 (English Grammar)
4 pages
Release Note
PDF
No ratings yet
Release Note
1 page
Maggi2002 The Splendor of The Word's Tree - The Angelic Language of Salvation in Jacopone of Todi
PDF
No ratings yet
Maggi2002 The Splendor of The Word's Tree - The Angelic Language of Salvation in Jacopone of Todi
19 pages
Text in Multimedia
PDF
No ratings yet
Text in Multimedia
4 pages
linguistics project
PDF
No ratings yet
linguistics project
4 pages
Mystics and Saints of Islam
PDF
No ratings yet
Mystics and Saints of Islam
108 pages
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
This Study Resource Was
PDF
This Study Resource Was
USKT Documentation
PDF
USKT Documentation
Queries On BANK Database
PDF
Queries On BANK Database
Oracle Database Security Interview Questions, Answers, and Explanations: Oracle Database Security Certification Review
From Everand
Oracle Database Security Interview Questions, Answers, and Explanations: Oracle Database Security Certification Review
Cambridge Read This Intro Students Book PDF
PDF
Cambridge Read This Intro Students Book PDF
Practical No 09
PDF
Practical No 09
R 73
PDF
R 73
10SQL DML
PDF
10SQL DML
Create Database Practical1
PDF
Create Database Practical1
EXP7 Dbms Final
PDF
EXP7 Dbms Final
DBMS Solution
PDF
DBMS Solution
Lab6 To Lab9
PDF
Lab6 To Lab9
Bank Tables
PDF
Bank Tables
2
PDF
2
Database Lab Program
PDF
Database Lab Program
DBML 2
PDF
DBML 2
L04 1a
PDF
L04 1a
2019 Final Experiment Test - Solution
PDF
2019 Final Experiment Test - Solution
LAB4
PDF
LAB4
Cse2074 DBMS Lab Manual
PDF
Cse2074 DBMS Lab Manual
SQL Queries 2
PDF
SQL Queries 2
Create Database Bank': Banking Example (Primary Key Is Underlined)
PDF
Create Database Bank': Banking Example (Primary Key Is Underlined)
Untitled Document
PDF
Untitled Document
DB 1 10
PDF
DB 1 10
DB 1 12
PDF
DB 1 12
Bank Database
PDF
Bank Database
data of sql
PDF
data of sql
DBMS Experiment-6
PDF
DBMS Experiment-6
Venkat DB Bank Project
PDF
Venkat DB Bank Project
SQL Final
PDF
SQL Final
bhikas dbms 3 (1)
PDF
bhikas dbms 3 (1)
Iit2021034 Assignment DBMS
PDF
Iit2021034 Assignment DBMS
Labfile ADBMS
PDF
Labfile ADBMS
Banking System
PDF
Banking System
Prac 1,2,3
PDF
Prac 1,2,3
NITIN Rdbms Assignment
PDF
NITIN Rdbms Assignment
Dbms Lab1
PDF
Dbms Lab1
Assignment 2
PDF
Assignment 2
Library Database
PDF
Library Database
Assignment 2
PDF
Assignment 2
DBMS Lab Record 2017-18 2.0
PDF
DBMS Lab Record 2017-18 2.0
Database Lab 02
PDF
Database Lab 02
DB 1 11
PDF
DB 1 11
Bank Database: Table Queries
PDF
Bank Database: Table Queries
DBMS Practical 1
PDF
DBMS Practical 1
Assignment No 2 Dbmsss
PDF
Assignment No 2 Dbmsss
Ss Dbms
PDF
Ss Dbms
Dbms 1
PDF
Dbms 1
Noteshub (Noteshub - Co.In) : Dbms Lab File 4 Semester
PDF
Noteshub (Noteshub - Co.In) : Dbms Lab File 4 Semester
Week2-Assessment
PDF
Week2-Assessment
Lab Experiment 8 & 9
PDF
Lab Experiment 8 & 9
4.introduction To SQL
PDF
4.introduction To SQL
Assignment 2
PDF
Assignment 2
Program-9: To Create View and Use of Insert, Delete, Select and Update Commands in View Viewing Contents of Employee Table
PDF
Program-9: To Create View and Use of Insert, Delete, Select and Update Commands in View Viewing Contents of Employee Table
ASSIGNMENT -2
PDF
ASSIGNMENT -2
DEMAND
PDF
DEMAND
Bank
PDF
Bank
DBMS Practicals Sem 3 Mca Idol - Shree Ram College
PDF
DBMS Practicals Sem 3 Mca Idol - Shree Ram College
92 lab 4
PDF
92 lab 4
Database Lab Questions On Views
PDF
Database Lab Questions On Views
01-BANK-DB
PDF
01-BANK-DB
IBM System 360 RPG Debugging Template and Keypunch Card
From Everand
IBM System 360 RPG Debugging Template and Keypunch Card
Microsoft SC-300: Identity and Access Administrator - Certification Exam Prep
From Everand
Microsoft SC-300: Identity and Access Administrator - Certification Exam Prep
Orihinal Na Texto
PDF
Orihinal Na Texto
Final CV Resume (1)
PDF
Final CV Resume (1)
Computation of General Weighted Average Gwa
PDF
Computation of General Weighted Average Gwa
Complete CG Project PDF
PDF
Complete CG Project PDF
Judges of Israel
PDF
Judges of Israel
Netcat Command
PDF
Netcat Command
Orders, Decorations, and Medals of Brunei
PDF
Orders, Decorations, and Medals of Brunei
No. FRU FRU No. Rohs ID CRU ID: Parts List
PDF
No. FRU FRU No. Rohs ID CRU ID: Parts List
Z Test PowerPoint April 25 2023
PDF
Z Test PowerPoint April 25 2023
An Analysis of Main Characters in Novel Twilight by Stephenie Meyer
PDF
An Analysis of Main Characters in Novel Twilight by Stephenie Meyer
Simple Sentence
PDF
Simple Sentence
Fats Waller Ain - 'T Misbehaving Sheetmusic Trade Com
PDF
Fats Waller Ain - 'T Misbehaving Sheetmusic Trade Com
Mid-Point Integration Rule
PDF
Mid-Point Integration Rule
Social and Moral Values in African Literature: A Study of Ikechukwu Asika'S Tamara
PDF
Social and Moral Values in African Literature: A Study of Ikechukwu Asika'S Tamara
Universidad Cristiana Autónoma de Nicaragua UCAN - Estelí: Classroom Speaking Activities Survey
PDF
Universidad Cristiana Autónoma de Nicaragua UCAN - Estelí: Classroom Speaking Activities Survey
Wajib Ditulis Selepas Setiap Satu Sesi Pengajaran Dan Ditampal Dalam Buku Rekod Mengajar Selepas Slot P&P Berkenaan
PDF
Wajib Ditulis Selepas Setiap Satu Sesi Pengajaran Dan Ditampal Dalam Buku Rekod Mengajar Selepas Slot P&P Berkenaan
Bhajans Collection
PDF
Bhajans Collection
Hebraic Analysis For Proverbs 8-1-4-22-3 PDF
PDF
Hebraic Analysis For Proverbs 8-1-4-22-3 PDF
LP ENG9 Week 27 The Eye of A Neddle
PDF
LP ENG9 Week 27 The Eye of A Neddle
SQL Query Statements
PDF
SQL Query Statements
DOCKER
PDF
DOCKER
Exercises For Task 3 (English Grammar)
PDF
Exercises For Task 3 (English Grammar)
Release Note
PDF
Release Note
Maggi2002 The Splendor of The Word's Tree - The Angelic Language of Salvation in Jacopone of Todi
PDF
Maggi2002 The Splendor of The Word's Tree - The Angelic Language of Salvation in Jacopone of Todi
Text in Multimedia
PDF
Text in Multimedia
linguistics project
PDF
linguistics project
Mystics and Saints of Islam
PDF
Mystics and Saints of Islam