• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

SQL 2008 help

Joined
Feb 21, 2008
Messages
6,308 (1.74/day)
Likes
3,428
Location
S.E. Virginia
System Name Barb's Domain/Barb's Cruncher#2
Processor i7 3930k@3.8ghz/i7 860 @ 3.3ghz
Motherboard ASUS Rampage IV Black Edition/Gigabyte P55-UD3R
Cooling Deep Cool Assassin/Corsair A50
Memory 16gig DDR3 1600/4gig DDR3 1600
Video Card(s) GTX 1070 OC'ed 2.1GHz core/4GHz mem/MSI HD7770
Storage 500GB WD Blue SSD, 2TB Seagate Hybrid SSHD/ WD Caviar Blue 160gb
Display(s) HP ZR30W 30" 2560*1600/SOYO Topaz S 24" 1920*1200
Case SilverStone Fortress FT04/NZXT Source 210 Black
Audio Device(s) Logitech Z533
Power Supply XFX 750W XXX edition/PC Power Cooling Turbo Cool 860
Mouse Logitect G5
Software Windows 10 Pro 64 bit /Windows 7 Ult 64 bit
Benchmark Scores https://www.3dmark.com/fs/14508101
#1
I'm having a problem and I hope someone can offer some help. Let me start by saying I'm not looking for someone to do my work for me. I'm looking for someone to help me understand what I'm doing and how to do it.

Ok, what I'm trying to do is retrieve data from two tables in one query. I'm on step 1 in the assignment details on the left side of the picture. I have the code to pull the info, but I can't figure out how to join the results into on table. When I type in the JOIN command, it's always dark gray, unlike the SELECT, and ORDER BY, which are blue. Is this a problem? Also, even though I have the primary key in my customer table and foreign key in my Orders table set to CustomerID, and they are associated with eachother, I keep getting the error in the picture. Can someone please help me with what I'm doing wrong here? I don't want you to do it for me, just explain what I'm doing wrong.

 
Joined
Feb 21, 2008
Messages
6,308 (1.74/day)
Likes
3,428
Location
S.E. Virginia
System Name Barb's Domain/Barb's Cruncher#2
Processor i7 3930k@3.8ghz/i7 860 @ 3.3ghz
Motherboard ASUS Rampage IV Black Edition/Gigabyte P55-UD3R
Cooling Deep Cool Assassin/Corsair A50
Memory 16gig DDR3 1600/4gig DDR3 1600
Video Card(s) GTX 1070 OC'ed 2.1GHz core/4GHz mem/MSI HD7770
Storage 500GB WD Blue SSD, 2TB Seagate Hybrid SSHD/ WD Caviar Blue 160gb
Display(s) HP ZR30W 30" 2560*1600/SOYO Topaz S 24" 1920*1200
Case SilverStone Fortress FT04/NZXT Source 210 Black
Audio Device(s) Logitech Z533
Power Supply XFX 750W XXX edition/PC Power Cooling Turbo Cool 860
Mouse Logitect G5
Software Windows 10 Pro 64 bit /Windows 7 Ult 64 bit
Benchmark Scores https://www.3dmark.com/fs/14508101
#2
ok, I figured out why I was getting that error, but the results are still coming up as two separate tables as seen here-


Please, someone explain to me what I'm doing wrong with my JOIN statement
 
Joined
Feb 21, 2008
Messages
6,308 (1.74/day)
Likes
3,428
Location
S.E. Virginia
System Name Barb's Domain/Barb's Cruncher#2
Processor i7 3930k@3.8ghz/i7 860 @ 3.3ghz
Motherboard ASUS Rampage IV Black Edition/Gigabyte P55-UD3R
Cooling Deep Cool Assassin/Corsair A50
Memory 16gig DDR3 1600/4gig DDR3 1600
Video Card(s) GTX 1070 OC'ed 2.1GHz core/4GHz mem/MSI HD7770
Storage 500GB WD Blue SSD, 2TB Seagate Hybrid SSHD/ WD Caviar Blue 160gb
Display(s) HP ZR30W 30" 2560*1600/SOYO Topaz S 24" 1920*1200
Case SilverStone Fortress FT04/NZXT Source 210 Black
Audio Device(s) Logitech Z533
Power Supply XFX 750W XXX edition/PC Power Cooling Turbo Cool 860
Mouse Logitect G5
Software Windows 10 Pro 64 bit /Windows 7 Ult 64 bit
Benchmark Scores https://www.3dmark.com/fs/14508101
#3
Well I figured it out. Seems I was going about it wrong, this is the proper code with the right results-