Answered step by step
Verified Expert Solution
Question
1 Approved Answer
solve dor me what you can solve using oracle Consider the following scheme of the database that describes the transactions of bank client accounts Clients
solve dor me what you can solve using oracle
Consider the following scheme of the database that describes the transactions of bank client accounts Clients IdCLName, FName Address, Tel) Accounts (Account Balance, IC, Interest, Type C) Transactions NTransaction, Nacement, Amount, TypeT, DateT) Note that the primary keys are underlined and foreign keys are in italics followed by the symbol Table Primary key Foreign Key Clients IdC None Accounts NAccount Id refers to Clients are Transactions NTansaction NAccount refers to Accounts table Suppose we have the following information in the three tables: Table: Clients Idc LNAME Name Address Tel 100 Chehaden Alas Saida 08-777777 101 Brown Nathalle Beyrouth 01-111111 102 Ghazal Ty 07-350350 103 Abi Raad Georges Zahle 05-555555 Table: Accounts NAccount Balance Idc. Interest Typec 1234 1000.50 100 0.03 Cheeking 1235 780.15 101 0.05 Term 1236 2340.00 102 0.01 Checking 1237 329.00 100 0.04 Saving 1238 2230.19 100 0.05 Term 1239 4967.40 103 0.04 Saving 1240 12345.60 100 0.05 Term Table: Transactions Ntransaction NAccount Amount TypeT DateT 1234 100.00 w 2017-01-12 2 1234 250.00 D 2017-01-16 3 2237 120.30 2017-01-16 1239 123.18 2017-01-16 5 1234 240.30 2017-01-19 6 1235 987.56 2017-01-20 7 1236 120.00 w 2017-01-20 Exercisel: SQL : Data Definition and Update (10 points) Qi). Write the SOL statements to create the three tables Clients, Accounts and Transactions of the database with the following constraints: Primary keys are underlined and foreign keys are followed by a 2. All the attributes of Clients table must be known 3. Two clients should not have the same number of telephone 1 W K 4 D 4. The balance of the accounts must be positives. The interest default value is The property (TypeC) provides information about the account type (checking, saving. term). 1. The possible values of type T (transactions table) are: W and D. The default value of the transaction date is the current date. QI). Add the Telephone attribute of type integer to the Accounts table. Q2). A telephone number can have a character (eg, 01-111111), give the SQL code that changes the data type of Telephone attribute to accept characters. 23). Finally, the telephone number is not necessary, give the SQL code that will remove the attribute Telephone Q:4). Add the new client John Smith identified by 104. living in "zahle" and having 08-123456 as phone number. Q5). Modify the balance of the client identified by number 102, to be 3000. Q 6). Remove the accounts of the client identified by 100. Remove from the database the Clients table. Exercise 2: SQL Queries (10 points) QI). Display the number of transactions performed on each account. Q2). Display the Fname and Lname of clients living in zahle and having accounts with a balance greater than 1000. 3). Display the "checking accounts with balance greater than 1000. Q4). Find the clients whose last name begin with Al Q5). Display the accounts having the same balance as one of the accounts number 1234 or 1237 QC). List the clients having a telephone number. Q). Sort by increasing order the clients according to their number of accounts (naccount). Q9). List the accounts having a balance greater than the average balance of all accounts. @9). Q10). For each account's type (typeC), find the minimum and maximum interest. Find the Fname and Lname of clients performed the transaction number 2. List the clients having more than 3 accounts. Q11) Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started