Pearson eText for Computer Science: An Overview -- Instant Access (Pearson+)
13th Edition
ISBN: 9780137503216
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON+
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 9, Problem 32CRP
Explanation of Solution
SQL code for previous problem:
The SQL code for the given program segment is as follows:
SELECT JobId, StartDate
FROM Assignment
WHERE TermDate = '*'
Explanation:
- The above SQL query is used to display “JobId” and “StartDate” from relation “Assignment” where the value of “TermDate” is “*”...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
demonstrate how to connect to a sqlite database.
HOW TO SUBMIT YOUR ASSIGNMENT
At the top of each of your C++ programs, you should have at least four lines of documentation:
Program name (the C++ file name(s)), Author (your name), Date last updated, and Purpose (a brief description of what the program accomplishes). Here is an example:
/* Program name: jbtictactoe.cpp* Author: John Doe* Date last updated: 5/1/2017* Purpose: Play the game of Tic-Tac-Toe*/
ASSIGNMENT: Database Connection
Fact Database ER Diagram
Write a program that opens a connection to the FACT database factdb.db Download factdb.db. If the connection doesn't open successfully print an error message from the database and end the program, otherwise print a success message. Then use a callback function to print the results of a select query (any select query of your choice) and close the database.
To submit your assignment:
Submit your source code file (*.cpp)
For the following database scheme
Employee(empNo.fName,IName,address,DOB,sex,position,deptNo)
Department(deptNo.deptName,.mgrEmpNo)
Project(projNo.projName,deptNo)
WorksOn(empNo.projNo.dateWorked.hoursWorked)
Write an SQL statement to produce a list of the total hours worked by each employee arranged in order of employee number
I
Consider an employee database with two relationsemployee (employee name, street, city)works (employee name, company name, salary) where the primary keys are underlined.Write a function avg salary that takes a company name as an argument and finds the average salary of employees at that company. Then, write an SQL statement, using that function, to find companies whose employees earn a higher salary, on average, than the average salary at “First Bank”.
Chapter 9 Solutions
Pearson eText for Computer Science: An Overview -- Instant Access (Pearson+)
Ch. 9.1 - Identify two departments in a manufacturing plant...Ch. 9.1 - Prob. 2QECh. 9.1 - Summarize the roles of the application software...Ch. 9.2 - Prob. 1QECh. 9.2 - Prob. 2QECh. 9.2 - Prob. 4QECh. 9.2 - Prob. 5QECh. 9.2 - Prob. 6QECh. 9.3 - Prob. 1QECh. 9.3 - What is a persistent object?
Ch. 9.3 - Identify some classes as well as some of their...Ch. 9.3 - Prob. 4QECh. 9.4 - Prob. 1QECh. 9.4 - Prob. 2QECh. 9.4 - Prob. 3QECh. 9.4 - Prob. 4QECh. 9.4 - Prob. 5QECh. 9.4 - Prob. 6QECh. 9.5 - Prob. 1QECh. 9.5 - Prob. 2QECh. 9.5 - Prob. 3QECh. 9.5 - Prob. 4QECh. 9.5 - Prob. 5QECh. 9.5 - Prob. 6QECh. 9.5 - Prob. 7QECh. 9.6 - Prob. 1QECh. 9.6 - Give an additional example of a pattern that might...Ch. 9.6 - Prob. 3QECh. 9.6 - How does data mining differ from traditional...Ch. 9.7 - Prob. 1QECh. 9.7 - Prob. 2QECh. 9.7 - Prob. 3QECh. 9.7 - Prob. 4QECh. 9 - Prob. 1CRPCh. 9 - Prob. 2CRPCh. 9 - Prob. 3CRPCh. 9 - Prob. 4CRPCh. 9 - Prob. 5CRPCh. 9 - Prob. 6CRPCh. 9 - Prob. 7CRPCh. 9 - Prob. 8CRPCh. 9 - Prob. 9CRPCh. 9 - Prob. 10CRPCh. 9 - Prob. 11CRPCh. 9 - Prob. 12CRPCh. 9 - Using the commands SELECT, PROJECT, and JOIN,...Ch. 9 - Answer Problem 13 using SQL. PROBLEM 13 13. Using...Ch. 9 - Prob. 15CRPCh. 9 - Prob. 16CRPCh. 9 - Prob. 17CRPCh. 9 - Prob. 18CRPCh. 9 - Prob. 19CRPCh. 9 - Empl Id Name Address SSN Job Id Job Title Skill...Ch. 9 - Empl Id Name Address SSN Job Id Job Title Skill...Ch. 9 - Prob. 22CRPCh. 9 - Prob. 23CRPCh. 9 - Prob. 24CRPCh. 9 - Prob. 25CRPCh. 9 - Write a sequence of instructions (using the...Ch. 9 - Prob. 27CRPCh. 9 - Prob. 28CRPCh. 9 - Prob. 29CRPCh. 9 - Prob. 30CRPCh. 9 - Prob. 31CRPCh. 9 - Prob. 32CRPCh. 9 - Prob. 33CRPCh. 9 - Prob. 34CRPCh. 9 - Prob. 35CRPCh. 9 - Prob. 36CRPCh. 9 - Prob. 37CRPCh. 9 - Prob. 38CRPCh. 9 - Prob. 39CRPCh. 9 - Prob. 40CRPCh. 9 - Prob. 41CRPCh. 9 - Prob. 42CRPCh. 9 - Prob. 43CRPCh. 9 - Prob. 44CRPCh. 9 - Prob. 45CRPCh. 9 - Prob. 46CRPCh. 9 - Prob. 47CRPCh. 9 - Prob. 48CRPCh. 9 - Prob. 49CRPCh. 9 - Prob. 50CRPCh. 9 - Prob. 51CRPCh. 9 - Prob. 52CRPCh. 9 - Prob. 53CRPCh. 9 - Prob. 54CRPCh. 9 - Prob. 55CRPCh. 9 - Prob. 56CRPCh. 9 - Prob. 57CRPCh. 9 - Prob. 58CRPCh. 9 - Prob. 59CRPCh. 9 - Prob. 60CRPCh. 9 - Prob. 61CRPCh. 9 - Prob. 62CRPCh. 9 - Prob. 1SICh. 9 - Prob. 2SICh. 9 - Prob. 3SICh. 9 - Prob. 4SICh. 9 - Prob. 5SICh. 9 - Prob. 6SICh. 9 - Prob. 7SICh. 9 - Prob. 8SICh. 9 - Prob. 9SICh. 9 - Prob. 10SI
Knowledge Booster
Similar questions
- (FROM DATABASE SYSTEMS, 13TH ED.) Problem 15. Use a query to compute the total of all purchases, the number of purchases, and the average purchase amount made by each customer. Your output values must match those shown in Figure P7.15. Sort the results by customer code.arrow_forwarda) Choose a database application with which you are familiar. Design a schema and show a sample database for that application, using the notation of Figure 1 and Figure 2. b) Write SQL update statements to do the following on the database schema shown in Figure 1. i. Insert a new student, <‘Johnson’, 25, 1, ‘Math’>, in the database. ii. Change the class of student ‘Smith’ to 2.arrow_forwardQ2: Design Database for the following scenario and Write SQL queries. Create an ERD for the following scenario. Suppose there is a grocery store near your house. Following can be considered for ERD: A grocery store may have more than one employee. A grocery store has exactly one manager. The manager has one or more sales men working under him. Grocery store has more than one portion for the products. • Each product has a barcode, name, expired date. Many customers can busy many products, but each product is bought by only one customer. Each customer will get an invoice for his /her purchase. The bill invoice has an id.arrow_forward
- For the following database scheme Employee(empNo,fName.IName.address.DOB.sex,position.deptNo) Department(deptNo.deptName,mgrEmpNo) Project(projNo.projName,deptNo) WorksOn(empNo.projNo.dateWorked,hoursWorked) Write an SQL statement to find all the details of employees who are femalearrow_forwardConsider an employee database with two relationsemployee (employee_name, street, city)works (employee_name, company_name, salary) where the primary keys are underlined. Write a function avg_salary that takes a company name as an argument and finds the average salary of employees at thatcompany. Then, write an SQL statement, using that function, to find companieswhose employees earn a higher salary, on average, than the average salary at“First Bank”.arrow_forwardOthers Forex Final GPT-3 PHP Setup & Hello Wo For the following database scheme Employee(empNo fName.IName,address,DOB.sex.position,deptNo) Department(deptNo.deptName.mgrEmpNo) Project(projNo.projName.deptNo) WorksOn(empNo projNo.dateWorked hoursWorked) Write an SQL statement to list the project number, project name and the number of employees in the project for each project in which more than 2 employees workarrow_forward
- branch(branchhame, branch+citysassets} customer (HD, Customer name, customer street, customer city) loan loan number branch_name, amounty borrower(ID; loan_number account (account_number, branch name, balance)e depositor (HDs account number)- Figure le Consider the bank database in Figure 1, where the primary keys are underlined. Each branch might have many loans or accounts, associated with borrowers or depositors, respectively. Construct the following SQL queries for this relational database. 1. Find the name of each branch that has at least one customer who has an account in the bank and who lives in the "Harrison" city. Make sure each branch name only appears once. 2. Find the ID of each customer who lives on the same street and in the same city as customer "12345". (1) Please use "tuple variables". e (2) Please use "derived relations" or “with". 3. Find the ID of each customer of the bank who has an account but not a loan. 4. Find the total sum of all loan amounts for each branch…arrow_forwardTo show a single row function in a database, we used the function named "single row". Scalar function or vector function? Which is better?arrow_forward1. Create a PL/SQL function. The minimal requirements: using the cursor in PLSQL function, retrieve data from object table and record the data in the PL/SQL table, make calculations with object data and define return value of the function, test the operation of the function (get the result). The maximal requirements: you can add IF-ELSEIF's, cursor processing in loops, more interesting semantic functions. 2. Create methods for object types. The minimal requirements: use map/order methods (1 method) (method+ demonstration), use MEMBER methods (2 methods) (methods + demonstration). The maximal requirements: non-trivial methods, that use more complex comparisons or do more complex calculations – i.e., give a couple more constructs in code. 3. Demonstrate the multiset operators. The minimal requirements: using 2 different multiset operators (can be included in the code), they can also be used in the The maximal requirements: the queries make sense semantically, one of the queries is a…arrow_forward
- Course: Database systems: design and applicationarrow_forwardThe following tables form part of a Library database held in an RDBMS: Book (ISBN, title, edition, year) BookCopy (copyNo, ISBN, available) Borrower (borrowerNo, borrowerName, borrowerAddress) BookLoan (copyNo, dateOut, dateDue, borrowerNo) where: Book contains details of book titles in the library and the ISBN is the key. BookCopy contains details of the individual copies of books in the library and copyNo is the key. ISBN is a foreign key identifying the book title. Borrower contains details of library members who can borrow books and borrowerNo is the key. BookLoan contains details of the book copies that are borrowed by library members and copyNo/dateOut forms the key. borrowerNo is a foreign key identifying the borrower. Formulate the following queries in relational algebra and tuple relational calculus: 5.27 List all copies of book titles that are available for borrowing. 5.28 List all copies of the book title “Lord of the Rings” that are available for…arrow_forwardThe following tables form part of a Library database held in an RDBMS: Book (ISBN, title, edition, year) BookCopy (copyNo, ISBN, available) Borrower (borrowerNo, borrowerName, borrowerAddress) BookLoan (copyNo, dateOut, dateDue, borrowerNo) where: Book contains details of book titles in the library and the ISBN is the key. BookCopy contains details of the individual copies of books in the library and copyNo is the key. ISBN is a foreign key identifying the book title. Borrower contains details of library members who can borrow books and borrowerNo is the key. BookLoan contains details of the book copies that are borrowed by library members and copyNo/dateOut forms the key. borrowerNo is a foreign key identifying the borrower. Formulate the following queries in relational algebra and tuple relational calculus: a. List all book titles. b. List all borrower details. c.List all book titles published in the year 2012. d. List all copies of book titles that are…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education