SlideShare a Scribd company logo
1 of 3
DDL
1. Create the Customer table with the following
CustomerId Number(5) Primary Key
Cust_Name varchar2(20) Not null
Address1 Varchar2(30)
Address2 Varchar2(30)
Modify the Customer table Cust_Name column ofdatatype with Varchar2(30)
2. a) Add the following Columns to the Customer table.
Gender Varchar2(1)
Age Number(3)
PhoneNo Number(10)
Email varchar2(30)
3. Drop the E_mail column from Customer table.
4. Create the AccountsMaster table with the following Columns.Use sequence to generate Account
number
AccountNumber Number(10,2) Primarykey(Name ofconstraintis Acc_PK)
Customerld Number(5) reference customer table
AccountType Char(3)
LedgerBalance Number(10,2) NotNull
5. Modify the AccountMaster table with the Check constraintto ens ure AccountType should be either NRI
or IND.
6. Modify the AccountsMaster table keeping a Check constraintwith the name Balance_Check for the
Minimum Balance which should be greater than 5000.
7. Create a sequence seq_Customer which startwith 1000
DML
1. Insert the below records in the customer table using the seq_customer:
CustomerId Cust_Name Address1 Address2 Gender Age Phoneno
1000 Smith 46,Lane 1 New York M 35 7890893433
1001 Jack 89,Lane 9 Washington M 39 6690233433
1002 Mary 78,Lane 5 Chicago F 32 8990893433
1003 James 46,Lane 8 New York M 42 6690893123
2. Insert the below records in the AccountMaster table:
3. Update the ledgerbalance of accountnumber 2004 to 8000.
4. Modify the accounttype of 2004 accountnumber to IND.
5. Delete the record of 2004 accountnumber.
Select Query
1. Display all Account details from accountmaster table.
2. Display account details of accounts having ledgerbalance more than 5000.
3. Display all “NRI” account details.
4. Display customernames from “New York” city.
AccountNumber Customerld AccountType LedgerBalance
2001 1003 NRI 5000
2002 1001 IND 7000
2003 1000 IND 9000
2004 1002 NRI 4000
Joins and Subquery
1. Display the Customer names and ledgebalance of all “IND” accounts.
2. Display the ledgrBalance of male customer.
3. Display the account details of customers less than 40 age.

More Related Content

What's hot

Fch5 create manual checks
Fch5 create manual checksFch5 create manual checks
Fch5 create manual checksFarooq Wangde
 
Fb03 gl document display
Fb03   gl document displayFb03   gl document display
Fb03 gl document displayFarooq Wangde
 
A2 Jan 08 (nov)
A2 Jan 08 (nov)A2 Jan 08 (nov)
A2 Jan 08 (nov)c.west
 
12th information practices mysql practice questions
12th information practices mysql practice questions12th information practices mysql practice questions
12th information practices mysql practice questionsHarish Gyanani
 
S alr 87012289 compact document journal
S alr 87012289 compact document journalS alr 87012289 compact document journal
S alr 87012289 compact document journalVaishali Ketkar
 

What's hot (6)

FINAL-Review
FINAL-ReviewFINAL-Review
FINAL-Review
 
Fch5 create manual checks
Fch5 create manual checksFch5 create manual checks
Fch5 create manual checks
 
Fb03 gl document display
Fb03   gl document displayFb03   gl document display
Fb03 gl document display
 
A2 Jan 08 (nov)
A2 Jan 08 (nov)A2 Jan 08 (nov)
A2 Jan 08 (nov)
 
12th information practices mysql practice questions
12th information practices mysql practice questions12th information practices mysql practice questions
12th information practices mysql practice questions
 
S alr 87012289 compact document journal
S alr 87012289 compact document journalS alr 87012289 compact document journal
S alr 87012289 compact document journal
 

Similar to DDL DML SQL

SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3Mohd Tousif
 
SQL practice questions set
SQL practice questions setSQL practice questions set
SQL practice questions setMohd Tousif
 
Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Mohd Tousif
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set Mohd Tousif
 
DML Statements.pptx
DML Statements.pptxDML Statements.pptx
DML Statements.pptxUnitedGamer1
 
