1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
____ [38]
3 years ago
10

(a) How many copies of the book titled "The Lost Tribe" are owned by the library branch whose name is "Sharpstown"? (b) How many

copies of the book titled "The Lost Tribe" are owned by each library branch? (c) Retrieve the names of all borrowers who do not have any books checked out. (d) For each book that is loaned out from the Sharpstown branch and whose DueDate is prior to "September 1, 2018", retrieve the book title, the borrower’s name, and the borrower’s address. (e) For each book authored (or coauthored) by Stephen King, retrieve the title and the number of copies owned by the library branch whose name is "Central". (f) Retrieve all book titles that are available in "Sharpstown" branch but not in "Morristown" branch. (g) Retrieve book titles that are available in all library branches in the database.
Computers and Technology
1 answer:
Charra [1.4K]3 years ago
3 0

Answer:

a) SELECT No_of_copies

FROM ((book JOIN book_copies) JOIN library_branch)

WHERE title = 'The Lost Tribe' AND branchname = 'Sharpstown';

b) SELECT branchname, No_of_copies

FROM ((book JOIN book_copies) JOIN library_branch)

WHERE title = 'The Lost Tribe'

GROUP BY branchname;

c) SELECT Name

FROM borrowers B

WHERE cardno NOT IN ( SELECT cardno FROM book_loan)

d) SELECT title, name, B.address

FROM (((book JOIN book_loan) JOIN library_branch) JOIN borrowers B)

WHERE duedate = '09/01/2018' AND branchname = 'Sharpstown';

e) SELECT title, No_of_copies

FROM (((book JOIN book_authors) JOIN book_copies) JOIN library_branch)

WHERE authorname = 'Stephen King' AND branchname = 'Central';

g) SELECT DISTINCT title

FROM ((book JOIN book_copies) JOIN library_branch)

Explanation:

The SQL statements query's a book store database of seven relations using joins and subqueries to return results.

You might be interested in
Mr. Petrucci, owner of the local pizza parlor, supports a free pre-K program in the community even though he does not have child
Shalnov [3]

Answer:  B

Explanation:

5 0
3 years ago
nswer the following questions concerning chapter 1:1.1 Which pair of layers are NOT peer layers?a.Transport layer in the sender
frosja888 [35]

Answer:

b.Transport layer in the sender and application layer in the receiver

Explanation:

A peer layer communication is usually used to describe the interactions of different layers among one another in the presence of system communication. If there is a single system, there will be approximately two neighboring layers such that one layer is below while the other is above. Therefore, the answer is option b.

8 0
3 years ago
Write a program to process weekly employee time cards for all employees of an organization. Each employee will have three data i
Naddika [18.5K]

Answer:

The cpp program for the scenario is shown.

#include <iostream>

using namespace std;

 int main() {

 

     int count;

     int empNum[count];

     double work_hrs[count];

     double hrly_wage[count];

     double ot_wage[count];

     double hour = 40.00;

     double gross_pay[count];

     double tax=3.625;

     double total_pay = 0, avg_pay;

     

   

   cout<<"Enter the number of employees "<<endl;

   cin>>count;

   cout<<"Enter the details for the employees "<<endl;

   

   int i=0;

   

   while(i<count)

   {

       cout<<"Enter the id"<<endl;

       cin>>empNum[i];  

       

       cout<<"Enter the working hours"<<endl;

       cin>>work_hrs[i];

       

       cout<<"Enter the hourly pay"<<endl;

       cin>>hrly_wage[i];

       ot_wage[i] = hrly_wage[i]*1.5;

       

       i++;

       

   }

   

   cout<<"The payroll for the employees "<<endl;

   

   i=0;

   

   while(i<count)

   {

       if(work_hrs[i] > hour)

           gross_pay[i] = ( hour*hrly_wage[i] );

       else

           gross_pay[i] = ( hrly_wage[i]*work_hrs[i] );

       

       if(work_hrs[i] > hour)

           gross_pay[i] = gross_pay[i] + ( (work_hrs[i]-hour)*ot_wage[i] );

           

       gross_pay[i] = gross_pay[i]-( (gross_pay[i]*tax)/100 );

       

       total_pay = total_pay + gross_pay[i];

       i++;

       

   }

   

   avg_pay = total_pay/count;

   i=0;

   

   while(i<count)

   {

       cout<<"Gross pay of employee "<<empNum[i]<<" : "<<gross_pay[i]<<endl;

   

       i++;

   }

   cout<<"Average amount paid to all employees is "<<avg_pay<<endl;

   

   return 0;

 }

