Skip to content
Advertisement

Is it possible to select multiple tables with different quantity attributes?

Note: I looked in this forum and could not find the solution I’m looking for.

These are the tables I created:

library:

name, registry

book:

date, author, code

Question 1: Is it possible to select the attributes of the two tables even though they have different attribute amounts?

Question 2: Can I access (select) the attributes of the book table through the library table?

Advertisement

Answer

Q1: Yes, as long as they have a common relation (primary key, foreign key). If they have a relation you can always query to get items even if they have different number.

Q2: Yup! You can select books through the use of the library table. You can use something similar to:

SELECT book.author
FROM library
INNER JOIN book ON library.registry=book.code;
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement