Quiz
D8
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (19)
1Retrieve tutor's name, who have more than experience others along with their students name. Tables: office {id (PK), locations, name}, tutor {id (PK), name officeid (FK references office (id)), experience}, students{id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Aselect t.name, s.name from tutor t join students s on t.id=s.tutorid where experience = (select max (experience) from tutor);
- Bselect t.name, s.name from tutor t join students s on t.id=s.id where experience = (select max (experience) from tutor);
- Cselect t.name, s.name, max(experience) from tutor t join students s on t.id=s.tutorid;
- Dselect t.name, s.name, max(experience) from tutor t join students s on t.id=s.tutorid
2convert students' name to upper letters. Tables: office {id (PK), locations, name}, tutor {id (PK), name, officeid (FK references office (id)), experience}, students {id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Aselect upper (name) from students;
- Bselect ucase (name) from students;
- Cselect Name from students;
- Dselect lower (name) from students;
3Retrieve student's name, which starts from A. Tables: office {id (PK), locations, name}, tutor {id (PK), name officeid (FK references office (id)), experience}, students{id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Aselect name from students where name like 'a%';
- Bselect name from students where name like '%A%';
- Cselect name from students where name like 'A_%';
- Dselect name from students where name like 'A';
4Find an average scholarship of students. Tables: office {id (PK), locations, name}, tutor {id (PK), name officeid (FK references office (id)), experience}, students{id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Aselect averg (scholarship) from students;
- Bselect av (scholarship) from students;
- Cselect avrg (scholarship) from students;
- Dselect avg (scholarship) from students;
5Retrieve quantity of students in the students table - students {id, name, scholarship, registereddate, tutorid}
- ASelect avg (id) from office;
- Bselect sum(id) from office;
- Cselect max(id) from office;
- Dselect count(id) from office;
6Retrieve all students name with the department name, but excluding department CSSE. Tables: office {id (PK), locations, name}, tutor {id (PK), name officeid (FK references office (id)), experience}, students{id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Aselect s.name, o.name from students s join tutor t on t.id=s.tutorid join office o on o.id = t.officeid where o.name = 'CSSE';
- Bselect s.name, o.name from students s join tutor t on t.id=s.tutorid join office o on o.id = t.officeid group by o.name, s.name;
- Cselect s.name, o.name from students s join tutor t on t.id=s.tutorid join office o on o.id = t.officeid
- Dselect s.name, o.name from students s join tutor t on t.id=s.tutorid join office o on o.id = t.officeid where o.name <> 'CSSE';
7Which function is used to retrieve quantity of rows
- Asum
- Bmax
- Ccount
- Davg
8define inner join
- Areturns all rows from the left table (1) and from the right table(2)
- Breturns all rows from the right table(2), with the matching rows in the right table(2)
- Creturns all rows from the left table(1), with the matching rows in the right table(2)
- Dselects all rows from both tables as long as there is a match between the columns in both tables
9define right join
- Areturns all rows from the left table(1) and from the right table(2)
- Bselects all rows from both tables as long as there is a match between the columns in both tables
- Creturns all rows from the right table(2), with the matching rows in the left table(1)
- Dreturns all rows from the left table(1), with the matching rows in the right table(2)
10Define avg function
- AReturns the first value
- BReturns average value
- CReturns total value
- DConverts to lowercase
11Retrieve library name, book name, number of copies, which have more than 25 copies. Book {bookid, title, publisher_name, price}. BookCopies {bookid, libraryid, noOfCopies [references Book(bookid)]}. Library(libraryid)), cardno (references Borrower (cardno)), dateout, duedate}.
- Aselect l.libraryname, b.title, bc.no_of_copies from book b join book_copies bc on b.bookid=bc.bookid where bc.no_of_copies>25;
- Bselect l.libraryname, b.title, bc.no_of_copies from book b join book_copies bc on b.bookid=bc.bookid join library l on l.libraryid = bc.libraryid where bc.no_of_copies>25;
- Cselect l.libraryname, b.title, bc.no_of_copies from book join library l on l.libraryid = bc.libraryid where bc.no_of_copies>25;
- Dselect l.libraryname, b.title, bc.no_of_copies from book b join book_copies bc on b.bookid=bc.bookid join library l l.libraryid = bc.libraryid where bc.no_of_copies>25;
12Which of the following query is incorrect for retrieving all students name with the department name, but excluding department CSSE.Tables: office {id (PK), locations, name}, tutor {id (PK), name officeid (FK references office (id)), experience}, students{id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Aselect s.name, o.name from students s join tutor t on t.id = s.tutorid join office o on o.id=t.officeid where o.name not in ('CSSE');
- Bselect s.name, o.name from students s join tutor t on t.id = s.tutorid join office o on o.id=t.officeid where o.name <> 'CSSE';
- Cselect s.name, o.name from students s join tutor t on t.id = s.tutorid join office o on o.id=t.officeid where o.name <= 'CSSE';
- Dselect s.name, o.name from students s join tutor t on t.id = s.tutorid join office o on o.id=t.officeid where o.name not like 'CSSE';
13When an insertion anomally occurs?
- Adeletion leads to an unintended loss of data
- Bit is possible that not all data needs to be changed will always be changed
- Cit does not occur
- Dwe are prevented from inserting some data into a relation until other data can be supplied
14What kind symbol is used to find one character in wildcards?
- Ain
- B$
- C?
- D_
15Retrieve the number of departments in the department table. Tables: Department {id,name}. Employee {id, name, salary, dep_id (references Department(id))}
- Aselect sum (id) from department
- Bselect id from department
- Cselect count(id) from department
- Dselect coun(id) from department
16Retrieve quantity of offices in the office table - office {id, locations, name}
- ASelect count (id) from office;
- BSelect avg (id) from office;
- CSelect max(id) from office;
- DSelect sum(id) from office;
17Retrieve office name from the table office {id, locations, name}
- ASelect *form office;
- BSelect *from office;
- CSelect from office;
- DSelect name from office;
18Retrieve the lowest experience from tutor. Tables: office {id (PK), locations, name}, tutor {id (PK), name officeid (FK references office (id)), experience}, students{id (PK), name, scholarship, registereddate, tutorid (FK references tutor (id))}.
- Aselect max (t.experience) from tutor t group by t.name;
- Bselect min(t.experience) from tutor t group by t.name;
- Cselect min (experience) from tutor;
- Dselect max (experience) from tutor;
19How many types of anomalies exist
- A3
- B4
- C2
- D1
Information
- Description
- Quiz on D8, created by Ozaki Kester on 15/01/2017.
- Author
- Ozaki Kester
- Language
- English
- Views
- 11
- Tags
- Rating
- No ratings yet Rate this quiz