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
wariber [46]
4 years ago
11

Identify two related tables in the JustLee Books database. Identify the common field between the two tables. Decide which column

s you would like to display in the output. Write a SQL code to join identified tables using the WHERE statement. Make sure to include qualifiers for columns that appear in both tables. Since only two tables are joined, make sure to include one join condition in the WHERE statement. Explain what the query is intended to do.
Repeat problem 1 but remove the WHERE statement. What happened? Why?

Repeat problem 1 using the JOIN … USING keywords.

Repeat problem 1 using the JOIN … ON keywords.

Repeat problem 1 but add a condition in the WHERE statement. Use logical operators to combine multiple conditions. Explain what the query is intended to do.

Repeat problem 1 but add two more conditions in the WHERE statement. Use logical operators to combine multiple conditions. Explain what the query is intended to do.

Identify three related tables in the JustLee Books database. Identify common fields between the tables. Decide which columns you would like to display in the output. Write a SQL code to join identified tables using the WHERE statement. Make sure to include qualifiers for columns that appear in multiple tables. Since three tables are joined, make sure to include two join conditions in the WHERE statement. Explain what the query is intended to do.

Repeat problem 7 using the JOIN … USING keywords and add two conditions. Explain what the query is intended to do.

Repeat problem 7 using the JOIN … ON keywords and add two conditions. Explain what the query is intended to do.

Use set operators UNION, INION ALL, INTERSECT, and MINUS to combine the results of two queries. Make sure the column list in both queries is consistent. Explain the result.

Identify a table in the JustLee Books database where a self-join can be used and write a corresponding SQL query. Explain what the query is intended to do.
Computers and Technology
1 answer:
Hatshy [7]4 years ago
7 0

Answer:

Answers explained below

Explanation:

<u>The two related table are: </u>

i) Books Table

ii) BOOKAUTHOR Table

<u>The common field between the two tables are: </u>

i) ISBN attribute

<u>The columns that i would like to display are: </u>

Title, ISBN, AuthorID, PubID, PubDate, Cost, Retail, Discount, Category

<u>Sql Code to join tables using where clause </u>

select t1.Title, t1.ISBN, t2.AuthorID, t1.PubID, t1.PubDate, t1.Cost, t1.Retail, t1.Discount, t1.Category from Books t1 INNER JOIN BOOKAUTHOR t2 ON t1.ISBN = t2.ISBN where t1.ISBN = 0401140733

The above query will dispaly the attributes of table "Books" and of table "BOOKAUTHOR" for book ISBN 0401140733

<u>Repeat problem 1 but remove the WHERE statement </u>

After removing the where condition we will have following join query

select t1.Title, t1.ISBN, t2.AuthorID, t1.PubID, t1.PubDate, t1.Cost, t1.Retail, t1.Discount, t1.Category from Books t1 INNER JOIN BOOKAUTHOR t2 ON t1.ISBN = t2.ISBN

The above query will display all the mapping data of table "Books" and of Table "BOOKAUTHOR"

You might be interested in
How are the number of rows calculated.​
Eva8 [605]

Answer:

ROWS function

Explanation:

Hope this helped

6 0
3 years ago
Who conceptualizes the design and the working of a website
Citrus2011 [14]
Answer is "Web Designer".

Web Designers are the "artists" of the website. They conceptualize the layout and functionality of the site, from features to format. They may do little coding, and are mostly involved in the creative elements of web design. The Web Developer is less big-picture, and more knitty-gritty building of the website. She is the one who does the coding and actually builds the website, using the web designer's model. 
3 0
4 years ago
Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have me
RSB [31]

Answer:

Explanation:

The code provided worked for the most part, it had some gramatical errors in when printing out the information as well as repeated values. I fixed and reorganized the printed information so that it is well formatted. The only thing that was missing from the code was the input validation to make sure that no negative values were passed. I added this within the getMonths() method so that it repeats the question until the user inputs a valid value. The program was tested and the output can be seen in the attached image below.

