当前位置:   article > 正文

leetcode 175. Combine Two Tables_python leetcode 175

python leetcode 175

175. Combine Two Tables

 
  My Submissions
  • Total Accepted: 24263
  • Total Submissions: 70650
  • Difficulty: Easy

Table: Person

+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| PersonId    | int     |
| FirstName   | varchar |
| LastName    | varchar |
+-------------+---------+
PersonId is the primary key column for this table.

Table: Address

+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| AddressId   | int     |
| PersonId    | int     |
| City        | varchar |
| State       | varchar |
+-------------+---------+
AddressId is the primary key column for this table.

Write a SQL query for a report that provides the following information for each person in the Person table, regardless if there is an address for each of those people:

FirstName, LastName, City, State













  1. # Write your MySQL query statement below
  2. # select p.FirstName,p.LastName,a.City,a.State from Person p left join Address a using PersonId;
  3. # SELECT p.FirstName, p.LastName, a.City, a.State FROM Person p LEFT JOIN Address a USING (PersonId);
  4. SELECT p.FirstName, p.LastName, a.City, a.State FROM Person p LEFT JOIN Address a USING (PersonId);
  5. 时灵时不灵的,好奇怪。。。有时候平台会报 内部错误。。。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/727069
推荐阅读
相关标签
  

闽ICP备14008679号