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:
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...
-
Ventura Company adjusts its accounts monthly and closes its accounts on December 31. On October 31, 2011, Ventura Company signed a note payable and borrowed $120,000 from a bank for a period of six...
-
Tan Ltd. issued HK$600,000,000 of 7% bonds on November 1, 2019, for HK$644,636,000. The bonds were dated November 1, 2019, and mature in 10 years, with interest payable each May 1 and November 1. The...
-
Consider a European-style option on a non-dividend-paying stock share, whose price follows a geometric Brownian motion with drift 5% and volatility 35% (per year); the continuously compounded...
-
Adamantane Inc. processes a base chemical into plastic. Standard costs and actual costs for direct materials, direct labor, and factory overhead incurred for the manufactureof 15,000 units of product...
-
Calculate the percentage price change for 4 bonds with different annual coupon rates (5% and 10%) and different maturities (3 years and 10 years), starting with a common 7.5% YTM (with annual...
-
A large manufacturing firm is concerned about lost production (i.e., production capability that was not utilized for a variety of reasons). One of the causes of such lost production was identified as...
-
Your local pie shop produces pumpkin pies that everyone loves. Over the years, they have honed their production process and have been able to set standard costs for the production of each pie. For...
-
What do you understand by Process break down and bottleneck of a process? Explain
-
The current price of a stock with a beta of 1.27 is $142. The stock is expected to pay a dividend of $6.8 next year. Assume that the expected return on a well-diversified portfolio with a beta of 1...
-
What are the critical reasons underlying the necessity for the regulation of external auditors?
-
You will be acting as an HR consultant pitching your services to an organization. The goal of this project is to identify an organization, identify and describe an HR function area, and make...
-
Given the following information: Percent of capital structure: Debt 35 % Preferred stock 20 Common equity 45 Additional information: Bond coupon rate 11% Bond yield to maturity 9% Dividend,...
-
Pete's Pizza Sells only pepperoni pizzas for $10 a pie. Fixed Costs Labor $1,500 Rent $3,000 Variable Costs Flour $.50 Yeast $.50 Insurance $200 Water $.01 Advertising $500 Cheese $3.00 Utilities...
-
According to a recent survey, 40% of millennials (those born in the 1980s or 1990s) view themselves more as spenders than savers. The survey also reveals that 75% of millennials view social...
-
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...
-
Your customer has requested a minor change to the project that shouldnt impact the schedule. How should you respond? a. Authorize the change to maintain good customer relations b. Refuse the change...
-
One of the benefits of resource-loading charts is that they: a. Represent a method for finding available activity slack b. Graphically display the amount of resources required as a function of time...
-
The objectives of resource smoothing are: a. To determine the resource requirements so that they will be available at the right time b. To allow each activity to be scheduled with the smoothest...
Study smarter with the SolutionInn App