The query that will return the employee's ID and his full name is
Q: Write a query to list the book number, title, and number of times each book has been checked out…
A: Query The query for viewing book number, title and the number of times each book had been checked…
Q: Write a query to produce the total number of hours and charges for each of the projects represented…
A: A query is a way to give instruction to the server to extract data from database. In SQL, SELECT…
Q: Now write a query which make use of equijoin to display the output as follows: Output Amani CS306…
A: I have provided a solution in step2.
Q: A.Write a query to show for each course how many sections are there? You need to display course…
A: According to Bartleby's rules, I will answer only the first question. The SQL code is given below
Q: The query that displays birth date of employee whose ssn = 123456789 in format 'Saturday…
A: to_char() is used to format output in specified format Day Month/dd/Year is the format to get…
Q: Question 2. Which of the following operator can be used between main query and subquery?
A: solution provide in second step
Q: Write the query finding the team name of employees whose salary is equal to 1/5 of the total amount…
A: Here we need to join table Teams and Salaries using NATURAL JOIN operator since they have a common…
Q: Describe a situation in which you would need to write a query using the HAVING clause.
A: Consider a situation in which the database administrator needs to group the table column or…
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: Show the last name, the trip id, and arrival town of those pilots who have flown with more than 450…
A: Consider pilots table and it contains the attributes last name, trip id, arrival town, airport name.…
Q: 10- What the output of the following query? SELECT name From STORE where job='mgr'
A: Consider the query SELECT name From STORE where job = ‘mgr’ The query will select all rows of the…
Q: Write a query that displays name of employee and commission for all employees who have been employed…
A: select ename,nvl(to_char(comm),'NO COMM') as comm,round(months_between(sysdate,hiredate))as…
Q: Write a query to display the book number, title and cost of books that have the lowest cost of any…
A: Query: In general, the term query describes a question or request that is made by a user or another…
Q: A company maintains information about its orders in the ORDERS table. Write a query to print details…
A: We need to write a Query to print the details of the earliest five orders from the ORDERS table…
Q: Write a query to generate a report indicating the total number of sick leave days for each employee.…
A: Actually, database is a used to stores the data\information.
Q: Create a Query with all products information whose price is >20.
A: Lets see the solution.
Q: Write a query that returns the mean cost per install for each adgroup as well as the percentage of…
A: the answer is given below:-
Q: Write a query to display the patron ID, first and last name of all patrons that have never checked…
A: Answer 1:- Query to copy : select PAT_ID, PAT_FNAME, PAT_LNAME from PATRON where PAT_ID not in…
Q: Write a query to display the customer code, first name, last name of all customers who made more…
A: Select: The SELECT statement is used to select data from a database. SELECT Syntax SELECT…
Q: write the query that updates the manager of the female employee who has 'c' as the last letter of…
A: Given : write the query that updates the manager of the female employee who has 'c' as the last…
Q: Write a query to display maximum bus tickets fare and give an alias name as MAXIMUM_AMOUNT
A: We use SELECT statement for selecting the data from relational database, the result will be stored…
Q: Write a query that will display all movies with a return date of March 1, 2018, March 5, 2018, March…
A: Sql query to display all the movies with a return date of March 1, 2018, March 5, 2018, March 15,…
Q: Write a query to output the apartments whose prices are greater than the average and are also not…
A: Dear Student, To solve this problem we will use the AVG keyword to find the average also we will use…
Q: Complete the query to get the number of employees working in the department ‘HR’. ______…
A: Given, We have to complete the given SQL query to get the number of employees working in the…
Q: Write a query to list the author last name, author first name and the book title and cost for each…
A: Solution: FROM: It is used to get data from the table WHERE: It is used to list the data where given…
Q: how to write a query using a subquery to list InvoiceNumber, InvoiceDate for those products with a…
A: A Subquery or Inner query or a Nested query is a query within another SQL query and embedded within…
Q: Write a query to verify that the data has been entered correctly.
A: First, insert data into the table using a query for example, declare @firstName varchar(500) =…
Q: Write a query to display the first name, last name, street, city, state, and zip code of any…
A: Actually, SQL is a language to operate databases in searching and filtering the data according to…
Q: Write a query to fetch details of employees whose EmpLname ends with an alphabet ‘A’ and contains…
A: Given, 'EmpLname' is the column name of the table. The last name of the employee ends with the…
Q: Write a query to list the book title, checkout date, checkout due date and checkout in date for each…
A: According to the information given:- We have to write a query on the basic of mention need.
Q: Write a query to display student ID, First name and age. Sort the result based on student ID. [Note…
A: According to the given problem statement we have to display student ID, first name and age based on…
Q: Write a query to display the book title, price and publisher name for all books.
A: The question requires us to Write a query to Display the book title , price and the publisher name…
Q: Create a query based on tblEmployee and tblPurchase using the Find Unmatched Query Wizard that lists…
A: Answer: First, Create a table with data. Click Query wizard Choose to Find unmatched query wizard…
Q: In the below given query, which expression is evaluated first? SELECT id_number, (quantity – 100 /…
A: Question. In the below given query, which expression is evaluated first? SELECT id_number, (quantity…
Q: Write a query to find the name of employees that begin with alphabet 'A'
A: Given, In SQL we need to write a query that finds the name of employees that begin with the…
Q: d. write a query to retrieve the name of graduate student and student advisor name of all graduate…
A: The query works for both ms sql server and mysql.
Q: Write a query to display the trip name of all the trips that has Miles Abrams as guide. Sort your…
A: You didn't define as language for query, so i am doing it in SQL. Query SELECT trip_name FROM…
Q: What will be the result of the following query? SELECT count(*) FROM enrollment GROUP BY courseid;
A: query : SELECT COUNT(*) FROM enrollment GROUP BY courceid; ans-> A - numbers 3 and 1 AMG ->…
Q: Create a query that lists the department number, employee number, and salaries of all employees in…
A: -- create a)CREATE TABLE EMPLOYEE ( empId INTEGER PRIMARY KEY, name TEXT NOT NULL, dept TEXT NOT…
Q: Write a query to get the maximum and minimum salary from the senators table (in that order).
A: The answer is given below.
Q: In an OUTER JOIN query, the outer join operator (+) is placed after which table?
A: OUTER JOIN: Outer Join is the joining method in which that gets all rows with matching values in…
Q: Write a query to retrieve the Fname and Lname in a single column as “FullName”. The first name and…
A: Given, Column name: Fname Lname FullName We need to separate the first name and the last name…
Q: Write a query to display student's Id and First Name whose from Coimbatore or Chennai and born on…
A: Task: Our task is to write the query to take the Student ID and First Name for the table which is…
Q: Assuming that this query displays the Employees whose first name starts with letter A, which…
A: Since we can answer only up to 1 question. So we'll answer the first question. Please resubmit the…
q17
Step by step
Solved in 2 steps
- create database GA2gouse GA2gocreate table salesman(salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30));insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer (customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id varchar(30)(select salesman_id from salesman); why does my sql server code not work, at the customer table?create database GA2gouse GA2gocreate table salesman(salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30));insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer (customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id int,CONSTRAINT FK_salesman_id FOREIGN KEY (salesman_id) REFERENCES salesman(salesman_id));insert into customer…create database GA2gouse GA2gocreate table salesman(salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30));insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer (customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id varchar(30),CONSTRAINT FK_salesman_id FOREIGN KEY (salesman_id) REFERENCES salesman(salesman_id)); i keep getting…
- create database GA2gouse GA2gocreate table salesman(salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30));insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer (customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id int,CONSTRAINT FK_salesman_id FOREIGN KEY (salesman_id) REFERENCES salesman(salesman_id));insert into customer…create database GA2gouse GA2gocreate table salesman(salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30));insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer (customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id varchar(30),CONSTRAINT FK_salesman_id FOREIGN KEY (salesman) REFERENCES salesman(salesman_id)); i keep getting this…create database GA2gouse GA2gocreate table salesman(salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30));insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer (customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id int,CONSTRAINT FK_salesman_id FOREIGN KEY (salesman_id) REFERENCES salesman(salesman_id));insert into customer…
- create database GA2gouse GA2gocreate table salesman(salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30));insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer (customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id int,CONSTRAINT FK_salesman_id FOREIGN KEY (salesman_id) REFERENCES salesman(salesman_id));insert into customer…Suppose that a mattress store has a TABLE1 with sales representatives with an attribute vcode as primary key. It also has a TABLE2 with every mattress sold, the table has an attribute vcode to indicate which sales representative made the sale, and a mt_code to indicate which mattress was sold. Which of the following returns all the sales representatives that haven't closed a sale? a. SELECT * FROM TABLE1 LEFT JOIN TABLE2 ON TABLE1.vcode = TABLE2.vcode WHERE mt_code IS NULL. b. SELECT * FROM TABLE1 JOIN TABLE2 ON TABLE1.vcode = TABLE2.vcode WHERE mt_code IS NULL. c. SELECT * FROM TABLE1 RIGHT JOIN TABLE2 ON TABLE1.vcode = TABLE2.vcode WHERE mt_code IS NULL. d. SELECT * FROM TABLE1 RIGHT JOIN TABLE2 ON TABLE1.vcode = TABLE2.vcode WHERE mt_code IS NOT NULL.I think my query needs temp variables instead of using NEW but I am not sure how. Here is my query: delimiter // DROP TRIGGER trg_pic_hours; create trigger trg_pic_hours after insert on CREW for each row begin IF NEW.CREW_JOB = 'Pilot' THEN update PILOT set PIL_PIC_HRS = PIL_PIC_HRS + ( select CHAR_HOURS_FLOWN from CHARTER where CHAR_TRP = NEW.CHAR_TRP) where EMP_NUM = NEW.EMP_NUM; END IF; END // If I run the query with the NEW.CHAR_TRP entry errors out if I remove NEW from it it will run ok. I have attached the schema
- Which of the following SQL statements is invalid and returns an error message? ALTER TABLE books ADD CONSTRAINT books_pubid_uk UNIQUE (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_pk PRIMARY KEY (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_nn NOT NULL (pubid); ALTER TABLE books ADD CONSTRAINT books_pubid_fk FOREIGN KEY (pubid) REFERENCES publisher (pubid); All of the above statements are invalid.Hi, I have the query below and I get it to run, but it is missing something how to answer the problem. My joins appear to be incorrect, I am using ID_number and S_ID. so I am completely lost there. CREATE OR REPLACE PROCEDURE Moreno_03_insCourseNumsProc(INOUT i_ID VARCHAR(5))LANGUAGE PLPGSQLAS$$DECLAREname VARCHAR(35);tot_courses INTEGER; -- Created this variable to hold the total course taught by the instructor l_exists_count INTEGER := 0; -- This is to identify the existence of the records the table instructor_course_numsBEGINSELECT name INTO name FROM instructor WHERE instructor.id = i_id;SELECT COUNT(*) INTO tot_courses FROM teaches WHERE teaches.id = i_id;SELECT COUNT(*) INTO l_exists_count FROM instructor_course_nums WHERE ID_Number = i_ID; IF l_exists_count > 0THENUPDATE instructor_course_nums SET tot_courses = total_course_nums WHERE ID_Number = i_ID;ELSEINSERT INTO instructor_course_nums VALUES(i_ID, name, tot_courses);END IF;COMMIT; END;--Creating the tablesUSE Bobs_Home_Repair; DROP TABLE IF EXISTS dbo.BOB_EMPLOYEE; CREATE TABLE dbo.BOB_EMPLOYEE(Employee_ID INT NOT NULL UNIQUE,First_Name VARCHAR(30) NOT NULL,Last_Name VARCHAR(30) NOT NULL,Address VARCHAR(100) NOT NULL,Phone_Number VARCHAR(20) NOT NULL,Hourly_Rate MONEY NOT NULL); DROP TABLE IF EXISTS dbo.CUSTOMER; CREATE TABLE dbo.CUSTOMER(Customer_ID INT NOT NULL UNIQUE,First_Name VARCHAR(30) NOT NULL,Last_Name VARCHAR(30) NOT NULL,Address VARCHAR(100) NOT NULL,Phone_Number VARCHAR(20) NOT NULL,); DROP TABLE IF EXISTS dbo.INVOICE; CREATE TABLE dbo.INVOICE(Invoice_ID INT NOT NULL UNIQUE,Job_ID INT NOT NULL UNIQUE,Customer_ID INT NOT NULL UNIQUE,Material_ID INT NOT NULL UNIQUE,Invoice_Date DATE NOT NULL,Invoice_Amount MONEY NOT NULL,Invoice_Due DATE NOT NULL,Invoice_Paid_Full_Amount CHAR(1) NOT NULL,Balance_Paid MONEY NOT NULL,Balance_Remaining MONEY NOT NULL); DROP TABLE IF EXISTS dbo.MATERIALS; CREATE TABLE dbo.MATERIALS(Material_ID INT NOT NULL UNIQUE,Job_ID…