import java.io.*;

import java.util.*;

class Rainfall

{

   Scanner in = new Scanner(System.in);

   private int month = 12;

   private double total = 0;

   private double average;

   private double standard_deviation;

   private double largest;

   private double smallest;

   private double months[];

   public Rainfall()

   {

       months = new double[12];

   }

   public void setMonths()

   {

       for(int n=1; n <= month; n++)

       {

           int answer = 0;

           while (true) {

               System.out.println("Enter the rainfall (in inches) for month #" + n + ":" );

               answer = in.nextInt();

               if (answer > 0) {

                   months[n-1] = answer;

                   break;

               }

           }

       }

   }

   public void getTotal()

   {

       total = 0;

       for(int i = 0; i < 12; i++)

       {

           total = total + months[i];

       }

       System.out.println("The total rainfall for the year is " + total);

   }

   public void getAverage()

   {

       average = total/12;

       System.out.println("The average monthly rainfall is " + average);

   }

   public void getLargest()

   {

       double largest = 0;

       int largeind = 0;

       for(int i = 0; i < 12; i++)

       {

           if (months[i] > largest)

           {

               largest = months[i];

               largeind = i;

           }

       }

       System.out.println("The largest amount of rainfall was " + largest +

               " inches in month " + (largeind + 1));

   }

   public void getSmallest()

   {

       double smallest = Double.MAX_VALUE;

       int smallind = 0;

       for(int n = 0; n < month; n++)

       {

           if (months[n] < smallest)

           {

               smallest = months[n];

               smallind = n;

           }

       }

       System.out.println("The smallest amount of rainfall was " + smallest +

               " inches in month " + (smallind + 1));

   }

   public static void main(String[] args)

   {

       Rainfall r = new Rainfall();

       r.setMonths();

       r.getTotal();

       r.getSmallest();

       r.getLargest();

       r.getAverage();

   }

}

8 0
3 years ago
Consider the university enrollment database schema: 547 Student(snurn: integer, snarne: string, majoT: string, level: string, ag
trapecia [35]

Enroll a student identified by her snum into the class named 'Introduction to Database Systems' is the following transactions, state the SQL isolation level you would use.

1. Enroll a student identified by her snum into the class named 'Introduction to Database Systems'.

<u>Explanation:</u>

Since enroll is unique in the university enrollment database schema and field name is SNUM and it is data type is an integer. To identify student class name and department name and name of student SNUM field is used for searching in university enrollment database schema. Enrollment changing is not possible of the student’s not possible or not good practices in university enrollment database schema.

If a query had been made class wise or department wise enrollment is played an important role.

For  assign, a faculty is made on the class id or  department id.

8 0
4 years ago
United Broke Artists (UBA) is a broker for not-so-famous artists. UBA maintains a small database to track painters, paintings, a
lions [1.4K]

Answer:

Check the explanation

Explanation:

Kindly check the attached image below to see the relation and the table names.

7 0
3 years ago
Read 2 more answers
Other questions:
  • If you enjoy working with livestock, the best cluster in which to research careers would be: A. Health Science. B. Agriculture,
    11·1 answer
  • The command-line interface tells a user that it's ready to receive commands by displaying a specific set of characters called a(
    12·1 answer
  • A unique ability of people which sets them far apart from animals is:
    8·1 answer
  • What happens when a dataset includes records with missing data?
    9·1 answer
  • Please help! I tried this by myself. But I am not sure if this is right.
    8·2 answers
  • Create a file named homework_instructions.txt using VI editor and type in it all the submission instructions from page1 of this
    7·1 answer
  • Can someone help me with this lab assignment? I really do not know what should I do?
    5·1 answer
  • Osing Commands
    6·1 answer
  • Please Answer ASAP!!
    15·1 answer
  • What enables image processing, speech recognition, and complex game play in artificial intelligence?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!