A_CH05_EXPV2_A1_Instructions.docxOffice 2013 – myitlabgrader .docx
A_CH05_EXPV2_A1_Instructions.docxOffice 2013 – myitlabgrader .docxA_CH05_EXPV2_A1_Instructions.docxOffice 2013 – myitlabgrader .docx
A_CH05_EXPV2_A1_Instructions.docxOffice 2013 – myitlabgrader .docxikirkton
 

Similar to DDL DML SQL (8)

SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3
 
SQL practice questions set
SQL practice questions setSQL practice questions set
SQL practice questions set
 
Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1Introduction to Databases - Assignment_1
Introduction to Databases - Assignment_1
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set
 
Mis
MisMis
Mis
 
DML Statements.pptx
DML Statements.pptxDML Statements.pptx
DML Statements.pptx
 
Sql commands
Sql commandsSql commands
Sql commands
 
A_CH05_EXPV2_A1_Instructions.docxOffice 2013 – myitlabgrader .docx
A_CH05_EXPV2_A1_Instructions.docxOffice 2013 – myitlabgrader .docxA_CH05_EXPV2_A1_Instructions.docxOffice 2013 – myitlabgrader .docx
A_CH05_EXPV2_A1_Instructions.docxOffice 2013 – myitlabgrader .docx
 

More from Akash gupta

Resume arti soni
Resume arti soniResume arti soni
Resume arti soniAkash gupta
 
Answers to-500-istqb-sample-papers-2010-2011
Answers to-500-istqb-sample-papers-2010-2011Answers to-500-istqb-sample-papers-2010-2011
Answers to-500-istqb-sample-papers-2010-2011Akash gupta
 
500 istqb-sample-papers-2010-2011
500 istqb-sample-papers-2010-2011500 istqb-sample-papers-2010-2011
500 istqb-sample-papers-2010-2011Akash gupta
 
Istqb fl chap_6_edited
Istqb fl chap_6_editedIstqb fl chap_6_edited
Istqb fl chap_6_editedAkash gupta
 
Istqb fl chap_5_edited
Istqb fl chap_5_editedIstqb fl chap_5_edited
Istqb fl chap_5_editedAkash gupta
 
Istqb fl chap_4_edited
Istqb fl chap_4_editedIstqb fl chap_4_edited
Istqb fl chap_4_editedAkash gupta
 
Istqb fl chap_3_edited
Istqb fl chap_3_editedIstqb fl chap_3_edited
Istqb fl chap_3_editedAkash gupta
 
Istqb fl chap_1_edited
Istqb fl chap_1_editedIstqb fl chap_1_edited
Istqb fl chap_1_editedAkash gupta
 
Istqb fl chap_2_edited
Istqb fl chap_2_editedIstqb fl chap_2_edited
Istqb fl chap_2_editedAkash gupta
 
Capgemini resume template
Capgemini resume templateCapgemini resume template
Capgemini resume templateAkash gupta
 
Book integrated assignment
Book integrated assignmentBook integrated assignment
Book integrated assignmentAkash gupta
 
Book integrated assignment
Book integrated assignmentBook integrated assignment
Book integrated assignmentAkash gupta
 

More from Akash gupta (20)

Resume arti soni
Resume arti soniResume arti soni
Resume arti soni
 
Resume
Resume Resume
Resume
 
Chap3
Chap3Chap3
Chap3
 
Chap2
Chap2Chap2
Chap2
 
Chap1
Chap1Chap1
Chap1
 
Answers to-500-istqb-sample-papers-2010-2011
Answers to-500-istqb-sample-papers-2010-2011Answers to-500-istqb-sample-papers-2010-2011
Answers to-500-istqb-sample-papers-2010-2011
 
500 istqb-sample-papers-2010-2011
500 istqb-sample-papers-2010-2011500 istqb-sample-papers-2010-2011
500 istqb-sample-papers-2010-2011
 
Istqb fl chap_6_edited
Istqb fl chap_6_editedIstqb fl chap_6_edited
Istqb fl chap_6_edited
 
Istqb fl chap_5_edited
Istqb fl chap_5_editedIstqb fl chap_5_edited
Istqb fl chap_5_edited
 
Istqb fl chap_4_edited
Istqb fl chap_4_editedIstqb fl chap_4_edited
Istqb fl chap_4_edited
 
