Question

In: Computer Science

There are four tables in the database. 1. students (sno, sname, sgender, sbirthday, class) - sno:...

There are four tables in the database.

1. students (sno, sname, sgender, sbirthday, class)

- sno: student number

- sname: student name

- sgender: male or female

- sbirthday: date of birth

- class: class number

- primary key: sno

2. courses (cno, cname, tno)

- cno: course number

- cname: course name

- tno: teacher number

- primary key, cno, tno

3. scores (sno, cno, grade)

- sno: student number

- cno: course number

- grade: grade

- primary key, sno, cno

4. teachers (tno, tname, tgender, tbirthday, title, department)

- tno: teacher number

- tname: teacher name

- tgender: teacher gender

- tbirthday: date of birth

- title: title of the teacher, e.g. professor, lecture, or TA

- department: department name, e.g. CS, EE.

Question 1: In the score table, find the student number that has all the grades in between 90 and 70.

Question 2: For all the courses that took by class 15033, calculate the average grade.

Question 3: Find the class number that has at least two male students.

Question 4: Find the teacher's name in CS and EE department, where they have different title. Return both name and title.

Question 5: Find the students, who took the course number "3-105" and have earned a grade, at least, higher than the students who took "3- 245" course. Return the results in a descending order of grade.

Question 6: Find the students, who took more than 1 course, and return the students' names that is not the one with highest grade.

Question 7: For each course, find the students who earned a grade less than the average grade of this course.

Solutions

Expert Solution


Related Solutions

Consider the University Database with the following relations: Professors (pid, pname, dept, ext) Students (sid, sname,...
Consider the University Database with the following relations: Professors (pid, pname, dept, ext) Students (sid, sname, major-dept, year) Courses (cid, cname, dept, credithours) Enrollment (sem-year, sid, cid, grade) Teaches (pid, cid, sem-year, class-size) where, Professors: All professors have professor id (pid), name (pname), department that they work (dept), and a phone number extension for their office (ext). Students: All students have id (sid), name (sname), department for their major (major-dept), and a year (year i.e, freshman, sophomore, junior, etc). Courses:...
Consider the University Database with the following relations: Professors (pid, pname, dept, ext) Students (sid, sname,...
Consider the University Database with the following relations: Professors (pid, pname, dept, ext) Students (sid, sname, major-dept, year) Courses (cid, cname, dept, credithours)Enrollment (sem-year, sid, cid, grade) Teaches (pid, cid, sem-year, class-size), Professors: All professors have professor id (pid), name (pname), department that they work (dept), and a phone number extension for their office (ext). Students: All students have id (sid), name (sname), department for their major (major-dept), and a year (yeari.e, freshman, sophomore, junior, etc). Courses: All courses have...
Consider the University Database with the following relations: Professors (pid, pname, dept, ext) Students (sid, sname,...
Consider the University Database with the following relations: Professors (pid, pname, dept, ext) Students (sid, sname, major-dept, year) Courses (cid, cname, dept, credithours) Enrollment (sem-year, sid, cid, grade) Teaches (pid, cid, sem-year, class-size) where, Professors: All professors have professor id (pid), name (pname), department that they work (dept), and a phone number extension for their office (ext). Students: All students have id (sid), name (sname), department for their major (major-dept), and a year (year i.e, freshman, sophomore, junior, etc). Courses:...
Create a database with two tables as follows:- Students - StudentID, Name, Program FeePayment - StudentID,...
Create a database with two tables as follows:- Students - StudentID, Name, Program FeePayment - StudentID, Date, Description, Amount 1. Create a stored procedure that receives all the details of a student including fees and proceeds to insert insert the student details into the student details and the fee payment into the FeePayment table. All the operations should be done within a single transaction in a stored procedure. Note that the stored procedure works like a function that receives parameters....
Database Design Design a database and show the relationship between each tables. I need multiple tables....
Database Design Design a database and show the relationship between each tables. I need multiple tables. *Must meet the requirements for Third Normal Form. These are the information for employee DB. Employee Number, First Name, Last Name, Date of birth, Address, city, state, zip, department, job title, supervisor, health insurance number, health insurance provider, dental insurance number, dental insurance provider, spouse/partner, children, children's ages.
1. Discuss the elements of a database system. Like The database schema Schema objects Indexes Tables...
1. Discuss the elements of a database system. Like The database schema Schema objects Indexes Tables Fields and columns Records and rows Keys Relationships Data types 2. Discuss the key components of a database management system architecture and how they collaborate. 3. Discuss why a database management system needs a good query optimizer.
RSQLite (using R studio) 1. Make you have imported the database tables into your database (I've...
RSQLite (using R studio) 1. Make you have imported the database tables into your database (I've copied and pasted these at the bottom). Write and submit the following RSQLite queries. 2. Retrieve the names of all employees. 3. Retrieve the names of all distinct employee names. 4. Retrieve the names of all employees whose name begins with the letter ‘B’. 5. Retrieve the names and NI numbers (NI_NO) of all employees. 6. Retrieve details of employees who are over 31...
Use MYSQL to create the set of database tables of the relational database model and complete...
Use MYSQL to create the set of database tables of the relational database model and complete the associated queries given. Procedure: 1) Write all the SQL statements, necessary to create all tables and relationships, with Primary & Foreign keys. 2) Execute each statement in the correct order to create the relational database in MYSQL. 3)Insert some data into each table. 4) Use all your SQL create and Insert statements (from MS Word) to execute in the MYSQL WorkBench 5) Write...
INTRO TO DATABASE Consider the Sailors-Boats-Reserves database described below. Sailors(sid: integer, sname: string, rating: integer, age:...
INTRO TO DATABASE Consider the Sailors-Boats-Reserves database described below. Sailors(sid: integer, sname: string, rating: integer, age: real) Boats(bid: integer, bname: string, color: string) Reserves(sid: integer, bid: integer, day: date) Write each of the following queries in SQL. 1. Find the names and ages of sailors who have reserved at least two boats. 2. For each boat reserved by at least 2 distinct sailors, find the boat id and the average age of sailors who reserved it.
The following tables form part of a database (Flights Database) held in a relational DBMS: employee...
The following tables form part of a database (Flights Database) held in a relational DBMS: employee (empNo, empName, empSalary, empPosition) aircraft (aircraftNo, acName, acModel, acFlyingRange) flight (flightNo, aircraftNo, fromAirport, toAirport, flightDistance, departTime, arriveTime) certified (empNo, aircraftNo) Where:  employee contains details of all employees (pilots and non-pilots) and empNo is the primary key;  aircraft contains details of aircraft and C is the primary key.  flight contains details of flights and (flightNo, aircraftNo) form the primary key.  certified...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT