Question

STORE (StoreID, StoreAddress, WeekDaysHours, WeekendHours) ACCOUNT (AccountNo., AccountName, Balance) DEPARTMENT (DepartmentID, DepartmentTitle, NoOfEmployees, AccountNo, StoreID, FranchiseTeamID)...

STORE (StoreID, StoreAddress, WeekDaysHours, WeekendHours)

ACCOUNT (AccountNo., AccountName, Balance)

DEPARTMENT (DepartmentID, DepartmentTitle, NoOfEmployees, AccountNo, StoreID, FranchiseTeamID)

FRANCHISE_APP (AppNumber, AppDate, DecisionDate, Status, DepartmentID, TeamID)

EMPLOYEE (EmployeeID, Name, Phone, Email, Address, Gender, DOB, JoiningDate, CentralOrLocalEmployment,

EFTPOSID, CANumber, DepartmentID) CASUAL_EMPLOYEE (EmployeeID, HourlyRate)

PART_TIME_EMPLOYEE (EmployeeID, WeeklyHours, Salary)

FULL_TIME_EMPLOYEE (EmployeeID, LeaveDays, Salary, MemberID)

TEAM_MEMBER (MemberID)

SHAREHOLDER (S.H.ID, Name, Phone, Email, Address, NoOfShares, MemberID)

TEAM (TeamID, TeamName, TeamLeaderID)

MEMBERSHIP (MemberID, TeamID, PercentageOfShare)


Question: (SQL Using ORACLE SQL*Plus)
1. List the team member details (member id and team id) who has the maximum credit to his name, based on his percentage of share in the team and the positive account balance of the franchising department.

Homework Answers

Answer #1

In SQL we use various commands to extract data from tables in efficient way. To find the maximum value of any particular I'd we use max command.

For example to find the average and salary for particular departments we use

BREAK ON DEPARTMENT_NAME SKIP 1
COMPUTE AVG LABEL 'Dept Average' -
        MAX LABEL 'Dept Maximum' -
        OF SALARY ON DEPARTMENT_NAME
SELECT DEPARTMENT_NAME, LAST_NAME, SALARY
FROM EMP_DETAILS_VIEW
WHERE DEPARTMENT_NAME IN ('Executive', 'Accounting')
ORDER BY DEPARTMENT_NAME;

Thus by using this command we can get the details

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Consider the scenario where the company has to automate its systems and wants to store details...
Consider the scenario where the company has to automate its systems and wants to store details of its employees where their empno, name, salary, DoB, age, gender and panNo . empno is the primary key, phNo has to be stored. Age is a derived attribute . panNo is a simple attribute Each employee belongs to one the various departments (dno, dname) in the organization. It is mandatory for each employee to get the medical insurance. The insurance details are also...
Draw the scenario using Chen notation In a university, department offer courses. Department has instructors who...
Draw the scenario using Chen notation In a university, department offer courses. Department has instructors who teach courses. For a course, the instructor may or may not have a teaching assistant. Each department has a department name, a department code, 1-4 phone numbers, and an address. ◦ Each course has a course number (e.g., INFO605), a section number (e.g., 900), a title, a course type (e.g., online), and units. Each instructor has an instructor ID, first name, last name, gender,...
The queries listed below must be implemented with a set algebra operation. 1)Find the department name...
The queries listed below must be implemented with a set algebra operation. 1)Find the department name and code for all departments that only offered subjects that worth 6 credits. Note that a subject offered by a department means a lecturer of the department has been assigned to teach the subject. CREATE TABLE LPOSITION(    position       VARCHAR(20)   NOT NULL,   /* Position occupied       */    salary_level   CHAR   NOT NULL,       /* Salary level   */    CONSTRAINT LPosition_PKey PRIMARY KEY (position)...
1) Add to a relational table DEPARTMENT information about the total number of employees in each...
1) Add to a relational table DEPARTMENT information about the total number of employees in each department. Note, that if a department has not employee then for such a department the total number of employees must be set to zero (0). The total number of employees must be a positive number no more than 999. Use SELECT statement to list the contents of an extended relational table DEPARTMENT in the descending order of the total number of employees. Finally, remove...
a. Define the class bankAccount to store a bank customer’s account number and balance. Suppose that...
a. Define the class bankAccount to store a bank customer’s account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide the following operations: set the account number, retrieve the account number, retrieve the balance, deposit and withdraw money, and print account information. Add appropriate constructors. b. Every bank offers a checking account. Derive the class checkingAccount from the class bankAccount (designed in part (a)). This class...
A university is a very busy place with a lot of students and also a lot...
A university is a very busy place with a lot of students and also a lot of employees to keep the system running perfectly. All people in the university have basic information like name, address, email and phone number. Employees at the university have extra information like employee-id and salary. There are also faculty and staff who are employees at the university. Each faculty has a designation and is assigned to a specific college and has number of courses taught....
**[70 pts]** You will be writing a (rather primitive) online store simulator. It will have these...
**[70 pts]** You will be writing a (rather primitive) online store simulator. It will have these classes: Product, Customer, and Store. All data members of each class should be marked as **private** (a leading underscore in the name). Since they're private, if you need to access them from outside the class, you should do so via get or set methods. Any get or set methods should be named per the usual convention ("get_" or "set_" followed by the name of...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). A research field...
You have to create a Library Borrowing System based on the following requirements: When new books...
You have to create a Library Borrowing System based on the following requirements: When new books arrive, these books must be cataloged into the system by a librarian (i.e., entered in the system). Information on a book should include book ID, title, author ID, ISBN, and edition. The system should capture author names so that users can search for an author. The library may carry multiple books by the same author, and an author can have multiple books in the...
For each account of the previous question, compute the Balance, and return a table that shows...
For each account of the previous question, compute the Balance, and return a table that shows the account number, type, and balance for each account (hint: use UNION). The list of customer names that have transactions greater than or equal to one thousand dollars. A) Answer this question using only nested queries (i.e., each select is over only one table). B) Answer this query using joins. Bank.sql is under this statement. DROP DATABASE IF EXISTS Bank; CREATE DATABASE Bank; USE...