wordpower only ..dont bid
Question 3: SQL (35 marks)
The “Big Bank” banking organisation has a database as described below:
Customer(ID, firstName, lastName, address, email, phone, dateOfBirth) Account(accNumber, balance, type)
Branch(BSB, phone, streetAddress, town)
Employee(employeeID, firstName, lastName, address, phone, TFN, dateOfBirth) has(ID*, accNumber*)
registered(accNumber*, BSB*) worksAt(employeeID*, BSB*, occupation)
- Primary keys are underlined and foreign keys are denoted with asterisks (*).
- A customer can have more than one account and an account can be jointly owned by more than one customer.
- An employee can only work at one branch.
- All accounts must be registered with one branch.
For clarification of any other attributes please post a question on the discussion forum.
To access the “Big Bank” database, you must first run the script “bigBank.sql” on SQL Developer inside your account. This script can be found on Canvas under Modules->Databases.
Write one SQL query for each question below to extract information from the database.
Each question is worth 5 marks. Do not supply the output of the query. Only the SQL query is required for each question.
Hardcoding of identifiers not given in the question is not permitted and will incur a penalty for the question. Only use the information provided in each question.
- How many accounts are of type ‘cheque’? (Hint: The result of your query should produce a number, not a list of records)
List all employees currently working as a ‘teller’ that have a lowercase ‘v’ or uppercase ‘V’ somewhere in their first or last name. Display the first and last names only.
Provide a list of customers who are aged over 65 and whose balance on any single account exceeds 5000 dollars. The list must appear in alphabetical order of last name then first name. If a customer has more than one account with over $5000 only include their name once in this list. Display the first and last names only.
List the account numbers of accounts registered with the branch identified by the BSB number 713694 in Mooroolbark.
Which branch holds the most money? (Hint: The result of your query should produce details of one branch only, not a list of branches) Display all details of this branch.
Do not use the SQL keyword ‘ROWNUM’ or ‘LIMIT’ to artificially find the bank with the most money. This will give you one result, but it is possible that more than one bank could have an equal amount of funds stored in it.
Which branch employs ‘Tristan Edwards’? (do not hardcode his employee ID into your query). Display the BSB and town of this branch.
Make sure your query performs one test that checks for upper and lower case versions of the employee’s name.
e.g. ‘TRISTAN EDWARDS’, ‘Tristan Edwards’, ‘tristan edwards’ or even ‘TrIsTaN eDwArDs’.
List any employee that has not been designated an occupation as yet. Display the first and last names only.
Question 3: SQL (35 marks)
The “Big Bank” banking organisation has a database as described below:
Customer(ID, firstName, lastName, address, email, phone, dateOfBirth) Account(accNumber, balance, type)
Branch(BSB, phone, streetAddress, town)
Employee(employeeID, firstName, lastName, address, phone, TFN, dateOfBirth) has(ID*, accNumber*)
registered(accNumber*, BSB*) worksAt(employeeID*, BSB*, occupation)
- Primary keys are underlined and foreign keys are denoted with asterisks (*).
- A customer can have more than one account and an account can be jointly owned by more than one customer.
- An employee can only work at one branch.
- All accounts must be registered with one branch.
For clarification of any other attributes please post a question on the discussion forum.
To access the “Big Bank” database, you must first run the script “bigBank.sql” on SQL Developer inside your account. This script can be found on Canvas under Modules->Databases.
Write one SQL query for each question below to extract information from the database.
Each question is worth 5 marks. Do not supply the output of the query. Only the SQL query is required for each question.
Hardcoding of identifiers not given in the question is not permitted and will incur a penalty for the question. Only use the information provided in each question.
- How many accounts are of type ‘cheque’? (Hint: The result of your query should produce a number, not a list of records)
List all employees currently working as a ‘teller’ that have a lowercase ‘v’ or uppercase ‘V’ somewhere in their first or last name. Display the first and last names only.
Provide a list of customers who are aged over 65 and whose balance on any single account exceeds 5000 dollars. The list must appear in alphabetical order of last name then first name. If a customer has more than one account with over $5000 only include their name once in this list. Display the first and last names only.
List the account numbers of accounts registered with the branch identified by the BSB number 713694 in Mooroolbark.
Which branch holds the most money? (Hint: The result of your query should produce details of one branch only, not a list of branches) Display all details of this branch.
Do not use the SQL keyword ‘ROWNUM’ or ‘LIMIT’ to artificially find the bank with the most money. This will give you one result, but it is possible that more than one bank could have an equal amount of funds stored in it.
Which branch employs ‘Tristan Edwards’? (do not hardcode his employee ID into your query). Display the BSB and town of this branch.
Make sure your query performs one test that checks for upper and lower case versions of the employee’s name.
e.g. ‘TRISTAN EDWARDS’, ‘Tristan Edwards’, ‘tristan edwards’ or even ‘TrIsTaN eDwArDs’.
List any employee that has not been designated an occupation as yet. Display the first and last names only.
Question 3: SQL (35 marks)
The “Big Bank” banking organisation has a database as described below:
Customer(ID, firstName, lastName, address, email, phone, dateOfBirth) Account(accNumber, balance, type)
Branch(BSB, phone, streetAddress, town)
Employee(employeeID, firstName, lastName, address, phone, TFN, dateOfBirth) has(ID*, accNumber*)
registered(accNumber*, BSB*) worksAt(employeeID*, BSB*, occupation)
- Primary keys are underlined and foreign keys are denoted with asterisks (*).
- A customer can have more than one account and an account can be jointly owned by more than one customer.
- An employee can only work at one branch.
- All accounts must be registered with one branch.
For clarification of any other attributes please post a question on the discussion forum.
To access the “Big Bank” database, you must first run the script “bigBank.sql” on SQL Developer inside your account. This script can be found on Canvas under Modules->Databases.
Write one SQL query for each question below to extract information from the database.
Each question is worth 5 marks. Do not supply the output of the query. Only the SQL query is required for each question.
Hardcoding of identifiers not given in the question is not permitted and will incur a penalty for the question. Only use the information provided in each question.
- How many accounts are of type ‘cheque’? (Hint: The result of your query should produce a number, not a list of records)
List all employees currently working as a ‘teller’ that have a lowercase ‘v’ or uppercase ‘V’ somewhere in their first or last name. Display the first and last names only.
Provide a list of customers who are aged over 65 and whose balance on any single account exceeds 5000 dollars. The list must appear in alphabetical order of last name then first name. If a customer has more than one account with over $5000 only include their name once in this list. Display the first and last names only.
List the account numbers of accounts registered with the branch identified by the BSB number 713694 in Mooroolbark.
Which branch holds the most money? (Hint: The result of your query should produce details of one branch only, not a list of branches) Display all details of this branch.
Do not use the SQL keyword ‘ROWNUM’ or ‘LIMIT’ to artificially find the bank with the most money. This will give you one result, but it is possible that more than one bank could have an equal amount of funds stored in it.
Which branch employs ‘Tristan Edwards’? (do not hardcode his employee ID into your query). Display the BSB and town of this branch.
Make sure your query performs one test that checks for upper and lower case versions of the employee’s name.
e.g. ‘TRISTAN EDWARDS’, ‘Tristan Edwards’, ‘tristan edwards’ or even ‘TrIsTaN eDwArDs’.
List any employee that has not been designated an occupation as yet. Display the first and last names only.