SELECT S.StudentId, S.StudentName, A.AdvisorName
FROM Student S, Advisor A
WHERE S.AdvisorID = A.AdvisorID OR A.AdvisorID is NULL
Q8: Consider the following tables. Write a query to list Students (StudentID, StudentName) and the names...
Consider the following tables: Professor(profid, profname, department) Student(studid, studname, major) Advise(profid, studid) Formulate a SQL statement for the query below: a) return the names of the students who have exactly the same advisors as student whose id is "1234"
Question: Draw the ERD for the following situation. Show all entities, attributes, relationships, cardinalities, and modalities. Each student (with attributes StudentID, StudentName, and StudentMajor) must be assigned one advisor (with attributes AdvisorID, AdvisorName, and AdvisorDepartment). Advisors may advise no students or may advise many students. Each student must register for zero or many courses (with attributes CourseID, CourseTitle, and CourseCredits) with the help of one or more advisers. A course may have at least one student registered, and may have...
Write SQL queries to answer the following question: A. Which students are enrolled in Database and Networking? (Hint: use SectionNo for each class, so that you can determine the answer from the Registration table by itself.) I have attempted the code below, but am receiving an error under the first SELECT, showing error code 1064, (syntax error) SELECT StudentName, StudentID FROM Student WHERE StudentID =(select StudentID FROM Registration WHERE (SectionNo=2714 OR SectionNo=2715) GROUP BY StudentID HAVING COUNT (*)>1;
31. (15 pts) Consider the following relations and relationship: Student (studentID, name, address, gender, major) Course (courselD, title, hour, department) Enrollment (StudentID, courselD, date Write the SQL statements to perf orm the following operations: List all the students' information for those majoring in "Computer Science". (2 pts) List the majors, and the numbers of the students in every major. (2 pts) List the departments, and the total number of hours of the courses offered by every department. (2 pts) List...
This is a database with two tables relating to students at a school. Each student has a unique ID. There is a backlog table that maintains a record of active backlogs for each student. Write a query my oracle sql to print the names of the students who have at least one active backlog. The names should be printed in ascending order.The results should be in the following format: NAME Note: There could be students with the same name but...
Subject : computer science -web development Qus: using the database tables below write the SQL queries: ( SELECT; FORM; WHERE; ORDER BY; DISTINCT; GROUP BY; COUNT(); SUM(); AVG(); MAX(); MIN(); JOIN; ON) Student (StudentId, Major, GPA) Transcript( Studentid, CourseNo, Gread); Course( CourseNo, Title, Credits) Display the title of the course(s) that are 3 credits? Display the average GPA of the students Majoring in ‘CSC’ List non duplicated major(s) of students who have received a grades of ‘A’ in CSC350 List...
You have been given a univerity business plan that produced the following information: PERSON: lname, fname, rname, idnum, private, linkblue lname, fname, rname are variable length strings idnum is type INT and is a key attribute private is BOOLEAN linkblue is string of 8 characters CREATE TABLE PERSON (idnum INT NOT NULL PRIMARY KEY, lname varchar(40), fname varchar(40), rname varchar(40), private BOOLEAN, linkblue char(8) NOT NULL); ADVISOR: student, advisor student is a foreign key to PERSON.idnum advisor is a foreign...
using the University database we have provided you with the creation script using the relational schema of a University as shown below. You should run this script in MySQL Workbench and use this database to extract the necessary information. The script is based on the following relational schema: Subject (subjectCode, departmentName) TeachingStaff (employeeNumber, firstName, surname, departmentName) Instructs (employeeNumber, subjectCode, studentID, position) Student (studentID, studentSurname, studentInitials, gender) TeachingCredentials (employeeNumber, degreecode, uni, awardYear) Enrolment (studentId, degreeCode, year, uni, timeMode, placeMode, completed) Grades...
Consider the following two tables: Table – EmployeeInformations Table – EmployeeSalary EmpId Name ManagerId DateOfJoining 121 Ali 321 01/31/2014 321 Raed 986 01/30/2015 421 Khaled 876 27/11/2016 EmpId Project Salary 121 P1 8000 321 P2 1000 421 P1 12000 Write a SQL query to find the names of all employees having salary greater than or equal to 5000 and less than or equal 10000? Write a SQL query to find all employees from the " EmployeeInformations " table, sorted by the...
Question 5: Sevens Let's take a look at data from both of our tables, students and checkboxes, to find out if students that got the number 7 assigned to them also chose '7' for the obedience question. Specifically, we want to look at the students that fulfill the below conditions and see if they also chose '7' in the question that asked students to choose the number 7 (column seven in students). reported that their favorite number (column number in...