BuyFindarrow_forward

Database Systems: Design, Implemen...

11th Edition
Steven + 8 others
ISBN: 9781285196145

Solutions

Chapter
Section
BuyFindarrow_forward

Database Systems: Design, Implemen...

11th Edition
Steven + 8 others
ISBN: 9781285196145
Textbook Problem

What is a cross join? Give an example of its syntax.

Program Plan Intro

Join:

Join is a relational operation, which combines the data from two or more tables into single table or view, then that is called as Join.

Program Explanation

CROSS join:

  • It is a type of join operation that performs Cartesian product of two tables.
  • That is, it produces a result set in which the rows from first table are multiplied with the rows from second table.

Syntax:

SELECT * FROM table_1 CROSS JOIN table_2;

Example:

Table creation:

Creating table 1:

CREATE TABLE table_1 (Item_ID int, Item_Name varchar(10), Company_ID int primary key);

Creating table 1:

CREATE TABLE table_2 (Company_ID int references table_1, Company_Name varchar(10), Company_city varchar(10));

Inserting values:

Inserting values to table 1:

INSERT INTO table_1 values (1, "Pancakes", 101);

INSERT INTO table_1 values (2, "Rice", 109);

INSERT INTO table_1 values (3, "Cakes", 106);

Inserting values to table 1:

INSERT INTO table_2 values (106, "AAA", "ZZZ");

INSERT INTO table_2 values (109, "BBB", "YYY");

Query using “CROSS JOIN”:

SELECT * FROM table_1 CROSS JOIN table_2;

Sample Output

Screenshot of the result:

images

The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started

Additional Engineering Solutions

Find more solutions based on key concepts

Show solutions add

What is a knowledge repository?

Fundamentals of Information Systems

What is XML, and how is it used?

Fundamentals of Information Systems

In which direction should hacksaw blade teeth point?

Precision Machining Technology (MindTap Course List)

Why is it important to know how to convert from one system of units to another?

Engineering Fundamentals: An Introduction to Engineering (MindTap Course List)

Find all the answers to your study problems with bartleby.
Textbook solutions plus Q&A. Get As ASAP arrow_forward