Hi all,

I would like to ask for some help in a query. I am trying to create a view and this view should show the student name, project name, hours spent on the project, and number of units the project is worth. However, if the project is not done it should display null instead of the number of units available in the project database. I wrote the following query but can't get it to work

CREATE VIEW Student_A
AS SELECT  s.name, p.proj_name, a.hours, p.units, CASE p.units WHEN End_Date IS NOT NULL THEN p.units ELSE NULL END " Units"
From Student s, Project p, Assigned a
WHERE s.std_id=p.std_id AND p.project_id=a.project_id;

Any help is greatly appreciated =)

What error are you getting. also specify cardinality of the tables.

Kindly mention what exactly you are looking for and what are you getting as output from your query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.