Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
- In the following PL/SQL block, determine the values and data types for each of the following cases:
DECLARE
v_customer VARCHAR2(50) := 'Womansport2';
v_credit_rating VARCHAR2(50) := 'VERY_GOOD';
BEGIN
DECLARE
v_customer NUMBER(7) := 201;
v_nmae VARCHAR2(25) := 'Unisports';
BEGIN
V_credit_rating := 'GOOD';
END;
END;
- The value of v customer in the nested block is:
- The value ofv name in the nested block is:
- The value of v _credit_rating in the nested block is:
- The value of v customer in the main block is:
- The value of v name in the main block is:
- The value of v_credit_rating in the main block is:
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Use the following table to find the OUTPUT of the following SQL queries: Table Name: Patients MEDICAL_NO FIRST NAME SUR_NAME DOB GENDER PHONE FAX BLOOD TYPE WEIGHT SMOKER PCR TEST 1001 Said Alalawi 12-Jun-2001 Male 98877445 22114454 A 68 NO Negative 1002 Othman Mualla 20-Apr-2000 Male B 78 YES Positive 1003 Sameera Bader 19-Oct-2005 Female 25541122 52 NO Positive 1004 Fahad Alhinai 24-Feb-2004 Male Negative 91122544 AB 66 YES 1005 Shamsa Alfahdi 15-Sep-2002 Female 35 NO Negative SELECT NULLIF(phone, fax) FROM patients WHERE medical no = 1001; Answer:arrow_forwardT-SQL procedure for MICROSOFT SQL SERVER A: obtain the name and credit limit of the customer whose number currently is stored in I_CUSTOMER_NUM. Place these values in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. Output the content of I_CUSTOMER_NAME and I_CREDIT_LIMIT. HINT use cursor instructions as a template for the problem. Instructions goes as follows CREATE PROCEDURE usp_DISP_REP_CUST @repnum char(2) AS DECLARE@custnum char(3) DECLARE@custname char(35) DECLARE mycursor CURSOR READ_ONLY FOR SELECT CUSTOMER_NUM, CUSTOMER_NAME FROM CUSTOMER WHERE REP_NUM = @repnum OPEN mycursor FETCH NEXT FROM mycursor INTO @custnum, @custname WHILE @@FETCH_STATUS=0 BEGIN PRINT@custnum+' '+@custname FETCH NEXT FROM mycursor INTO @custnum, @custname END CLOSE mycursor DEALLOCATE mycursorarrow_forwardpls help me SQL Instructions: Answers ALL the questions. This test contributes 5% to your coursework. Use the following Table to write the queries. Emp_Infor Table EmpID EmpFname EmpLname Department Salary Gender Address DOB Kuantan 01/12/1977 M 1 Mohd Ali HR 2000 3500 Ipoh 02/05/1975 F 5000 Kuala Lumpur 01/01/1984 M 1800 Georgetown 02/05/1995 Kangar 03/07/1998 8000 2 3 4 5 Azizah Chen Ananthi Manjit Suliman Kang Kulkarni Sidhu Admin Account HR Admin 1. Write the query to display all the records in the Emp_Infor table. FM 2. Write a query to display the number of employees working in the department 'HR'. 3. Write a query to display the EmpFname from the EMP_Infor table and use the ALIAS name as Staff Name..arrow_forward
- MICROSOFT SQL SERVER ONLY CURSOR T-SQL Obtain the name and credit limit of the customer whose number currently is stored in I_CUSTOMER_NUM. Place these values in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. Output the content of I_CUSTOMER_NAME and I_CREDIT_LIMIT.arrow_forwardUse the following table to find the OUTPUT of the following SQL queries: Table Name: Patients MEDICAL NO FIRST NAME SUR NAME DOB GENDER BLOOD TYPE PCR TEST PHONE FAX WEIGHT SMOKER 1001 Said Alalawi 12-Jun-2001 Male 98877445 22114454 68 NO Negative 1002 Othman Mualla 20-Apr-2000 Male 78 YES Positive 1003 Sameera Bader 19-Oct-2005 Female 25541122 52 NO Positive 1004 Fahad Alhinal 24-Feb-2004 Male 91122544 AB 66 YES Negative 1005 Shamsa Alfahdi 15-Sep-2002 Female 35 NO Negative SELECT COALESCE (phone, fax, 9999) FROM patients WHERE blood_type='A'; Answer:arrow_forwardUse the following table to find the OUTPUT of the following SQL queries: Table Name: Patients MEDICAL_NO FIRST_NAME SUR_NAME DOB GENDER PHONE FAX BLOOD TYPE WEIGHT SMOKER PCR TEST 1001 Said Alalawi 12-Jun-2001 Male 98877445 22114454 A 68 NO Negative 1002 Othman Mualla 20-Apr-2000 Male B 78 YES Positive 1003 Sameera Bader 19-Oct-2005 Female 25541122 52 NO Positive 1004 Fahad Alhinai 24-Feb-2004 Male 91122544 AB Negative 66 YES 1005 Shamsa Alfahdi 15-Sep-2002 Female B 35 NO Negative SELECT INSTR(first name, 'h') FROM patients WHERE medical no = 1002; Answer:arrow_forward
- Use the following table to find the OUTPUT of the following SQL queries: Table Name: Patients MEDICAL_NO FIRST_NAME SUR_NAME DOB GENDER PHONE FAX BLOOD_TYPE WEIGHT SMOKER PCR_TEST 1001 Said Alalawi 12-Jun-2001 Male 98877445 22114454 A. 68 NO Negative 1002 Othman Mualla 20-Apr-2000 Male B 78 YES Positive 1003 Sameera Bader 19-Oct-2005 Female 25541122 52 NO Positive 1004 Fahad Alhinai 24-Feb-2004 Male 91122544 AB 66 YES Negative 1005 Shamsa Alfahdi 15-Sep-2002 Female B 35 NO Negative SELECT CONCAT (SUBSTR(first_name, 1,2), weight) FROM patients WHERE blood_type= 'B' and weight > 70; Answer:arrow_forwardQuick Answer pleasearrow_forwardTable: Employee | Column Name| Type| | id | int | | int | | salary +- -------+ id is the primary key column for this table. Each row of this table contains information about the salary of an employee. Write an SQL query to report the second highest salary from the Employee table. If there is no second highest salary, the query should report null.arrow_forward
- Need help writing SQL queries for sample data basearrow_forwardISBN Title Author 12345678 The Hobbit J.R.R. Tolkien 45678912 DaVinci Code Dan Brown Your student ID DBS311 Your Name use the following statement to Write the PL/SQL code to create a procedure that accepts a product price and increases it by 10%arrow_forwardWrite a query in SQL to display all the data of customers, in Table customers, that live in New York or California SELECT city FROM customers WHERE city = 'New York' OR city = 'California' SELECT * FROM customers WHERE city = 'New York' AND city = 'California' SELECT * FROM customers WHERE city = 'New York' OR city = 'California' SELECT ALL FROM customers WHERE city = 'New York' OR city = 'California' %3Darrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education