OUTPUT

Enter the number of employees                                                                                                                

2                                                                                                                                            

Enter the details for the employees                                                                                                    

Enter the id                                                                                                                                  

111                                                                                                                                          

Enter the working hours                                                                                                                      

46                                                                                                                                            

Enter the hourly pay                                                                                                                          

12                                                                                                                                            

Enter the id                                                                                                                                  

222                                                                                                                                          

Enter the working hours                                                                                                                      

50                                                                                                                                            

Enter the hourly pay                                                                                                                          

14                                                                                                                                            

The payroll for the employees                                                                                                          

Gross pay of employee 111 : 566.685                                                                                                          

Gross pay of employee 222 : 742.087                                                                                                          

Average amount paid to all employees is 654.386                                                                                              

Explanation:

1. User enters the number of employees.

2. User enters all pieces of information including identification number, hourly wage rate and number of hours worked.

3. Inside a while loop, user input is taken in the arrays.

4. Inside another while loop, the gross pay of each employee is computed. The gross pay of each employee is added to the variable, total_pay.

5. The value of the variable, avg_pay, is computed outside the loop.

6. All the while loops work over variable i till the value of i becomes 1 less than count.

7. The value of the variable, i, is made 0 before the loop begins.

8. The employee number and the gross pay of each employee is displayed followed by the average pay.

5 0
4 years ago
When reading a ____ language, we use our understanding of the richness of the language's vocabulary to extract the meaning. geop
USPshnik [31]
When reading a FORMAL language
4 0
3 years ago
Write a while (or for) statement to print all the digits of an int type variable x, one digit per line. For example, if int x
Vlada [557]

<em>Complete Question:</em>

<em>Write a while (or for) statement to print all the digits of an int type variable x, one digit per line For example, if int x 38625, then the output should be in 5 lines as 60 (Hint: You may use built-in method to get a String representation of x then print out each character in String)</em>

***** Java *****

Answer:

import java.util.*;

public class Main{  

public static void main(String args[])  {  

Scanner input = new Scanner(System.in);

System.out.print("Enter an integer: ");

int x = input.nextInt();

String str = Integer.toString(x);  

for(int i =0;i<str.length();i++)  {

    System.out.println(str.charAt(i));

}

}  

}  

Explanation:

This line prompts user for input

System.out.print("Enter an integer: ");

This line gets user input

int x = input.nextInt();

This line converts user input to string

String str = Integer.toString(x);  

The following loop iterates through the converted string

for(int i =0;i<str.length();i++)  {

This prints each character on the string

    System.out.println(str.charAt(i));

}

7 0
3 years ago
Other questions:
  • What does the “Rooms” feature of FriendFeed do? Allows users with common interest to share their views and streams Allows users
    10·1 answer
  • R15. Suppose there are three routers between a source host and a destination host. Ignoring fragmentation, an IP datagram sent f
    8·1 answer
  • In the INSERT statement that follows, assume that all of the table and column names are spelled correctly, that none of the colu
    9·1 answer
  • One cost of starting your own business is _____.
    12·1 answer
  • What is an Action Button?
    10·1 answer
  • Using the same Apple ID for multiple devices will definitely sync them all together <br> True/False
    7·2 answers
  • tls Explain in your own words how, by applying both asymmetric and symmetric encryption, your browser uses TLS to protect the pr
    8·1 answer
  • a machine needs a minimum of 100 sec to sort 1000 names by quicksort what is the approximate worst case time needed to sort 100
    13·1 answer
  • Pa help po brainliest po kayo kon may nakita ako ng brainliest at mag wait kayo nga i brainliest kailangan ko ngayon please, hel
    15·1 answer
  • Select all the correct answers.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!