Question

When writing a SQL SELECT from two different tables, do the tables in the SQL need...

  1. When writing a SQL SELECT from two different tables, do the tables in the SQL need to be joined by primary/foreign key(s)?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

No.. Not always required we can join the 2 different tables with any column if they has same data type.

Here the only condition is joining columns must be of same type

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
When writing a SQL SELECT from two different tables, do the tables in the SQL need...
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
  • use SQL to answer the question. Create two tables and insert atleast 7 or 8 values(whatever...

    use SQL to answer the question. Create two tables and insert atleast 7 or 8 values(whatever you want) into each of these two tables 1) Person 2) Favorite food I need every step-codes such as : SQL> connect admin/admin as sysdba; SQL> create table products_tb1 2 (prod_id integer primary key, 3 prod_desc char(30), 4 cost real); SQL> insert into products_tb1 values(11235, 'WITCH COSTUME', 29.99); SQL> insert into products_tb1 values(222, 'PLASTIC PUMKIN 18 INCH', 7.75); SQL> insert into products_tb1 values(13, 'FALSE...

  • Write SQL Queries Given the following tables (7pts) Retrieve the names of employees and their project...

    Write SQL Queries Given the following tables (7pts) Retrieve the names of employees and their project name. If the employee never worked on a project, show the names only the name, not the project name. (7pts) Retrieve the names of employees who have worked on the same project at a different location. (7pts) Retrieve the names of employees who have worked on more than two different projects. (7pts) Retrieve the names of employees who manage more than two employees. CREATE...

  • BONUS QUESTION: Suppose you have two tables, EMPLOYEES with primary key employee_ID, and DEPARTMENTS with primary...

    BONUS QUESTION: Suppose you have two tables, EMPLOYEES with primary key employee_ID, and DEPARTMENTS with primary key department_ID. Assume each department may have many employees, but each employee is only assigned one department. What would be the correct SQL syntax for retrieving data from both tables? (HINT: You must find out what is the foreign key) A. SELECT employee_ID, employee_name, department_ID, department_location FROM Employees JOIN Departments ON Employees.employee_ID = Departments.employee_ID; B. SELECT employee_ID, employee_name, department_ID, department_location FROM Employees JOIN Departments...

  • This assignment consists of a series of SQL questions. For each question, you will need to...

    This assignment consists of a series of SQL questions. For each question, you will need to include: • SQL query. • An explanation of the query. Please include explanations as a comment AFTER your query, e.g., enclosed within a /* comments block */ ). See the first example in the SQL tutorial for a comment. You don’t need to explain straightforward code in comments. Only the parts that are interesting or different, so that we understand what you did. Question-1...

  • SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do...

    SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do steps after. First 3 tables are after the first 2 images for reference if needed. //1// CREATE TABLE kr_customer ( Name VARCHAR(40) NOT NULL PRIMARY KEY, City VARCHAR(20), Status CHAR(1) ); //2// CREATE TABLE kr_salesperson ( Name VARCHAR(40) NOT NULL PRIMARY KEY, Age INT, Salary DECIMAL(8, 2) ); //3// CREATE TABLE kr_order ( Order_Number number(3) NOT NULL PRIMARY KEY, Customer_Name VARCHAR(40), Salesperson_Name VARCHAR(40), Amount...

  • 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...

  • Need SQL form Thanks a lot EIERCISES lowing tables form part of a database held in...

    Need SQL form Thanks a lot EIERCISES lowing tables form part of a database held in a relational DBMS: Hote (Hotel_No, Name, Address) Roo (Room No, Hotel No. Tvpe. Price) Guest (Guest No, Name, Address) Room contains room details for each hotel and (Hotel_No, Room No) Boong Hotel No Ges, No, Date Fiom, Daie,To, RomNe) OOm where Hotel contains hotel details and Hotel No is the pri mary key forms the primary key -93

  • True or False questions: 1. A data type mismatch error would occur when the primary key...

    True or False questions: 1. A data type mismatch error would occur when the primary key data data type is auto number and the foreign key in the related table is number. 2. The data type long integer is the same as integer. 3. When using SQL, the SELECT clause isolates tables in the database. 4. A Referential Integrity violation occur when the primary key is null. 5. When an REA model has 7 entities ,2 linking tables, 3 Resource...

  • Need help writing SQL statements. The questions involved use the following database Student SID – Integer...

    Need help writing SQL statements. The questions involved use the following database Student SID – Integer – Primary Key SName - String Address - String Classes ClassID – Integer – Primary Key ClassName - String Credits - Integer Grades SID – Integer – Primary Key CID – Integer – Primary Key Grade - Integer Q1 – Write a script that creates a view to show all the students and all the classes they took and the grades they got in...

  • (SQL) Write DDL statements to create the tables below and use appropriate data types for the...

    (SQL) Write DDL statements to create the tables below and use appropriate data types for the attributes.Relational database schema: Teacher = [CourseN, Quarter,TeacherName] Course = [CourseN,CourseName, Nunit) LocationNTime = [CourseN, Quarter , DayTime, RoomN] . //Examples of DayTime: M2:00AM, W4:50PM, and T8:00PM. Note that DayTime is represented as a string. Student = [studentName, CourseN, Quarter] .................... The DDL statement must include at least the following constraints: Every Primary Key; Every Foreign Key; For every Foreign Key constraint, the referential integrity...

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