Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Question for any SQL programmers out there!

Hi there,

I know team treehouse doesn't teach SQL but I was wondering if anyone with SQL experience here could help me with my problem..

I am looking to grab 2 useful queries using JOINS from a unviersity database:

CREATE TABLE LECTURER
(LECT_ID        INT PRIMARY KEY,
 LECT_FNAME              VARCHAR(20),
 LECT_LNAME              VARCHAR(20),
 LECT_DEPT               VARCHAR(20));

CREATE TABLE STULECT 
( LECT_ID       INT PRIMARY KEY,
  STU_ID        INT PRIMARY KEY);

CREATE TABLE STUDENT
(STU_ID         INT PRIMARY KEY,
 STU_FNAME              VARCHAR(20),
 STU_LNAME              VARCHAR(20),
 STU_COURSE             VARCHAR(30));

CREATE TABLE STUNIT
( STU_ID        INT PRIMARY KEY,
  U_ID          INT PRIMARY KEY);

CREATE TABLE UNIT
(U_ID           INT PRIMARY KEY,
 U_NAME               VARCHAR(20),
 U_COURSE             VARCHAR(20),
 U_DEPT               VARCHAR(20));

There are: 40 Lecturers 30 Units 600 Students

I have an idea... I want the database to show which lecturer teaches which student... Or something like I want to find out which lecturer teaches which unit.

Any help would be appreciated

Thank you! James.

James,

There is a course although maybe a bit outdated on SQL. If you go under library and search development courses, scroll down until you reach database foundations, there they teach SQL, maybe that will help.