Istqb fl chap_3_edited
Istqb fl chap_3_editedIstqb fl chap_3_edited
Istqb fl chap_3_edited
 
Istqb fl chap_1_edited
Istqb fl chap_1_editedIstqb fl chap_1_edited
Istqb fl chap_1_edited
 
Istqb fl chap_2_edited
Istqb fl chap_2_editedIstqb fl chap_2_edited
Istqb fl chap_2_edited
 
Chap6
Chap6Chap6
Chap6
 
Chap5
Chap5Chap5
Chap5
 
Chap4
Chap4Chap4
Chap4
 
Capgemini resume template
Capgemini resume templateCapgemini resume template
Capgemini resume template
 
Book integrated assignment
Book integrated assignmentBook integrated assignment
Book integrated assignment
 
Book integrated assignment
Book integrated assignmentBook integrated assignment
Book integrated assignment
 
Casestudy
CasestudyCasestudy
Casestudy
 

Recently uploaded

Instant Issue Debit Cards - School Designs
Instant Issue Debit Cards - School DesignsInstant Issue Debit Cards - School Designs
Instant Issue Debit Cards - School Designsegoetzinger
 
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...makika9823
 
Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfMichael Silva
 
New dynamic economic model with a digital footprint | European Business Review
New dynamic economic model with a digital footprint | European Business ReviewNew dynamic economic model with a digital footprint | European Business Review
New dynamic economic model with a digital footprint | European Business ReviewAntonis Zairis
 
Call US 📞 9892124323 ✅ Kurla Call Girls In Kurla ( Mumbai ) secure service
Call US 📞 9892124323 ✅ Kurla Call Girls In Kurla ( Mumbai ) secure serviceCall US 📞 9892124323 ✅ Kurla Call Girls In Kurla ( Mumbai ) secure service
Call US 📞 9892124323 ✅ Kurla Call Girls In Kurla ( Mumbai ) secure servicePooja Nehwal
 
How Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingHow Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingAggregage
 
VIP Call Girls in Saharanpur Aarohi 8250192130 Independent Escort Service Sah...
VIP Call Girls in Saharanpur Aarohi 8250192130 Independent Escort Service Sah...VIP Call Girls in Saharanpur Aarohi 8250192130 Independent Escort Service Sah...
VIP Call Girls in Saharanpur Aarohi 8250192130 Independent Escort Service Sah...Suhani Kapoor
 
Quantitative Analysis of Retail Sector Companies
Quantitative Analysis of Retail Sector CompaniesQuantitative Analysis of Retail Sector Companies
Quantitative Analysis of Retail Sector Companiesprashantbhati354
 
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...Suhani Kapoor
 
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Sapana Sha
 
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130Suhani Kapoor
 
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyInterimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyTyöeläkeyhtiö Elo
 
Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Commonwealth
 
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service AizawlVip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawlmakika9823
 
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...shivangimorya083
 
The Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfThe Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfGale Pooley
 
VIP Call Girls Thane Sia 8617697112 Independent Escort Service Thane
VIP Call Girls Thane Sia 8617697112 Independent Escort Service ThaneVIP Call Girls Thane Sia 8617697112 Independent Escort Service Thane
VIP Call Girls Thane Sia 8617697112 Independent Escort Service ThaneCall girls in Ahmedabad High profile
 

Recently uploaded (20)

Instant Issue Debit Cards - School Designs
Instant Issue Debit Cards - School DesignsInstant Issue Debit Cards - School Designs
Instant Issue Debit Cards - School Designs
 
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
Independent Lucknow Call Girls 8923113531WhatsApp Lucknow Call Girls make you...
 
Monthly Economic Monitoring of Ukraine No 231, April 2024
Monthly Economic Monitoring of Ukraine No 231, April 2024Monthly Economic Monitoring of Ukraine No 231, April 2024
Monthly Economic Monitoring of Ukraine No 231, April 2024
 
Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdf
 
New dynamic economic model with a digital footprint | European Business Review
New dynamic economic model with a digital footprint | European Business ReviewNew dynamic economic model with a digital footprint | European Business Review
New dynamic economic model with a digital footprint | European Business Review
 
