Write a SQL query that displays the number of customers who born on the 16th day of a month . Write in SQL a query that displays the ids of the customers who have the highest income . 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 .
Q: Create an ERD in SQL with primary keys using only the following data: ReservationID HotelID…
A: Let's first talk about what is ER diagram: An entity–relationship model describes interrelated…
Q: table name: Accounts columns: account_num char(9) which is the primary key name varchar (20)…
A: SQL: CREATE TABLE Accounts ( account_num char(9) PRIMARY KEY, namevarchar(20), balance double );…
Q: 5. Use XAMPP Control Panel (My SQL) to answer the following questions. Write SQL queries statement…
A: CODE:- Creating table PROPERTY and inserting values in it:- -- create table PROPERTY CREATE…
Q: 2) Create in PL/SQL a stored procedure called 'Del Details' to delete the record of orderedProduct…
A: 2) The SQL query is given below: CREATE PROCEDURE [dbo].[Del Details] -- Add the parameters for the…
Q: Create a sql procedure which takes part of a book title as input. When the procedure is called, it…
A: The database is the collection of data and information. SQL is the Structured Query language that is…
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: The relational schema shown below is part of a hospital database. The primary and foreign keys are…
A: Here we will use to_char() function which converts date format into string and then we will apply…
Q: 4) Write a PL / SQL block to display the details of clients who have made a loan with an amount more…
A: Please find answer to the above question below:
Q: Database course: Write SQL queries to do the following A. List names of IT students.…
A: The SQL queries are given in step 2.
Q: The relational schema shown below is part of a hospital database. The primary and foreign keys are…
A: A database is a collection and assembly of information that is organized in a way that can easily be…
Q: 1. Create a query to display the name and salary of employees earning more than $2850. Save your SQL…
A: SQL is a computer language stands for Structured Query language.Which is used for operating…
Q: Our salesperson made a mistake when placing the order with Id = 830. Several incorrect products were…
A: Ans:) Here we have given a list of productId and productName and we have to delete the orders from…
Q: Student (snum: integer, sname: string, major: string, level: string, age: integer) Class (cname:…
A: CREATE TABLE student( snum INT, sname VARCHAR(10),…
Q: 2) Create in PL/SQL a stored procedure called 'Del Details' to delete the record of orderedProduct…
A: 1) Below is the stored procedure to Delete the details from OrderedPRoduct. we use the create or…
Q: I am trying ro create this java program , i have the table in my tatabase . I am using postgresql ii…
A: Program Instructions:Add the postgresql jar file in your project library.Create a database and a…
Q: mand that deletes the customers whose date of birth is after 22-Dec-1990. d. Write a SQL query…
A: Database course: a. Write in SQL a command that creates the table Customers according to the above…
Q: Write three functions in SQL which does the following: The first function should take an integer…
A: In MYSQL function Syntax to convert number from one base to another follows:- CONV(<num to…
Q: Before using SQL statements, which objects should be checked if they are null or not and throw…
A: Given that Before using SQL statement which objects should be checked if they are null or not and…
Q: Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle Live SQL. 1. Write an anonymous…
A: SOLUTION: Below schema is used for this exercise : CREATE TABLE "DOCTOR" ( "DOC_ID" NUMBER,…
Q: Write inner join SQL query that find those employees who deals with customers of their cities.…
A:
Q: DEFAULT STORAGE (INITIAL 500K NEXT 200K MAXEXTENTS 20 PCTINCREASE 15) Excel's Future Value financial…
A: The EXCEL financial function FV (rate, nper, pmt, [pv], [type]) can be used to calculate extent size…
Q: onal Schema: (keys undenined). Student (sid: intyer, snume Stniny, major ístriny, age:inteyer)…
A: Student (Sid: integer, Sname: string, major: string, age: integer) Takes (Sid, Cid) Class (Cid:…
Q: Create a function to calculate a shopper’s total spending, excluding shipping and tax amount, with…
A: Given requirement, Create a function to calculate a shopper’s total spending, excluding shipping and…
Q: 5. Use XAMPP Control Panel (My SQL) to answer the following questions. Write SQL queries statement…
A: Query:- SELECT location, COUNT(location)FROM propertyGROUP BY locationHAVING COUNT(location)
Q: Write a script to create a PL/SQL procedure called findSal that displays the doctor’s salary and…
A: A procedure is created with the CREATE OR REPLACE PROCEDURE statement. The simplified syntax for the…
Q: develop a PL/SQL block that selects the maximum department ID in the departments table and stores it…
A: PL/SQL(Procedural Language / Structured Query Language) is the embedded procedural language and the…
Q: In the preceding PL/SQL block, determine the values and data types for each of the following cases.…
A: PL/SQL block, the values and data types for each of the following cases are: a) The value of…
Q: Where cid is the primary key. cname and occupation do not accept null values. Payment_mode accepts…
A: according to our policy we are allowed to solve only 3 subpart please upload other questions again.…
Q: Assignment : PL/SQL Practice Note: PL/SQL can be executed in SQL*Plus or SQL Developer or Oracle…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: List doctor’s details where speciality is either Dermatology or Neurology. (Use INoperator). List…
A: The given requirement is to be solved in database SQL where the DOCTOR table is already created with…
Q: Write SQL queries for the following.Display details of those male patients whose age is 25 or 36.…
A: Structured Query Language is abbreviated as SQL or also pronounced as See-Qwell. It is developed for…
Q: Suppose you want to get all student names that start with letter ‘M’ and end on ‘D’. Write a regular…
A: Following is the query and code and output as per your requirement. I just create a table student…
Q: A_Create in PL/SQL a stored procedure called 'Del_Details' to delete the record of orderedProduct…
A: Answer: 1). create table Product(productNO char(10),label varchar(30),price Decimal(9,2),QStock…
Q: . Write SQL retrieval commands for each of the following queries: a. Display the course ID and…
A: Actually, SQL stands for Structured Query
Q: Write a SQL command please Write a query that displays the last name in uppercase letters and…
A: This query can be solved using different SQL functions. Here is the answer with explanation.
Q: The relational schema shown below is part of a hospital database. The primary and foreign keys are…
A: Oracle:- Oracle database is developed by Oracle corporations and is used as a system to collect data…
Q: .use sql to Write a SQL query from the following data (as shown below)to display the number of…
A: 1. Display the number of the customer with a total amount over all orders average SELECT…
Q: Assume that you have a table Anc that contains two columns: employee name e namen and the salary…
A: Revoke syntax:- To increase sal column by 15% , use sal+sal*15/100 revoke permissionName on…
Q: Create a MySQL table named 'prime_test' that contains two columns. The first column is an integer…
A: Syntax for creating table: CREATE TABLE table_name ( column1 datatype [ NULL | NOT NULL ],…
Q: The given SQL creates a Movie table and inserts some movies. The SELECT statement selects all…
A: The question is to write Modified SQL statement for the given queries.
Q: write Sql statements to write query for the given table .. the query statements are. Display first…
A: Structured Query Language is abbreviated as SQL or also pronounced as See-Qwell. It is developed for…
Q: Write SQL statements for given questions in order to get familiar to basic SQL data manipulation…
A: according to our policy we are allowed to solve only three questions.please post remaining questions…
Q: 5. Use XAMPP Control Panel (My SQL) to answer the following questions. Write SQL queries statement…
A: Here we have given queries for creating tables and assigned primary and foreign keys. You can find…
Q: SECTION - A Database Object design Column Name Data Type Constraint (Column Level) DoctorID…
A: Creating Database: use Database1; CREATE TABLE Doctors(DoctorID int not null UNIQUE,DoctorName…
Q: Given the following relation: Student (StudentID, studentName, StudentAddress, MobileNumber) Write a…
A: The %ROWTYPE attribute provides a record type,which can hold a list of the table(or view) of same…
Q: Draw the ERD _that is implemented by the following SQL code: CREATE TABLE PROJ_USER USER_ID NUMBER…
A: ER diagram: The ER diagram for the given SQL code:
Q: Instructor(Instructor_Id, Instructor_Name, specialization, Address,#Department_Id)…
A: Given: Instructor(Instructor_Id, Instructor_Name, specialization,…
Q: e PL/SQL statements that correct each of the errors that appear in the given PL/SQL program.…
A: QUESTION 15 Fill the blanks with the suitable PL/SQL statements that correct each of the errors…
- Write a SQL query that displays the number of customers who born on the 16th day of a month .
- Write in SQL a query that displays the ids of the customers who have the highest income .
- 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 .
my SQL and orcale language
Step by step
Solved in 2 steps
- Perform the following tasks: a. Create an index named ITEM_INDEX1 on the ITEM_NUM column in the ORDER_LINEtable. b. Create an index named ITEM_INDEX2 on the CATEGORY column in the ITEMtable. c. Create an index named ITEM_INDEX3 on the CATEGORY and STOREHOUSE columnsin the ITEM table. d. Create an index named ITEM_INDEX4 on the CATEGORY and STOREHOUSEcolumns in the ITEM table. List categories in descending order.2- selects the order line items (orderNumber, orderlinenumber) fromthe “orderdetails” table. Also, display the subtotal (quantityOrdered * priceEach) for eachline item and sorts the result set based on the subtotal descending .3- Display unique last names from employees table ordered by last name.4- Display customerNumber, customerName and creditLimit for getting the top five customerswho have the highest creditLimit.5- Find customer Name, customer country, sales representative employee number fromcustomers who do not have a sales representative.6- For each order status, display status and count of orders have this status.7- For Each order number in order details table, Display order number, sum of quantityordered (itemsCount) and sum of (priceEach * quantityOrdered) as total. With condition“total” greater than 1000.8- Display product code, product name and text description for product.9- Find customer number, customer name, order status and order number, for customerwith their orders…List the order number and order date for every order that was placed by Mary Nelson and that contains an order line for an iron. Use an INTERSECT operator. table name is:ORDER_LINEORLN_ORDER_NUMBER ORLN_PART_NUMBER ORLN_NUMBER_ORDERED ORLN_QUOTED_PRICE tablename is ORDER_TABLE ORDR_ORDER_NUMBER ORDR_ORDER_DATE ORDR_CUSTOMER_NUMBER tablename is CUSTOMER CUST_NUMBERCUST_LAST CUST_FIRST CUST_STREET CUST_CITY CUST_STATE CUST_ZIP_CODE CUST_BALANCE CUST_CREDIT_LIMIT CUST_SALES_REP_NUM tablename is PART PART_NUMBER PART_DESCRIPTION UNITS_ON_HAND ITEM_CLASS WAREHOUSE UNIT_PRICE tablename is SALES_REP SLSR_PKSLSR_LAST SLSR_FIRST SLSR_STREET SLSR_CITY SLSR_STATE SLSR_ZIP_CODE SLSR_TOTAL_COMMISSION SLSR_COMMISSION_RATE SELECT ORDR_ORDER_NUMBER, ORDR_ORDER_DATEFROM ORDER_TABLEWHERE ORDR_ORDER_NUMBER IN (SELECT ORLN_ORDER_NUMBERFROM ORDER_LINEWHERE ORLN_PART_NUMBER IN (SELECT PART_NUMBERFROM PARTWHERE…
- Based on the following table, please find the customers who locate in the same state. sales.customers *customer_id first_name last_name phone email street city state zip_code . Based on the following table, please display the staff and their corresponding manager in the same store. Please display staff’s full name in one column, manager’s full name in another column, and store_id. sales.staffs *staff_id first_name last_name email phone active store_id manager_idUse the following table to answer the questions below: Table name: Customers Column Name Role Data Type Length Constraint customerID stores the ID of a customer Char 5 Primary key custFName stores the first name of a customer Varchar2 35 Cannot be null custLName Stores the last name of a customer Varchar2 35 Cannot be null custGender Store the gender of a customer Char 1 It should be ‘M’ or ‘F’ custDOB Stores the date of birth of a customer Date custIncome Store the income of a customer Number 4 Write in SQL a command that creates the table Customers according to the above description (2 marks). 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 (1.5 marks). Write in SQL a command that deletes the customers whose date of birth is after 22-Dec-1990 (1.5 Marks).…Topic 1: The 5 JoinsRun each of the following statements in APEX. Explain the differences in results.SELECTE.Last_Name,J.Job_TitleFROM HOL_EMPLOYEES EINNER JOIN HOL_JOBS J ON E.Job_ID=J.Job_ID;SELECTE.Last_Name,J.Job_TitleFROM HOL_EMPLOYEES ELEFT OUTER JOIN HOL_JOBS J ON E.Job_ID=J.Job_ID;SELECTE.Last_Name,J.Job_TitleFROM HOL_EMPLOYEES ERIGHT OUTER JOIN HOL_JOBS J ON E.Job_ID=J.Job_ID;SELECTE.Last_Name,J.Job_TitleFROM HOL_EMPLOYEES EFULL OUTER JOIN HOL_JOBS J ON E.Job_ID=J.Job_ID;SELECTE.Last_Name,J.Job_TitleFROM HOL_EMPLOYEES ECROSS JOIN HOL_JOBS J; DBMS 130 Worksheet: JOINS and SET Operations2Topic 2: Write an SQL cartesian product between Regions and Countries.Copy your APEX here.How many rows are in the result set?How could you have calculated the number of rows in the result set BEFORE running yourquery?Topic 3: Briefly explain how set operators handle NULL values.Run the following 3 SQL queries in APEX which use set operators over these…
- 7-Display last name of employees whose manager is KING.8-Display last name, salary and job title of all employees who earns more than the lowest salary. (Employees andJobs)9-Display all employees including King, who has no manager. Order the results by the employee number.10-Display the name and hire date of any employee hired after employee DavisBelow is part of a Student database. The primary keys are highlighted in bold. Student (studNo, studName, address, mobileNo) Registration (studNo, courseNo, regDate, semester, session) Course (courseNo, courseName, creditHour, level) Project (projNo, projName, courseNo) Assignment (projectNo, studNo, startDate, dueDate, hoursSpent) INSERT INTO STUDENT VALUES (175,'Ali Ahmad','10 jalan Bukit Bintang','019-123');INSERT INTO STUDENT VALUES (176,'Hanna Syamil','32A Jalan Danau Kota','012-234');INSERT INTO STUDENT VALUES (182,'Ibnu Hassan','19 Jalan Kota Raya','011-345');INSERT INTO STUDENT VALUES (183,'Aliya Hamidi','233 Jalan Matahari ','013-456');INSERT INTO STUDENT VALUES (184,'Kayla Adila','98 Jalan Enau','018-567'); INSERT INTO REGISTRATION VALUES (175,1100,'5/SEP/19',1,'2019/2020');INSERT INTO REGISTRATION VALUES (175,1103,'3/SEP/19',2,'2019/2020');INSERT INTO REGISTRATION VALUES (176,1103,'7/SEP/19',2,'2019/2020');INSERT INTO REGISTRATION VALUES…Using the Orders database attached write the SQL Statements for the below cases: Get all the orders placed by a specific customer. CustomerID for this customer is MAGAA. My answer here is; select * from tblOrders where CustomerID = 'MAGAA'; Show customers whose ContactTitle is not Sales Associate. Display CustomerID, CompanyName, Contact Name, and ContactTitle Show customers who bought products where the EnglishName includes the string “chocolate”. Display CustomerID, CompanyName, ProductID, ProductName, and EnglishName Show products which were bought by customers from Italy or USA. ”. Display CustomerID, CompanyName, ShipCountry, ProductID, ProductName, and EnglishName Show total price of each product in each order. Note that there is not a column named as total price. You should calculate it and create a column named as TotalPrice. Display OrderID, ProductID, ProductName, UnitPrice, Quantity, Discount, and TotalPrice Show how many products there are in each category and show the…
- Write a SQL statement that will add the below row to the Task table.TaskID Description Duration StartDate TeamMemberID4 Implementemailnotifications2Use the following table to answer the question below: Table name: Customers Column Name Role Data Type Length Constraint customerID stores the ID of a customer Char 5 Primary key custFName stores the first name of a customer Varchar2 35 Cannot be null custLName Stores the last name of a customer Varchar2 35 Cannot be null custGender Store the gender of a customer Char 1 It should be ‘M’ or ‘F’ custDOB Stores the date of birth of a customer Date custIncome Store the income of a customer Number 4 Write a SQL query that displays the number of customers who born on the 16th day of a month . Write in SQL a query that displays the ids of the customers who have the highest income . 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 .1- Display contact First name and contact Last name for customers after sorting the customersby their contact Last name in ascending order.2- selects the order line items (orderNumber, orderlinenumber) from the “orderdetails” table.Also, display the subtotal (quantityOrdered * priceEach) for each line item and sorts the resultset based on the subtotal descending .3- Display unique last names from employees table ordered by last name.4- Display customerNumber, customerName and creditLimit for getting the top five customerswho have the highest creditLimit.5- Find customer Name, customer country, sales representative employee number fromcustomers who do not have a sales representative.6- For each order status, display status and count of orders have this status.7- For Each order number in order details table, Display order number, sum of quantity ordered(itemsCount) and sum of (priceEach * quantityOrdered) as total. With condition “total”greater than 1000.8- Display product code, product…