EBK COMPUTER SCIENCE: AN OVERVIEW
12th Edition
ISBN: 8220102744196
Author: 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
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
Write the query for implementing the following functions:
MAX(),MIN(),AVG(),COUNT()
Write the query to implement the concept of Intergrity constrains
"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…
Chapter 9 Solutions
EBK COMPUTER SCIENCE: AN OVERVIEW
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
- "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_forwardCourse: Database systems: design and applicationarrow_forwardQuestion 6 In the table is joined to itself using alias to differentiate the table from itself. Right outer join a. b. Inner join Left outer join C. Recursive join d.arrow_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_forwardA manager has a list of items that have been sorted according to an item ID. Some of them are duplicates. She wants to add a code to the database that assigns a 1 to the item if it is unique, and if there are duplicates, assigns the number of the duplicate. An example is shown below. The first two items are unique, so the repeat code is 1. However, Item ID 37695 is listed six times, so the codes are assigned from 1 to 6, and so on. Explain how to assign the correct code using an IF statement Item ID Repeat Code35080 135222 137695 137695 237695 337695 437695 537695 637712 137722 137757 137757 2 In cell B2 enter 1, and then type a formula into cell B3, followed by dragging the formula down column B until it aligns with the last row in the Item ID column. Which of the following is the correct formula to type into cell B3?arrow_forwardChapter 6, Exercise 8 From Murach's mysql 3rd edition I'm running a MySQL Database and trying to run the solution script for this exercise and continually run into this error: Error 1305 Function ap.GROUPING does not exist Here is the code -- taken straight from the solution code for that example: SELECT IF(GROUPING(terms_id) = 1, 'Grand Totals', terms_id) AS terms_id,IF(GROUPING(vendor_id) = 1, 'Terms ID Totals', vendor_id) AS vendor_id,MAX(payment_date) AS max_payment_date,SUM(invoice_total - credit_total - payment_total) AS balance_dueFROM invoicesGROUP BY terms_id, vendor_id WITH rollup;arrow_forward
- 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)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_forwardURGENT!arrow_forward
- The 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_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 only. a. How many copies of ISBN “0-321-52306-7” are there? b. How many copies of ISBN “0-321-52306-7” are currently available c. How many times has the book title with ISBN…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