SELECT CustomerName, CustomerAddress, CustomerCity, CustomerState, CustomerPostalCode FROM Customer_T WHERE Customer_T.CustomerlD = (SELECT Order_T.CustomerID FROM Order_T WHERE OrderlID = 1008);
Q: Name Null? Type --------- ----- ------------ GIFT VARCHAR2(15)…
A: The PRIMARY KEY constraint means that each record in a table is unique. This means that primary keys…
Q: Write a SQL query that displays the number of customers who born on the 16th day of a month . Write…
A: 1. select count(customerID) from Customers where to_char(custDOB,'DD') = 16; 2. select customerID…
Q: Examine this product table's column definitions: pid number primary key pname varchar2(50) You must…
A: Given:
Q: Write a SELECT statement that returns the companyname, address, city and postalcode from the…
A: We need to display companyname, address, city and postalcode from the suppliers table Tables needed:…
Q: Table Name: CUSTOMERS FIELD NAME DATA TYPE CONSTRAINT DESCRIPTION (do not include this in the CREATE…
A: SQL Command to add validation in CTYPE attribute of the table CUSTOMERS is: Alter Table Customers…
Q: nt that
A: The explicit join syntax makes use of two keywords, ON and JOIN. ON keyword is used to specify the…
Q: Write a row-level trigger that executes before updating a project's location in the project table.…
A: The question is to write the SQL query for the given problem.
Q: select LNAME, FNAME, SALARY from employee where SALARY > some (select SALARY from employee where DNO…
A: Please find the query below:
Q: Display all customers regardless of orders and also display orders for each customer.
A: Query to display all the customers that have placed an order and those that have not placed the…
Q: Write a SQL statement that will display the product ID, product name, and category only products…
A: In Step 2, an SQL statement is given that will display the product id, product name, and category…
Q: Which line of the SELECT statement is used to restrict groups displayed in the query results?…
A: Select statement The select statement is used to select data from a database. The data returned is…
Q: Orders Columns: order_id (int), order_no (char(30)), customer_name (char(100)) Order_Line Columns:…
A: Given that two tables data . Orders tabel contains : order_id(int), order_no(char(30)),…
Q: Below is part of a Student database. The primary keys are highlighted in bold. Student (studNo,…
A: Given to write a PL/SQL PROCEDURE that will list the project names given the course ID. The below…
Q: Which clause of a SQL Select statement is required if we want to display aggregate data by category…
A: Answer: 5) GROUP BY
Q: Which of the following is suitable for the blanks respectively? PreparedStatement sql =…
A: PreparedStatement sql = connection.prepareStatement(select * from personel); ResultSet result=sql.…
Q: keys are noted in the superscript. Customer = {customerlID, firstName, lastName, income, birthDate}…
A: All tables below.
Q: Generate a listing of all purchases made by the customers, using the output shown in the following…
A: SQL query The SQL code for sorting the results by invoice number, product description and customer…
Q: What does the funnel symbol that appears next to a field’s name in the Query Builder dialog box…
A: Query builder: The query builder is used to construct the SQL (Structured Query Language)…
Q: C. Refunds_697 REFUNDID ORDERID REFUNDDATE REFUNDAMOUNT 1 1 02-SEP-16 5 2 18-SEP-16 18 Refunds…
A: Given:
Q: Select fname from employee where instr(fname,'a')=0; this query displays: a. The names that has a…
A: Since we can answer only up to 1 question. So we'll answer the first question. Please resubmit the…
Q: Q4: Customer has made an order from spare parts company where an order form shown below posted to…
A: Hello student I am giving this solution as per my best of knowledge :-
Q: Display CustomerName and Status as 'Q2 for every customer who was born during the 2nd quarter of…
A: The given problem is related to database SQL query. The problem has provided the msCustomer table…
Q: Q4: Customer has made an order from spare parts company where an order form shown below posted to…
A: Hello student I am giving this solution as per my best of knowledge :-
Q: Which of the following calculates a 10% commission on the values in the Sales field and then stores…
A: The below statement calculates a 10% commission on the values in the Sales field andthen stores the…
Q: Display how many number of year from the date_of _visit as on System Date Vrite a SQL Command to…
A: 1- As per the assignment requirements, first, I have created a table as a customer and that table…
Q: SELECT DISTINCT empname FROM employee; In what order are the empnames displayed?
A: We are given a SQL query and we are going to find out the output of it. We are using DISTINCT…
Q: Q2:Write a row-level trigger that executes before updating a project’s location in the project…
A: The question is to write the SQL query for the given problem.
Q: Which customers have not placed any orders for computer desks?
A: JOINS in sql: A JOIN clause in sql is used to combine or join rows from two or more tables, that…
Q: Employee Search Create an application that connects to the Personnel.mdf database that you created…
A: • To create new project, click on file menu then click on New project and select C# from templates…
Q: Add validation on CTYPE column in CUSTOMERS table. It must accept either ‘New’ or ‘Old’ only
A: SQL Command to add validation in CTYPE attribute of the table CUSTOMERS is: ALTER TABLE CUSTOMERS…
Q: Replace 456 with your last 3 digits in your student number The procedure must have: an input…
A: Code is given below. drop table VECHICLERENT; CREATE TABLE VECHICLERENT ( VEHICLE_ID…
Q: Write SQL expression to list flight_no and airline_code of all the bookings for customers with first…
A: The given problem is related to SQL Database queries creation where the database is given and the…
Q: Use the following table to answer the questions below: Table name: Customers Column Name Role Data…
A: As per our guidelines, we are supposed to answer only 1st 3 parts. Kindly repost the remaining…
Q: What kind of situation necessitates the use of a subquery?
A: A subquery is used to return data that will be used in the main query as a condition to further…
Q: CREATE TABLE Employee( firstName char(30) , lastName char(30) , hireDate date ,empNo int ,…
A: The table "Employee" with fields "firstName, "lastName", "date", "empNo", empInitial, and "years" is…
Q: CREATE TABLE ITEMS (ID NUMBER(5), Prod_Name VARCHAR2(30) UNIQUE, Price NUMBER(5) (PRICE >0)); Find…
A: Use PRIMARY KEY and CHECK constraints for unique and validations CREATE TABLE ITEMS( PROD_ID…
Q: Which of the following statements is valid? (refer to the tables in the JustLee Books database.)a.…
A: Valid statement The SELECT statement returns a result set of records from one or more tables. It…
Q: Create the ROOMS table using the specification below: Table Name: ROOMS Field Name/ Data Type Size…
A: First, create table clients to give reference to the rooms table. In the client table, CID is the…
Q: Use the following table to answer the questions below: Table name: Customers Column Name Role Data…
A: Create a table Customers with the below query: create table Customers(customerID char(5) PRIMARY…
Q: Which of the following SELECT statements lists the highest retail price of all books in the Family…
A: SELECT statement The SELECT statement returns a result set of records from one or more tables. It…
Q: Go to the Scores by Date worksheet. In cell A3, insert another PivotTable based on the Calls table.…
A: Here is the solution to the abov problem :- Step 1 Select the table from A4:J143 Step 2 Insert…
Q: Orderltem OrderID item quantity 1 Fahita Menu 1 Pepsi Item type price 1 Shawarma Coca Drink 1.5 1…
A: Below is the answer of both questions. I hope this will be helpful for.
Q: Which SELECT statement retrieves the customer name for those that have a salesperson number of 137?…
A: Here, we have to choose the options for the above problem. Given , customer table with the fields…
Q: Please write a query statement from emp table to display employee's empno, ename, length of ename,…
A: Given that Please write a query statement from emp table to display employee's empno, ename, length…
Q: SQL Statement (case sensitive, must reflect what was used in SQL Browser to execute the prompt):…
A: Since the reference tables are missing, we are putting values assuming the table names.
What are the name and address of the customer who placed order number
1008?
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- INPUT TABLE You're given a orders table and the columns in the orders table are shown below: Orders Order_Id INT Type VARCHAR(10) Red_Shipping_ Days INT Scheduled_Shipping_Days INT Customer_Id INT Order _city VARCHAR(20) Order_Date DATE Order_Region VARCHAR(15) Order_State VARCHAR(20) Order _Status VARCHAR(20) Shipping_Mode VARCHAR(20) QUERY Calculate count of all the orders. Where Order_ State is Maharashtra Note - Use the alias of oc for count of orders Group the results by Type Order them by oc in ascending order. OUTPUT COLUMNS oc, TypeAssume the PRODUCT table contains multiple rows. The following code would include: SELECT P_DESCRIPT, P_PRICE, AVG(P_PRICE) AS AVGPRICE FROM PRODUCT WHERE P_PRICE > AVGPRICE; Group of answer choices A) An error message. B) Show all whose standard price is no less than the average price of all products. C) Show all whose standard price is no less than the average price of some products. D) Show all whose standard price is higher than the average price of all products.Book Sales Database: Which of the following lists all books published by the publisher named Printing Is Us? SELECT title FROM books NATURAL JOIN publisher WHERE name = 'PRINTING IS US'; SELECT title FROM books, publisher WHERE pubname =1; SELECT title FROM books, publisher WHERE pubname = 1; none of above
- Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, you can group the result set by the EmailAddress and OrderID columns. In addition, you must calculate the order total from the columns in the OrderItems table. Write a second SELECT statement that uses the first SELECT statement in its FROM clause. The main query should return two columns: the customer�s email address and the largest order for that customer. To do this, you can group the result set by the EmailAddress column.The command DESC DEPARTMENTS shows the following information Name Null? Туре DEPARTMENT_ID NOT NULL NUMBER (4) DEPARTMENT NAME NOT NULL VARCHAR2 (30) MANAGER ID NUMBER (6) LOCATION_ID NUMBER (4) Which of the following is correct This table has a primary key. This table has a foreign key. This table has both primary and foreign keys. This table has neither primary nor foreign keys. Not enough information to answer. 10 pointsWrite a SELECT statement that uses the ranking functions to rank products by the total quantity sold. Return these columns: The product_name column from the Products table A column named total_quantity that shows the sum of the quantity for each product in the Order_Items table A column named rank that uses the RANK function to rank the total quantity in descending sequence A column named dense_rank that uses the DENSE_RANK function to rank the total quantity in descending sequence
- Write a SELECT statement that returns three columns using the explicit join syntax: CompanyName From the Customers Table ShipAddress From the Orders Table CompanyName AS Shipping Company From the Shippers Table Sort the result set by Shipping CompanyUse the following table to answer the questions below: Table name: Customers Column Name Role Data Type Length Constraint customerID stores the ID of a Char 5 Primary key customer custFName stores the first name of a Varchar2 35 Cannot be null customer custLName Stores the last name of a Varchar2 35 Cannot be null customer custGender Store the gender of a Char 1 It should be M customer or 'F' custDOB Stores the date of birth of Date a customer custIncome Store the income of a Number customer a. Write in SQL a command that creates the table Customers according to the above description b. Write in SQL a statement that adds a new column named accountID of type Char(8). This column should be defined as a foreign key that relates the table Customers to the table Account c. Write in SQL a command that deletes the customers whose date of birth is after 22-Dec-1990 d. Write a SQL query that displays the number of customers who born on the 16th day of a month e. Write in SQL a query that…Use the following table to answer the questions below: Table name: Customers Column Name Role Data Type Length Constraint customerID stores the ID of a Char 5 Primary key customer custFName stores the first name of a Varchar2 35 Cannot be null customer custLName Stores the last name of a Varchar2 35 Cannot be null customer custGender Store the gender of a Char 1 It should be M customer or 'F' custDOB Stores the date of birth of Date a customer custIncome Store the income of a Number customer d. Write a SQL query that displays the number of customers who born on the 16th day of a month e. Write in SQL a query that displays the ids of the customers who have the highest income f. Create a view named 'customerDetails' to hold all the details of customers whose first names start with 'S' and their incomes are between 500 and 1000 Omani Rials
- Write a SELECT statement that uses a correlated subquery to return one row per customer, representing the customer's oldest order (the one with the earliest date). Each row should include these five columns: first_name last_name order_id order_date total quantity Include only orders with a total order quantity greater than 2. Subject: MySQLSome rows of a User table are shown below: User ucode name phone scode 7 Alex 847 - 3902 UX 8 Tony 203 - 3902 PX 9 Charles BD 11 Mary 877 - 3333 BD Which of the following queries retrieves the rows where there is no phone? a. SELECT * FROM User WHERE phone IS NULL b. SELECT * FROM User WHERE phone = “ ” c. SELECT * FROM User WHERE phone NOT IS NULL d. SELECT * FROM User WHERE phone > 0DECLARE v_ave_sal NUMBER(10,2); v_deptno NUMBER NOT NULL := 60; BEGIN SELECT AVERAGE(salary) INTO v_ave_sal FROM emp WHERE deptid = v_deptno; DBMS_OUTPUT.PUT_LINE('Dep #60 Average Salary: ' || v_ave_sal); END; a. Dep #60 Average Salary:500 b. Dep #60 Average Salary:400 c. Dep #60 Average Salary:1000 d. Dep #60 Average Salary:600