Question

Table Name Columns [collectionid] [spaceid] [collection_parent] [collection_path] collectionsale [collection_nm] [collection_

The primary keys of the table is on white colour (collectionid and objected)

Please right sql query to join the two tables together objectsale and collectionsale

use the columns in green colour to perform the join

drop the primary keys. The green colour columns can form a unique id

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the SQL query below.

SELECT * FROM collectionsale cs JOIN objectsale os ON cs.spaceid = os.collectionid and cs.collection_path = cs.object_nm;

Add a comment
Know the answer?
Add Answer to:
The primary keys of the table is on white colour (collectionid and objected) Please right sql...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create the database and tables for the database. Show all SQL statements. Include primary and foreign...

    Create the database and tables for the database. Show all SQL statements. Include primary and foreign keys. Insert data into each table. Show select statements and display the output of each table. Note:Student’s name must be inserted into table as part of the data! Perform the SQL below: Query one table and use WHERE to filter the results. The SELECT clause should have a column list, not an asterisk (*). State the purpose of the query; show the query and...

  • NEED THE SQL QUERIES ASAP PLEASE(LIKE 1 HOUR) THE ONES WITH ID ARE PRIMARY KEYS OR...

    NEED THE SQL QUERIES ASAP PLEASE(LIKE 1 HOUR) THE ONES WITH ID ARE PRIMARY KEYS OR FOREIGN etc Customer [ CustID, LastName, FirstName, Address, City, State, Zip, Phone, Fax, Email] Product [ ProdID, Description, Color, Size, Pack] Sales [ TransID, CustID, ProdID, Price, Quantity, Amount] Write SQL statement to produce a list of unique products and their prices from the Sales table. Please ensure that the products do not repeat. Write an SQL statement to list ProdID and Description for...

  • Consider the following three tables, primary and foreign keys. Table Name        SalesPeople Attribute Name                  &nbsp

    Consider the following three tables, primary and foreign keys. Table Name        SalesPeople Attribute Name                                Type                                      Key Type EmployeeNumber              Number                               Primary Key Name                                   Character JobTitle                                  Character            Address                                 Character PhoneNumber                    Character YearsInPosition                Number Table Name        ProductDescription Attribute Name                                 Type                                      Key Type                 ProductNumber                  Number                               Primary Key                 ProductName                    Character                            ProductPrice                      Number Table Name        SalesOrder Attribute Name                                Type                                      Key Type                 SalesOrderNumber         Number                               Primary Key                 ProductNumber              Number                               Foreign Key                 EmployeeNumber           Number                               Foreign Key                 SalesOrderDate                Date Assume...

  • Write an SQL query to list those properties that have never been sold. Design Tip When a property has sold, its information can be found in Sales table and vice versa. List each property with the foll...

    Write an SQL query to list those properties that have never been sold. Design Tip When a property has sold, its information can be found in Sales table and vice versa. List each property with the following four columns: property_id, primary_purpose, locality, and the area. Name the area coulmn as "Area". (Since the dataset might be incomplete, return "N/A" when the area is unknown for a property.) So the problem I got is that I got very similar output as...

  • rider_student Column Data Type Description student_id integer the primary key first_name varchar(25) student first name last_name...

    rider_student Column Data Type Description student_id integer the primary key first_name varchar(25) student first name last_name varchar(25) student last name major_id integer the ID of the student's major; a foreign key for the major_id in the rider_major table rider_major Column Data Type Description major_id integer the primary key major_name varchar(50) student first name major_description varchar(100) student last name Use the Tables above to answer the questions. Questions: 1. Write a SQL statement to add a student record to the rider_student...

  • I need help with the next TWO SQL question Concepts Question 1.2: Discuss what type of...

    I need help with the next TWO SQL question Concepts Question 1.2: Discuss what type of relationship exists between STUDENT and PROFESSOR. (Recall that relationships can be in the form of 1-1, 1-M, M:N.) Table name: STUDENT STU CODE PROF CODE 100278 128569 512272 531235 531268 553427 Table name: PROFESSOR PROF CODE DEPT CODE 26 36 Figure 1 Concepts Question 1.1: Using the STUDENT and PROFESSOR tables displayed in Figure 1, discuss (illustrate) the difference between 4 types of joins;...

  • SQL queries and procedures TABLE: Employees Business Rules: EmployeeID is defined as the primary key. Address...

    SQL queries and procedures TABLE: Employees Business Rules: EmployeeID is defined as the primary key. Address has been denormalized to include City and State for performance reasons. DeptNbr is a foreign key that references DeptNbr in the Department table Manager is a foreign key that references EmployeeID in the Employees table Data Structure: (EmployeeId, LastName, FirstName, Street, City, State, Zip, DateOfHire, DateOfBirth, JobTitle, Salary, DeptNbr(fk), Manager(fk)) TABLE: Department Business Rules: DeptNbr is defined as the primary key. Data Structure: (DeptNbr,...

  • Problem 1. Please create the following tables for UMBC bookstore’s textbook management system with appropriate primary...

    Problem 1. Please create the following tables for UMBC bookstore’s textbook management system with appropriate primary keys & foreign keys. Please include drop table statements with cascade constraints before your create table statements so it is easier to grade your create table statements. E.g., suppose you will create table tab1, tab2, including the following before creating them: Drop table tab1 cascade constraints; Drop table tab2 cascade constraints; Assumptions: Each teacher can teach one or more scheduled course sections. Each scheduled...

  • Match the keyword with its function Makes something new, typically a table Provides values to a...

    Match the keyword with its function Makes something new, typically a table Provides values to a table Declares a constraint on a table Chooses or reorders columns Declares which tables are present Identifies records of interest Renames either a column or a table Combines two tables or queries with equivalent structure Finds records that are shared between two tables or queries Determines items from a table or query that are not in the other table or query Extends records from...

  • Exercise 3 [12.5 marks] Given the Restaurant management system database that contains the following tables (primary...

    Exercise 3 [12.5 marks] Given the Restaurant management system database that contains the following tables (primary keys are underlined and foreign keys are preceded with #): Customer (customerID,customerFirstName,customerLastName,customerAddress) Oreder (orderID,orderDate, #customerID,#menuItemID,#staffID) MenuItem(menuItemID, menuItemName,ingredients,type,availability) Staff(staffID, staffName, staffPhoneNumber, staffRole ) OrderPayment(paymentID,paymentAmount,#orderID,#staffID) 1) Without using DISTINCT, write the SQL query equivalent to the following one:[1.5 marks] SELECT DISTINCT menuItemName FROM MenuItem WHERE type = ‘Vegetarian’ OR availability= ‘Yes’; 2) Express the following queries in SQL: a) Find the number of orders placed by...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT