Product(pid, name, type, manufacturer, price) Buys(cid, pid) Customer(cid, cname, age, gender) Write the following queries: mare who have nnhn 2.* e Urneapest eApenaiv 3. Find the most expensive product from each manufacturer 4. Find products that not being purchased 5. Find the names of all customers who have purchased the most expensive product.
Q: Write SQL queries for the following statements (Use only Cartesian product and join)…
A: Hey there, I am writing the required solution for the above stated question. I can only answer one…
Q: 1- List all the users and their card name using union 2- List all the users and their card name…
A: Answer1 : We will need to join the multiple sets to get the required details So, we will join the…
Q: Draw output results for following queries…
A: CREATE TABLE Product( PID int primary key, Description nvarchar(30), pQuantity int, Price int…
Q: PL/SQL Create a function to insert a new product into an existing order, include the product id,…
A: PL/ SQL: PL/ SQL stands for Procedural Language/ Structured Query Language. It act as host language…
Q: Without re-creating the table write one sql statement to answer this question. Change the definition…
A: Actually, database is a used to store the data and we can change ,manipulate and access the data.
Q: Given the table customers which contains columns customer_id, first_name, last_name, and state, and…
A: SELECT C.LASTNAME, A.STATE, A.ZIP FROM CUSTOMER AS C INNER JOIN ADDRESS AS A on…
Q: Based on the stage 2, write queries for the following questions: Sample output are provided for some…
A: As per our guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: Compute the average number of hours for the courses offered by each college
A: Below i have written query:
Q: a. Insert the sample data into the tables(at least 4 rows in each tables). 3. Write Queries for the…
A: Creating tables: Creating Student table: create table Student(Given_names varchar(25),Surname…
Q: Write the relational algebra formula to apply an INTERSECT relational operator to the tables
A: Relational algebra formula for Intersect Relational Operator: An Intersect relational operator…
Q: Write SQL queries for the following statements (Use only Cartesian product and join)…
A: 1. Ans PNAME ((Scity= 'islamabad'(Customer)) ⋈CID (Order))
Q: 3. Create a table for student mark list and insert the values for name, id, m1,m2,m3,m4,m5, total…
A: Oracle SQL: Oracle SQL Developer is a free, integrated development environment that streamlines…
Q: Solve the following queries:
A: Find the following queries in MySQL: Display all details of the item table. Select * from item;…
Q: Use sub queries to answer the following Q1) write a query to display the employees first name and…
A: Note:- since table name is not we had given queries according to question given Syntax: select…
Q: Display the information about the managers and clerks from the column ‘Job’ in the table emp, order…
A: Answer: SELECT * FROM emp WHERE Job=="managers" OR Job=="clerks" ORDER BY deptno;
Q: You are not required to execute the queries. However, your syntax must by accurate.You must give at…
A: Hey, since there are multiple sub-part questions posted, we will answer first three questions. If…
Q: Code three tests: 1) for a student who has courses 2) for student who does not have courses 3) a…
A:
Q: Find and display sales men that must not be living in the city similar to their customers also got a…
A: According to out guidelines, we are allowed to solve only the first three subparts of the question.…
Q: Write the appropriate SQL query for each of the following questions: A) Display ALL the activities…
A: The given problem is related to database SQL queries where the tables are given and requirement is…
Q: Write Queries for the following: a. List all student whose Surname begins with b or end with a or…
A: Question 3 is answered as per the guidelines, please repost other questions. The data inserted into…
Q: lease implement the following using Oracle live/SQL Developer: 1- Create the DONORS table with the…
A: please do upvote for my efforts ! answer: 1) CREATE TABLE DONORS( donor_id int primary key,…
Q: Write SQL statements to solve the following queries: - (a) Show the total number of students in…
A: Note: As per our company policy, only the first three subparts are answered. Please repost the…
Q: •Create and load the Employee, Department and Titic Tavics: ton •Write Queries for the following:…
A: Since multiple queries have been asked to be answered, we will answer first three queries. If you…
Q: Write a query to display all vendors sorted by vendor name. Write a query to display the product id,…
A: As per our company guidelines we are not supposed to answer more than 3 subparts of question and…
Q: Question 2: SQL Please see the following tables. Solve the questions with nested queries and…
A: SELECT Sailors.rating, AVG(Sailors.age) AS average_age FROM Sailors GROUP BY Sailors.rating HAVING…
Q: Write in SQL queries to populate the above tables by inserting minimum 4 tuples in each one
A: The Query is written in SQL. Please check step 2 for the details.
Q: Use multiple-row subquery in a WHERE clause. List order numbers of books, written by an author whose…
A: Multiрle-rоw subqueries аre nested queries thаt саn return mоre thаn оne rоw оf results…
Q: Consider Following Tables. Student ( regNo, sName, sCity, sCGPA, sAge) Course ( cCode, cName,…
A: Given: Student ( regNo, sName, sCity, sCGPA, sAge) Course ( cCode, cName, credit_hours) Enrollment…
Q: Write separate query for each of the following. Strcmp Replace Length Concat Datediff Sysdate…
A: STRCMP(string1, string2) REPLACE(string, from_string, new_string) LENGTH(string) CONCAT(expression1,…
Q: Write the SQL code to find the average Assign_Charge by Job_code from the Assignment table. Write…
A: 1) Write the SQL code to find the average Assign_Charge by Job_code from the Assignment table.…
Q: 1. List the Customer Id, Last Name for all customers, sorted by Last Name, ID. Table "Customer Id"…
A: As per our company guidelines we are supposed to answer only first 3 sub-parts. Kindly repost other…
Q: Write the SQL query to display the cid of all employees. Write the SQL code to list all…
A: According to company rules we are only supposed to answer 3 subparts kindly upload the other…
Q: 5: List the names of all salespeople and a count of the number of members they work with. (use uter…
A: Customer_id Name City Grade Saled_ID 1 Ricky Sydney 30 1001 2 Roy Delhi 20 1002 3 Bob London…
Q: PL/SQL - Procedures Find the best selling product in March in Restaurant database
A: SELECT TOP N column_name FROM table_name ORDER BY column_name ordering_type
Q: Write the following queries in the algebraic form using relational and theoretical operators:…
A: i give step wise handwritten solution as it includes some symbols
Q: Branches Dream Home has branch offices in cities throughout the United Kingdom. Each branch office…
A: Given: write the following queries (n) Identify flats with at least three rooms and with a monthly…
Q: Assume the following tables: Student (studid, email, name) Club (clubid, telephone, name,…
A: PL/SQL is a modern, block-structured programming language. It provides several features that make…
Q: Use single-row subquery in a HAVING clause. List customer numbers of customers who paid total amount…
A: A unmarried row subquery returns 0 or one row to the outer SQL assertion. You can area a subquery in…
Q: Consider Following Tables. Student ( regNo, sName, sCity, sCGPA, sAge) Course ( cCode, cName,…
A: Given: Consider Following Tables. Student ( regNo, sName, sCity, sCGPA, sAge) Course ( cCode, cName,…
Q: Display a list of all book titles and the percentage of markup for each book. The percentage of…
A: ROUND function The ROUND function is defined as a numerical function in Oracle or SQL to round the…
Q: Write the SQL code that will produce the results shown as below. Write the SQL code to calculate the…
A: SELECT PROJ_NAME, PROJ_VALUE, PROJ_BALANCE, EMPLOYEE.EMP_LNAME,…
Q: List the customer ID and first and last names for all customers located in the city of Cody. Your…
A: Convert the city to upper case and then check whether city is CODY or not
Q: Describe any 2 Special Operators in SQL with an example for each operator showing how it is used in…
A: Two special operators in SQL are: 1. IN operator 2. LIKE operator
Q: Display the name of supplier(s) that supplied the most expensive computer?
A: we can't directly use aggregate functions in where clause. writing select columnName from tableName…
Q: What is the use of sub queries?
A: Introduction; Anywhere an expression is permitted, a subquery may be utilized. In this case, the…
Q: 10 points QUESTION 19 Display each retail customer's number and their total number of retail orders…
A: The solution can be written in SQL: SQL is a database language that allows you to store, manipulate,…
Q: Question No. 4:…
A: 1-Display names of all those students who have "A" grades: We must join Student to display student…
Q: 1. Use the following tables to write the queries asked for: Book(b) → ISBN, title, edition, year…
A: SQL queries are given below
write the following queries
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Consider the following table schemas (primary keys are underlined): Company (cID, name, location) Flight (cID, fnumber, departure, arrival, price:integer, numberOfSeats:integer) Book (bID, cID, fnumber, customerID, seat, date) Customer (customerID, name, address) Draw Query-By-Example (QBE) tables for the following queries. 1.Find the names and addresses of customers who never booked a flight. 2. Find the names of customers who booked the flight to New York more than once. 3.Find the names of the companies that have the biggest (in terms of the number of seats) airplane. 4. Find the names of customers who booked flights to Boston and Seattle. 5. Insert tuples into a new table CustomerCheck that stores the names and addresses of customers along with their flight numbers who booked a flight from New York to LA on 09/30/21. Note: Query by example table is needed not just any tableConsider the following schema: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog (sid, pid, price) Write relational algebra expressions for the following queries: 1. Find the sids of suppliers and names who are located in Riyadh. 2. Find the name of suppliers who are located in Riyadh and Jeddah. 3. Find the names of supplier who supply part name “fog light”. 4. Find the sids of suppliers who supply every part. please only answer point number 4Solve all queries below using Relational Algebra: Schema Suppliers (sID, sName, address) Parts (pID, pName, colour) Catalog (sID, pID, price) 1. Find the names of all red parts. 2. Find all prices for parts that are red or green. (A part may have different prices from different manufacturers. 3. Find the sIDs of all suppliers who supply a part that is red or green. 4. Find the names of all suppliers who supply a part that is red or green.
- Consider the following schema: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog (sid, pid, price) Write relational algebra expressions for the following queries: a. Find the sids of suppliers and names who are located in Riyadh. b. Find the name of suppliers who are located in Riyadh and Jeddah. c. Find the names of supplier who supply part name “fog light”. d. Find the sids of suppliers who supply every part.Consider the following schema: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog (sid, pid, price) Write relational algebra expressions for the following queries: Find the sids of suppliers and names who are located in Riyadh. Find the name of suppliers who are located in Riyadh and Jeddah. Find the names of supplier who supply part name “fog light”. Find the sids of suppliers who supply every part.Question 1 : Consider the following schema: Suppliers(sid: integer, sname: string, address: string) Parts(pid: integer, pname: string, color: string) Catalog(sid: integer, pid: integer, cost: real) The Catalog relation lists the prices charged for parts by Suppliers. Write the following queries in SQL: 1.Find the snames of suppliers who supply every part. 2.Find the sids of suppliers who supply only red parts. 3.Find the price of the least expensive red part 4.Find the sids of suppliers who charge more for some part than the average cost of that part (averaged over all the suppliers who supply that part. 5.For every supplier, print the name of the supplier and the total number of parts that he or she supplies.
- Question 1 : Consider the following schema: Suppliers(sid: integer, sname: string, address: string) Parts(pid: integer, pname: string, color: string) Catalog(sid: integer, pid: integer, cost: real) The Catalog relation lists the prices charged for parts by Suppliers. Write the following queries in SQL: 1.Find the names of suppliers who supply every part. 2.Find the sids of suppliers who supply only red parts. 3.Find the price of the least expensive red part 4.Find the sids of suppliers who charge more for some part than the average cost of that part (averaged over all the suppliers who supply that part. 5.For every supplier, print the name of the supplier and the total number of parts that he or she supplies.Consider the following schema: Suppliers (sid, sname, city) Parts (pid, pname, color) Catalog (sid, pid, price) Write relational algebra expressions for the following queries: d. Find the sids of suppliers who supply every part.Consider the following schema: Suppliers (sid: integer, sname: string, address: string) Parts (pid: integer, pname: string, color: string) Catalog (sid: integer, pid: integer, cost: real) sid is the key for Suppliers, pid is the key for Parts, and sid and pid together form the key for Catalog. The Catalog relation lists the prices charged for parts by Suppliers. Write the SQL queries for the following: (a) Find the names of suppliers who supply some red part.(b) Find the sids of suppliers who supply some red or green part.(c) Find the sids of suppliers who supply some red part or are at 221 Packer Ave.(d) Find the sids of suppliers who supply some red part and some green part.(e) Find the sids of suppliers who supply every part.(f) Find the sids of suppliers who supply every red part.(g) Find the sids of suppliers who supply every red or green part.(h) Find the sids of suppliers who supply every red part or supply every green…
- Consider the following relational schema and answer the following questions. Employee (Employee_Id, First_Name, Last_Name, Email, Phone_Number, Hire_Date, Job_Id, Salary, Commission_Pct, Manager_Id, Department_Id) Write a query to get the difference between the highest and lowest salaries. Write a query to find the manager ID and the salary of the lowest-paid employee for that manager. Write a query to get the department ID and the total salary payable in each department. Write a query to get the total salary, maximum, minimum, average salary of employees (job ID wise), for department ID 90 only. Write a query to get the average salary for all departments employing more than 10 employees.SQL Queries: Given the following schema. Primary keys are underlined and highlighted in yellow and foreign keys are bold. The meaning of the relations is straightforward. Medical_Staff(MS_Id, MS_First, MS_Last, MS_PhoneNumber, MS_Occupation, Salary) Blood_Bank(Bank_Id, Bank_Name, Bank_Street, Bank_City, Bank_St, Bank_PhoneNumber) Donor(Donor_Id, Donor_First, Donor_Last, Donor_BloodType, Donor_City, Donor_St, DOB, TotalNumberOfDonations) Donation_Record(Donor_Id, Donation_Date, Donation_Amount) Employee(MS_Id, Bank_Id) Storage(Donor_Id, Donation_Date, Bank_Id) Write SQL queries to answer the following questions: a.Create a view to list of all employees for any Blood Bank that is in a city named St. Paul. (i.e., view output includes MS_Last, MS_First, and Bank_Id). Sort by Bank_Id, MS_Last, MS_First. b.Find full names of all donors who donated in 2021. (Hint: use IN) c.Create a stored procedure that takes two inputs: a Medical Staff identifier (MS_Id) and new salary. The…SQL Queries: Given the following schema. Primary keys are underlined and highlighted in yellow and foreign keys are bold. The meaning of the relations is straightforward. Medical_Staff(MS_Id, MS_First, MS_Last, MS_PhoneNumber, MS_Occupation, Salary) Blood_Bank(Bank_Id, Bank_Name, Bank_Street, Bank_City, Bank_St, Bank_PhoneNumber) Donor(Donor_Id, Donor_First, Donor_Last, Donor_BloodType, Donor_City, Donor_St, DOB, TotalNumberOfDonations) Donation_Record(Donor_Id, Donation_Date, Donation_Amount) Employee(MS_Id, Bank_Id) Storage(Donor_Id, Donation_Date, Bank_Id) Write SQL queries to answer the following questions: a.Find the average donation amount for Sue Thompson (Donor Id = 3329) for the year 2018. b.Sum all donations by Bank for each State (i.e. the State the blood bank is located in, not the Donor). c.Find the name of the youngest donor and all the donations made in by that donor in 2020.