Call US 📞 9892124323 ✅ Kurla Call Girls In Kurla ( Mumbai ) secure service
Call US 📞 9892124323 ✅ Kurla Call Girls In Kurla ( Mumbai ) secure serviceCall US 📞 9892124323 ✅ Kurla Call Girls In Kurla ( Mumbai ) secure service
Call US 📞 9892124323 ✅ Kurla Call Girls In Kurla ( Mumbai ) secure service
 
How Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of ReportingHow Automation is Driving Efficiency Through the Last Mile of Reporting
How Automation is Driving Efficiency Through the Last Mile of Reporting
 
VIP Call Girls in Saharanpur Aarohi 8250192130 Independent Escort Service Sah...
VIP Call Girls in Saharanpur Aarohi 8250192130 Independent Escort Service Sah...VIP Call Girls in Saharanpur Aarohi 8250192130 Independent Escort Service Sah...
VIP Call Girls in Saharanpur Aarohi 8250192130 Independent Escort Service Sah...
 
Quantitative Analysis of Retail Sector Companies
Quantitative Analysis of Retail Sector CompaniesQuantitative Analysis of Retail Sector Companies
Quantitative Analysis of Retail Sector Companies
 
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
 
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111Call Girls In Yusuf Sarai Women Seeking Men 9654467111
Call Girls In Yusuf Sarai Women Seeking Men 9654467111
 
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
 
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance CompanyInterimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
Interimreport1 January–31 March2024 Elo Mutual Pension Insurance Company
 
Commercial Bank Economic Capsule - April 2024
Commercial Bank Economic Capsule - April 2024Commercial Bank Economic Capsule - April 2024
Commercial Bank Economic Capsule - April 2024
 
Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]
 
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service AizawlVip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
 
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
 
The Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdfThe Economic History of the U.S. Lecture 17.pdf
The Economic History of the U.S. Lecture 17.pdf
 
VIP Call Girls Thane Sia 8617697112 Independent Escort Service Thane
VIP Call Girls Thane Sia 8617697112 Independent Escort Service ThaneVIP Call Girls Thane Sia 8617697112 Independent Escort Service Thane
VIP Call Girls Thane Sia 8617697112 Independent Escort Service Thane
 

DDL DML SQL

  • 1. DDL 1. Create the Customer table with the following CustomerId Number(5) Primary Key Cust_Name varchar2(20) Not null Address1 Varchar2(30) Address2 Varchar2(30) Modify the Customer table Cust_Name column ofdatatype with Varchar2(30) 2. a) Add the following Columns to the Customer table. Gender Varchar2(1) Age Number(3) PhoneNo Number(10) Email varchar2(30) 3. Drop the E_mail column from Customer table. 4. Create the AccountsMaster table with the following Columns.Use sequence to generate Account number AccountNumber Number(10,2) Primarykey(Name ofconstraintis Acc_PK) Customerld Number(5) reference customer table AccountType Char(3) LedgerBalance Number(10,2) NotNull 5. Modify the AccountMaster table with the Check constraintto ens ure AccountType should be either NRI or IND. 6. Modify the AccountsMaster table keeping a Check constraintwith the name Balance_Check for the Minimum Balance which should be greater than 5000. 7. Create a sequence seq_Customer which startwith 1000
  • 2. DML 1. Insert the below records in the customer table using the seq_customer: CustomerId Cust_Name Address1 Address2 Gender Age Phoneno 1000 Smith 46,Lane 1 New York M 35 7890893433 1001 Jack 89,Lane 9 Washington M 39 6690233433 1002 Mary 78,Lane 5 Chicago F 32 8990893433 1003 James 46,Lane 8 New York M 42 6690893123 2. Insert the below records in the AccountMaster table: 3. Update the ledgerbalance of accountnumber 2004 to 8000. 4. Modify the accounttype of 2004 accountnumber to IND. 5. Delete the record of 2004 accountnumber. Select Query 1. Display all Account details from accountmaster table. 2. Display account details of accounts having ledgerbalance more than 5000. 3. Display all “NRI” account details. 4. Display customernames from “New York” city. AccountNumber Customerld AccountType LedgerBalance 2001 1003 NRI 5000 2002 1001 IND 7000 2003 1000 IND 9000 2004 1002 NRI 4000
  • 3. Joins and Subquery 1. Display the Customer names and ledgebalance of all “IND” accounts. 2. Display the ledgrBalance of male customer. 3. Display the account details of customers less than 40 age.