Consider the following relations: Student (snum: integer, sname: string, major: string, level: string, age: integer) Class(name:...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2022/12/639c0f8d577b2_1671171980429.jpg)
Transcribed Image Text:
Consider the following relations: Student (snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets_at: string, room: string, fid: integer) Enrolled (snum: integer, ename: string) Faculty (fid: integer, fname: string, deptid: integer) Write the following queries in SQL. 1. Find the names of the students that are enrolled in all the classes. 2. Find the names of the classes and their designated rooms that have five or more students enrolled. 3. Find the names of students who are enrolled in the course called Math101. 4. Find the names of the faculty members who do not teach any class. 5. Find the name of classes in which only students of the first year are enrolled. Consider the following relations: Student (snum: integer, sname: string, major: string, level: string, age: integer) Class(name: string, meets_at: string, room: string, fid: integer) Enrolled (snum: integer, ename: string) Faculty (fid: integer, fname: string, deptid: integer) Write the following queries in SQL. 1. Find the names of the students that are enrolled in all the classes. 2. Find the names of the classes and their designated rooms that have five or more students enrolled. 3. Find the names of students who are enrolled in the course called Math101. 4. Find the names of the faculty members who do not teach any class. 5. Find the name of classes in which only students of the first year are enrolled.
Expert Answer:
Answer rating: 100% (QA)
1 SELECT DISTINCT sname FROM Student WHERE snum IN S... View the full answer
Related Book For
Database management systems
ISBN: 978-0072465631
3rd edition
Authors: Raghu Ramakrishan, Johannes Gehrke, Scott Selikoff
Posted Date:
Students also viewed these programming questions
-
Consider the following relations for a database that keeps track of business trips of salespersons in a sales office: SALESPERSON (SSN, Name, Start_Year, Dept_No) TRIP (SSN, From_City, To_City,...
-
Consider the following relations for a database that keeps track of student enrollment in courses and the books adopted for each course: STUDENT (SSN, Name, Major, Bdate) COURSE (Course#, Quarter,...
-
Consider the following relations for an order-processing application database at ABC, Inc. ORDER (O#, Odate, Cust#, Total_amount) ORDER-ITEM (O#, I#, Qty_ordered, Total_price, Discount%) Assume that...
-
The estimated times (in weeks) and immediate predecessors for the activities in a project are given in the following table. Assume that the activity times are independent. (a) Calculate the expected...
-
Espiritu Construction Co. has used the cost-to-cost percentage-of-completion method of recognizing revenue. Tony Espiritu assumed leadership of the business after the recent death of his father,...
-
From a standard 52-card deck, how many 5-card hands have all face cards? All face cards, but no kings?
-
Using the Internet, find five or six websites of the many forensic accounting firms.
-
Tyva makes a very popular undyed cloth sandal in one style, but in Regular and Deluxe. The Regular sandals have cloth soles and the Deluxe sandals have cloth-covered wooden soles. Tyva is preparing...
-
. Vaughn Department Store uses a perpetual inventory system. Data for product E2-D2 include the following purchases. Date Number of Units Unit Cost May 7 45 $12 July 28 30 16 On June 1, Vaughn sold...
-
Agata Polanska opened her first Pierogi Factory restaurant in Kitchener, Ontario in 2015. Customers love her authentic Polish pierogi, so Agata has steadily expanded her business to include four...
-
A 9-year bond with a 10.1 percent semiannual coupon and a $1,000 face value has a nominal yield to maturity of 9.1 percent. The bond currently sells for $1,060.56. The bond, which may be called after...
-
A) The inflation rate in UK is currently a double digit which the country has not experienced in many decades. The Central Bank is very concerned with the current inflation rate, and it is noticed...
-
- How often do you check your e-mail? 1 In general, what kinds of information do you receive via e-mail? - How often do you receive letters? - In general, what kinds of messages do these letters...
-
OA beam of negligible mass is shown in the given diagram. If a force of 55 N acts at a point 0.45 m away from the hinge and making an angle at 68. What is the magnitude and direction of the torque?...
-
The purpose of this activity is to identify and present how the brand uses different social media platforms to communicate its messages. ISocial Media Platforms (TikTok) Analysis (Value offered,...
-
When teachers say they are color blind, they are usually saying that they do not discriminate and that they treat all their students equally. Of course, being fair and treating each student with...
-
Investors invested $800,000 in 60 days Commercial paper has 3 % discount yield on an equivalent size and risk 60 days CD has 3% single payment yield. 1] Solve the PO (purchase price of security) 2]...
-
Pedro Bourbone is the founder and owner of a highly successful small business and, over the past several years, has accumulated a significant amount of personal wealth. His portfolio of stocks and...
-
Consider the instance of the Students relation shown in Figure 3.1. FIELDS (ATTRIBUTES, COLUMNS) An Instance S1 of the Students Relation 1. Give an example of an attribute (or set of attributes) that...
-
What is the difference between a candidate key and the primary key for a given relation? What is a superkey?
-
Answer the following questions: 1. Describe how a typical lock manager is implemented. Why must lock and unlock be atomic operations? What is the difference between a lock and a latch? What are...
-
To become a member of an Internet DVD library, Maritza has to put down a deposit of \($100,\) using her credit card. When and if Maritza chooses to discontinue her membership, the library will refund...
-
If your personal financial statements indicate that you have a deficit, what might you do to change your financial situation?
-
How do you calculate your net worth when preparing a balance sheet?
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App