Home » Other » Training & Certification » hi guys im going over some oracle base help
hi guys im going over some oracle base help [message #669495] Wed, 25 April 2018 22:13 Go to next message
lawrance
Messages: 2
Registered: April 2018
Junior Member
im doing some training and having issues with some queries i have 4 tables and sub classes set as

student - student ID, names, gender, enrolment , postcode, age , date joined, music style, lessons booked

Teacher - teacher ID, name , music style, lessons booked, date joined, postcode

Band - band ID, date joined, music style

Venue - venue ID, name , booking date, address

the queries i have are

* list all new students who have joined after the 1st of july order by joined date
* list of all underage males musicians and their age sorted by first name
* count of teachers from each post code
* list of all current lessons booking sorted bu the style of music and the booking date
* a report on the students enrolled, the style of music and the teacher

these are the once i have tried if someone can help me with them

for the 1st one i have tried
1. select * from student where datejoined='1/7/18' sort by datejoined asc;
2. select * from student where student gender ='male' and student age < 18 sort by student name;
3. select * from teacher count teacher from postcode;
4.select lessons booked from teacher natural join student order by music style, booking date;
5. select student id from student where enrolled = 'yes' natural join teacher where style of music like'%rock%;

any help would be a great help thanks
Re: hi guys im going over some oracle base help [message #669496 is a reply to message #669495] Thu, 26 April 2018 01:01 Go to previous messageGo to next message
John Watson
Messages: 8075
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read the OraFAQ Forum Guide and How to use code tags and make your code easier to read

Every one of your example queries has syntax errors. For example, when I run your first query:
orclx>
orclx>  select * from student where datejoined='1/7/18' sort by datejoined asc;
 select * from student where datejoined='1/7/18' sort by datejoined asc
                                                 *
ERROR at line 1:
ORA-00933: SQL command not properly ended


orclx>
SORT is not a key word in SQL. What training are you following? Which books and courses?
Re: hi guys im going over some oracle base help [message #669502 is a reply to message #669496] Thu, 26 April 2018 07:02 Go to previous messageGo to next message
lawrance
Messages: 2
Registered: April 2018
Junior Member
it's a uni subject im doing managing data. and have to run a practise database. sorry yeah its order by not sort by
Re: hi guys im going over some oracle base help [message #669508 is a reply to message #669502] Thu, 26 April 2018 09:51 Go to previous message
John Watson
Messages: 8075
Registered: January 2010
Location: Global Village
Senior Member
So what happens when you run the queries?
Previous Topic: Oracle Interview questions DBA plus Developer - Beginner and Advanced questions and answers
Next Topic: Oracle Retail v16 customization training
Goto Forum:
  


Current Time: Sun Dec 08 09:53:37 CST 2019