Computer Science: An Overview (13th Edition) (What's New in Computer Science)
13th Edition
ISBN: 9780134875460
Author: Glenn Brookshear, Dennis Brylow
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 9, Problem 36CRP
Explanation of Solution
SQL code for previous problem:
The SQL code for the given program segment is as follows:
SELECT Employee.Name
FROM Employee, Job
WHERE Employee.EmpId = JoB.EmpId AND Job.Dept = 'SALES'
Explanation:
- The above SQL query is used to lists the “Name” from relations “EMPLOYEE” and “JOB” where the value of “EmpId” is equal in both relations and the value of “Dept” is “SALES”...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
10. Sometimes logic for a query can be quite complex. It is possible to produce the desired
outcomes through the use of subqueries, inline views, and UNION-type statements. For those
methods, the transitional results are not saved in the database but are directly used within the
query. This can lead to achievement issues, particularly when the transitional results have a huge
number of
Explain.
a. columns
b. rows
c. reports
d. databases
Consider a database with the following tables:
v Patient(PatientID. PatientName, NumberOfVisits)
v Doctor(DoctorID, DoctorName)
v Appointment(ApplD, DoctorID, PatientID. Date, time)
Write SQL statements or the necessary steps that do the following:
a) Write the SQL statements required to create the above tables. You have to choose the best data
type for each column, and all necessary keys (primary and foreign
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
Chapter 9 Solutions
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
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
- Fill the blanks with the suitable PL/SQL statements that correct each of the errors that appear in the given PL/SQL program. declare vAddress employee.Address%vRoWTYPE; ( . . . . . . . . . . . . . . . . . . )begin select ename , address into vAddress from employee where salary = 1500; ( . . . . . . . . . . . . . . . . . . . ) DBMS_OUTPUT.PUT_LINE('NOM = ' || vEname || 'Adresse= ' || vAddress );exception when MANYROWS then ( . . . . . . . . . . . . . . . . . . . ) dbms_output.put_line(“This query returned many rows”); end;arrow_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 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”.arrow_forward"6.1,6.2 & 6.1 are answered" The given problem has an entity relationship diagram where the requirement is to implement the diagram in the database , insert records in the tables and then perform the sql script execution to return the result of mentioned statements. **As per Bartleby guidelines, solving the first 3 sub-parts as the question contains many parts and the required parts to be answered is not mentioned. It will involve the below steps: Converting ERD to relational schema The database will need to create below tables: **Primary key is bold and underlined, Foreign key is italic Patient(Pat_ID, Pat_Name, Pat_Age, Pat_Gender) Doctor(Doc_ID, DOc_Name, Doc_EmployDate, Prc_ID) Consultation(Doc_ID, Pat_ID, Con_Date) Practice(Prc_ID, Prc_Name, Prc_YearEstablished, Prc_Province) 6.1 Create tables in SQL Below is the script to create the tables with attributes and foreign key constraints: //Script will create the database named TrueHealth and then populate the…arrow_forward
- ALGORITHM QUESTION: Assume that UQU wants to perform the following operations on its retained records of students and staffs: NameLookup (ID): Return the name of the person whose identification is ID, andNumLookup (Name): Return the ID of the person whose name is Name. Let n is the total number of students and staffs at UQU, present a data structure that take O(logn) time and O(n) space to perform each of the above operations, explain your answer.arrow_forwardThis is a database system question regarding SELECT: Which of the following statements is true for SELECT statements in general? a. HAVING is executed before WHERE when running an SQL query b. SELECT is executed before FROM when running an SQL query c. Each SELECT clause must have a WHERE clause as well. d. COUNT(column_name) function returns the number of values in the column, including any NULLs e. HAVING clause specifies a condition for selecting grouped tuples from the GROUP BY clause.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_forwardProblem 8-10 use the same database. Let a database application have the following entities Sales = (Customers, Salesperson, Retail Order, Items), which contains the information that a salesperson sells multiple items (tables, computers,...) to customers. There are many customers. There are many salesmen. There are many items. For example, John sells to Joe, Smith sells to Jane, The "Salesperson" will sale many times. The "Customer" can come back and buy items many times The "Retail Order" specifies which Salesperson sell to which customer. In each "Retail_Order", many items (tables, computers,...) can be sold Hint: This is very similar to one of your homework What is the relationship between Retail_Order and Items? One-to-many relationship None of the above One-to-one relationship Many-to-many relationshiparrow_forward
- 3.1. As a sales agent, you have been tasked to write SQL query that searches the STOCKLIST_INFORMATION database for STOCK_ NAME values beginning with LP (LAPTOP) or CPU and their list prices. Remember that the laptop list price must be between R6000 and R9000, and the CPU speed must be either 5x2ghz or 5x3ghz. Sort the results in descending ITEM_PRICE order. 3.2. A political party agreed to present a handbag to every member of the party's women's league. Most of them want pink handbag. Several price quotes for pink purses were requested. The supplier information is not available from the normal source, but you know that the supplier identification number is embedded in the STOCK_ INFORMATION table's CATALOG URL field. You must get the STOCK_NAME and CATALOG URL values, as well as the supplier number from the CATALOG URL column, for all goods that have both the words PINK and HANDBAG contained in the STOCK_DESCRIPTION column. Hint: A typical CATALOG_URL entry looks as follows:…arrow_forwardConsider the following ACTORS, FILMS and ACTEDIN relations for this problem. АСTORS FILMS SSNO FName LName YearOfBirth Gender Film FilmTitle Number Lengthin Production OfPrices Mins Yearof No 1 Bruce Willis 1955 male 1 The Sixth Sense 1999 32 107 Milla Jονοvich 1975 female 2 Sin City 2005 31 124 3 Clint Eastwood 1930 male 3 The Fifth Element 1997 126 4 Turkan Sray 1945 female 4 Unforgiven 1992 40 131 Kevin Costner 1955 male 5 A Perfect World 1993 22 138 Robert De Niro 1943 male 6. A Bronx Tale 1993 1 177 7 Yilmaz Guney 1937 male The Godfather I| 7 1974 16 202 8. Al Pacino 1940 male 8 Once Upon a Time in America 1984 13 229 9 Danny Devito 1944 male 9 One Flew Over the Cuckoo's Nest 1975 35 131 10 Jack Nicholson 1937 male 10 The Departed 2006 94 151 11 Tarik Akan 1949 male 11 The Shining 1980 3 146 12 Kadir Inanir 1949 male 12 Titanic 1997 121 194 13 Selvi Boylum Al Yazmalim 1977 90 АСТEDIN 14 Yol 1982 6 114 SSNO FilmNo Character 15 Inception 2010 148 148 1 1 Dr. Malcolm Crowe 1 2…arrow_forwardbranch(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_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