banyan-logo

SQL,Oracle and Knowledge with Section Weightage


  • Learner (MANT004)
  • learner@maantt.com
  • : FAIL

18-Feb-2020 10:37

18-Feb-2020 10:41

4 Mins


Sectionwise score

Section Name Pass Percentage Candidate Score Status
Knowledge50%0%Fail
SQL Server 50%20%Fail
Oracle N/A0%N/A

Candidate Answer Summary

9 / 14

5 / 14


Competency Breakdown
Data Types and sql concepts
0%
Functions
0%
Joins
0%
Programming SQL
0%
SQL Basics
0%
SQL Features
100%
SQL Functions
0%
SQL Subqueries and Joins
0%
SQL Update
0%
Sub Queries
0%
Transaction Control Language
0%
View and Indexes
0%

Detailed Score
Section Name Total Questions Answered Not Answered Correct Marks Partial Marks Penalty Marks Score
Knowledge5500.000.00 0.000.00
SQL Server 53210.000.00 0.0010.00
Oracle 4130.000.00 0.000.00

1. Aggregate functions

10 seconds InCorrect

All aggregate functions ignore NULLs except for?

Distinct
Count (*)
Average()
None of the listed Options
Average()
2. SQL View

2 seconds InCorrect

When are the values in an SQL view changeable through the view itself?

I: always

II: not always, but the rules to determine modification status are simple

III: not always, and the rules to determine modification status are complicated

IV: not always, and the rules to determine modification status are DBMS-dependent

III and IV
I and II
II and III
III and I
III and I
3. Synonyms

2 seconds InCorrect

Which statement is true regarding synonyms?

Synonyms can be created for tables but not views
Synonyms are used to reference only those tables that are owned by another user
A public synonym and a private synonym can exist with the same name for the same table
The DROP SYNONYM statement removes the synonym, and the status of the table on which the synonym has been created becomes invalid
Synonyms can be created for tables but not views
4. UPDATE & INSERT

2 seconds InCorrect

An index helps speed up SELECT queries and WHERE clauses, but it slows down data input, with UPDATE and INSERT statements. State True or False.

TRUE
FALSE
FALSE
5. Rollback Segment Uses

11 seconds InCorrect

What is the main use of Rollback segment?

I: used to rollback the transaction

II: They can be used to recover the selected tables to a consistent state in case of failures.

III: They ensure that the transactions leave the uncommitted changes unnoticed.

I only

II only

III only

Both I and II

I, II and III

Both I and II

6. HR – Human Resource Management System

In this case study, the Human Resource Management System given below to track and maintain complete employee, department, and pay history details.

As an SQL developer, you are expected to write queries to analyse data, based on the given requirements and business conditions.

Following are the list of tables are already defined
1.    Address
2.    CountryRegion
3.    ContactType
4.    Contact
5.    AddressType
6.    StateProvince
7.    Shift
8.    Department
9.    Employee
10.    EmployeePayHistory
11.    EmployeeDepartmentHistory
12.    EmployeeAddress
13.    Employee_Test_Audit

Department

Column DataTypes Nullability Description 
DepartmentId small int  Not Null Primary key for Department rows.
Name nvarchar Not Null Name of the department.
GroupName nvarchar(50) Not Null Name of the group to which the department belongs.
ModifiedDate datetime Not Null Date and time the row was last updated.

 

Employee

Column Data type Nullability Description
EmployeeID int Not null Primary key for employee rows.
NationalIDNumber nvarchar(15) Not null Unique national identification number such as a social security number.
ContactID int Not null Identifies the employee in the Contact table. Foreign key to Contact.ContactID.
LoginID nvarchar(256) Not null Network logon.
ManagerID int Null Manager to whom the employee is assigned. Foreign key to Employee.EmployeeID.
Title nvarchar(50) Not null Work title such as Buyer or Sales Representative.
BirthDate datetime Not null Date of birth.
MaritalStatus nchar(1) Not null

M = Married

S = Single

Gender nchar(1) Not null

M = Male 

F = Female

HireDate datetime Not null Date on which the employee was hired.
SalariedFlag bit Not null

Job classification.

0 = Hourly, not exempt from collective bargaining.

1 = Salaried, exempt from collective bargaining.

VacationHours smallint Not null Number of available vacation hours.
SickLeaveHours smallint Not null Number of available sick leave hours.
CurrentFlag bit Not null

0 = Inactive

1 = Active

rowguid uniqueidentifier ROWGUIDCOL Not null ROWGUIDCOL number that uniquely identifies the row. Used to support a merge replication sample.
ModifiedDate datetime Not null Date and time the row was last updated.

 

Employee Address

Column Data type Nullability Description
EmployeeID int Not null Employee identification number. Foreign key to Employee.EmployeeID
AddressID int Not null Employee address identification number. Foreign key to Address.AddressID.
rowguid uniqueidentifier ROWGUIDCOL Not null ROWGUIDCOL number that uniquely identifies the row. Used to support a merge replication sample.
ModifiedDate datetime Not null Date and time the row was last updated.

 

EmployeeDepartmentHistory

Column Data type Nullability Description
EmployeeID int Not null Employee identification number. Foreign key to Employee.EmployeeID.
DepartmentID smallint Not null Department in which the employee works or worked. Foreign key to Department.DepartmentID
ShiftID tinyint Not null Work shift, such as day, evening, or night, to which the employee is assigned. Foreign key to Shift.ShiftID
EndDate datetime Null

Date the employee left the department.

NULL = Current department

StartDate datetime Not null Date the employee started work in the department.
ModifiedDate datetime Not null Date and time the row was last updated.

 

EmployeePayHistory

Column Data type Nullability Description
EmployeeID int Not null Employee identification number. Foreign key to Employee.EmployeeID.
RateChangeDate datetime Not null Date the change in pay is effective.
Rate money Not null Hourly rate of pay.
PayFrequency tinyint Not null

1 = Salary received monthly

2 = Salary received biweekly

ModifiedDate datetime Not null Date and time the row was last updated.

Note: PRIMARY KEY CLUSTERED – EmployeeID, RateChangeDate

Shift

Column Data type Nullability Description
ShiftID smallint Not null Primary key.
Name nvarchar(50) Not null Shift description.
StartTime datetime Not null Shift start time.
EndTime datetime Not null Shift end time.
ModifiedDate datetime Not null Date and time the row was last updated.

 

Address

Column Data type Nullability Description
AddressID   Not null Primary key for address rows.
AddressLine1 nvarchar(60) Not null First street-address line.
AddressLine2 nvarchar(60) Null Second street address line.
City nvarchar(30) Not null Name of the city.
StateProvinceID int Not null Unique identification number for the state or province. Foreign key to StateProvince.StateProvinceID.
PostalCode nvarchar(15) Not null Postal code for the street address.
rowguid uniqueidentifier ROWGUIDCOL Not null ROWGUIDCOL number uniquely identifying the row. Used to support a merge replication sample.
ModifiedDate datetime Not null Date and time the row was last updated.

 

AddressType

Column Data type Nullability Description
AddressTypeID int Not null Primary key for AddressType rows.
Name nvarchar(50) Not null Address type description. For example, billing, home, or shipping.
rowguid uniqueidentifier ROWGUIDCOL Not null ROWGUIDCOL number uniquely identifying the row. Used to support a merge replication sample.
ModifiedDate datetime Not null Date and time the row was last updated.

 

Contact

Column Data type Nullability  Description
ContactID int Not null Primary key for Contact rows.
NameStyle bit Not null

Indicates the column in which the family name is stored.

0 = Family name is stored in LastName and the first name is stored in FirstName.

1 = .Family name is stored in FirstName and the first name is stored in LastName.

Title nvarchar(8) Null A courtesy title. For example, Mr. or Ms.
FirstName nvarchar(50) Not null First name of the person.
MiddleName nvarchar(50) Not null First name of the person.
LastName nvarchar(50) Not null Last name of the person.
Suffix nvarchar(10) Null Surname suffix. For example, Sr. or Jr.
EmailAddress nvarchar(50) Null E-mail address for the person.
EmailPromotion int Not null

0 = Contact does not wish to receive e-mail promotions.

1 = Contact does wish to receive e-mail promotions. 

Phone nvarchar(25) Null Phone number associated with the person.
PasswordHash varchar(128) Not null Password for the e-mail account.
PasswordSalt varchar(10) Not null Random value concatenated with the password string before the password is hashed.
AdditionalContactInfo xml Null

Additional contact information about the person, such as additional phone numbers and addresses or special instructions and notes.

Data is stored in XML format. For more information, see About the Contact.AdditionalContactInfo xml Column

rowguid uniqueidentifier ROWGUIDCOL Not null ROWGUIDCOL number uniquely identifying the row. Used to support a merge replication sample.
ModifiedDate datetime Not null Date and time the row was last updated.

 

ContactType 

Column Data type Nullability Description
ContactTypeID int Not null Primary key for ContactType records.
Name nvarchar(50) Not null Contact type description.
ModifiedDate datetime Not null Date and time the row was last updated.

 

CountryRegion

Column Data type Nullability Description
CountryRegionCode nvarchar(3) Not null Primary key.Standard code identifying countries and regions.
Name nvarchar(50) Not null Country or region name.
ModifiedDate datetime Not null Date and time the row was last updated.

 

StateProvince

Column Data type Nullability Description
StateProvinceID int Not null Primary key.
StateProvinceCode nchar(3) Not null State or province code.
CountryRegionCode nvarchar(3) Not null Country or region code. Foreign key to CountryRegion.CountryRegionCode.
IsOnlyStateProvinceFlag bit Not null

0 = StateProvinceCode exists.

1 = StateProvinceCode unavailable, use CountryRegionCode.

Name nvarchar(50) Not null State or province description.
TerritoryID int Not null ID of the Adventure Works sales territory in which the state or province is located. Foreign key to SalesTerritory.SalesTerritoryID.
rowguid uniqueidentifier Not null ROWGUIDCOL number uniquely identifying the row. Used to support a merge replication sample.
ModifiedDate datetime Not null Date and time the row was last updated.
6.1 To return Employee Details

39 seconds InCorrect

Write a query  to select EmployeeName, Gender, EmployeeID, ManagerID, Title 

Design Rules : 

    1. For EmployeeName use ‘FirstName’ and 'LastName'  seperated by a single space delimiter. Order should be ‘FirstName’ 
        followed by a space, then the ‘LastName’. (Ex: FirstName LastName)
    2. Return only  employees whose FirstName starts with letter 'S' 
    3. Order the output by FirstName 

Tables: Employee, Contact

Guidelines:

  1. click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Don’t change the database structure or rename table/column names
  9. You can answer the questions in any order
  10. Please make sure that the editor will contain ONLY the solution query. Please remove other queries which you have tried
  11. The order of the columns in the sample output should match with your query
  12. Sample output rows is just for Associate's reference and this need not match the actual output

Sample Output:

EMPLOYEENAME GENDER EMPLOYEEID MANAGERID TITLE
Sandra Altamirano M 9 4 Production Technician -WC45 
Selena Alvarado M 10 4 Production Technician -WC60

Expected Query
SELECT firstname + ' ' + lastname AS 'EmployeeName',
       E.gender,  employeeid, managerid, E.title
FROM   employee AS E
       JOIN contact AS C
         ON C.contactid = E.contactid
WHERE  firstname LIKE 'S%'
ORDER  BY firstname
Submitted Query
SELECT 
       c.LastName , c.FirstName , emain.EmployeeID ,  d.name as Department, eph.Rate
FROM   Department d 
       INNER JOIN EmployeeDepartmentHistory edhmain 
         ON d.DepartmentID = edhmain.DepartmentID 
       INNER JOIN EmployeePayHistory eph 
         ON eph.EmployeeID = edhmain.EmployeeID 
       INNER JOIN Employee emain 
         ON edhmain.EmployeeID = emain.EmployeeID 
       INNER JOIN Contact c 
         ON emain.ContactID = c.ContactID
WHERE c.FirstName like 'P%';
Test Case Execution
Test Case Name Test Case Description Primary TestCase Secondary TestCase
Validate_Employee_Details To validate the employee details

6.2 Retrieve Rate count details

50 seconds InCorrect

The EmployeePayHistory will have the rate history for each year. Write a query to fetch the number of Rate change  happened for the years 1996, 1997 and 1998

Design Rules : 
    1. Display Year using column RateChangeDate in YYYY format for the years 1996, 1997 and 1998
    2. The output will have Year, No of Rates Changed
    3. Order the output by Year

Tables: EmployeePayHistory 

Guidelines:

  1. Click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Don’t change the database structure or rename table/column names
  9. You can answer the questions in any order
  10. Please make sure that the editor will contain ONLY the solution query. Please remove other queries which you have tried
  11. The order of the columns in the sample output should match with your query
  12. Sample output rows is just for Associate's reference and this need not match the actual output

Sample Output:

YEAR NO OF RATES CHANGED
1996 1
1997 4
1997 4

Expected Query
SELECT Year(RateChangeDate) AS [Year], COUNT([Rate]) AS [No of Rates Changed]
FROM [EmployeePayHistory]
WHERE Year(RateChangeDate) in ('1996','1997','1998')
GROUP BY Year(RateChangeDate)
order by Year(RateChangeDate)
Submitted Query
SELECT Year(RateChangeDate) AS [Year],
COUNT([Rate]) AS [No of Rates Changed],
COUNT(DISTINCT Rate) AS [DistinctRates]
FROM [EmployeePayHistory]
WHERE Year(RateChangeDate) in ('1996','1997','1998')
GROUP BY Year(RateChangeDate);
Test Case Execution
Test Case Name Test Case Description Primary TestCase Secondary TestCase
Validate_Retrieval_of_Rate_Details To Validate_Retrieval_of_Rate_Details

6.3 To return Employee details whose State is AB

Not Answered

Write a stored procedure  to select the details of employees like LastName, FirstName, City, StateProvinceCode 

Design Rules :
      1. Use Joins 
      2. Do not submit your query with other keywords like alter procedure or execute procedure. Only the create procedure text should be submitted

PROCEDURE NAME: GetEmployeeDetails

INPUT PARAMETERS: @StateProvinceCode

Tables: Contact, Employee, EmployeeAddress, Address, StateProvince

Guidelines: 

  1. Click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Do not change the database structure or rename table/column names
  9. You can answer the questions in any order
  10. Please make sure that the editor will contain ONLY the solution query. Please remove other queries which you have tried
  11. The order of the columns in the sample output should match with your query
  12. Sample output rows is just for Associate's reference and this need not match the actual output
  13. Do not change the Structure, Name and input parameter of the Stored Procedure
  14. Don’t attempt hardcoding but rather use appropriate keywords/functions applicable to achieve similar output
  15. Do not submit the solution code with execute statement or alter statement
  16. Do not add END/GO keywords at the end of the stored procedure


Sample Output: 

LASTNAME FIRSTNAME CITY STATEPROVINCECODE
Adina Ronald Camrose AB
Issac Michael Brooks AB
Ault John Cold Lake AB

6.4 Using Pagination concept

45 seconds Correct

Write a query to return Employeeid,Managerid,Title,Gender using Pagination concept 

Design Rules : 
    1. Ignore the first 5 rows and select the next 3  rows using pagination concept
    2. Order the resultset by EmployeeID 

Tables: Employee

Guidelines: 

  1. Click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Do not change the database structure or rename table/column names
  9. You can answer the questions in any order
  10. Please make sure that the editor will contain ONLY the solution query. Please remove other queries which you have tried
  11. The order of the columns in the sample output should match with your query
  12. Sample output rows is just for Associate's reference and this need not match the actual output

Sample Output: 

EMPLOYEEID MANAGERID TITLE GENDER
6 1 Master Scheduler M
7 4 Production Technician - WC30 F
8 2 Accounts Receivable Specialist M

Expected Query
select Employeeid,managerid,title,gender from
Employee 
order by employeeid
offset 5 rows
fetch next 3 rows only
Submitted Query
select Employeeid,managerid,title,gender from
Employee 
order by employeeid
offset 5 rows 
fetch next 3 rows only;
Test Case Execution
Test Case Name Test Case Description Primary TestCase Secondary TestCase
Validate_Pagination_Concept Validate_Pagination_Concept

6.5 Using Ranking Statements

3 seconds Not Answered

Rate incrementation for each ModifiedYear needs to be captured
Write a query to select ModifiedYear,  Rate and RateRanking (Highest rate to be ranked 1 and so on) 

Design Rules : 
    1. Get Modified Year from the column ModifiedDate and use alias name 'ModifiedYear'
    2. For RateRanking use ranking statements to Rank the Rates (Highest Rate to be ranked 1 and so on) for each Modified Year. Use alias name 'RateRanking'
    3. Modified Year greater than 2000 only
    4. Order the output by ModifiedDate 
    5. Refer the sample output for your reference

Tables: 
    EmployeePayHistory 

Guidelines:

  1. Click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Do not change the database structure or rename table/column names
  9. You can answer the questions in any order
  10. Please make sure that the editor will contain ONLY the solution query. Please remove other queries which you have tried
  11. The order of the columns in the sample output should match with your query
  12. Sample output rows is just for Associate's reference and this need not match the actual output

Sample Output: 

MODIFIEDYEAR RATE RATERANKING
2002 40.8462     1
2002 29.8462 2
2002 22.00 3
2004 13.4615 1
2004 12.699 2
2004 4.00 3

7. Order Management System

The order management system is a software system used in a number of industries for order entry and processing.

The below order management system portal receives and processes orders from various mechanical related industries which deals with spare parts for automotive industry.

Various reports and data needs to be mined based on the orders placed. As an oracle solution consultant, you have been provided with requirements by the company directors.

The database structure is below.

Table Name Description
T_STOCK_DETAILS Contains list of stock items, price and current availability
T_CUSTOMER Contains personal details of the customer
T_ORDER_PLACEMENT Contains details of order placed by a customer such as order date, shipment date and address etc.
T_ORDER_DETAILS

Contains item level details for each order 

T_LOG_ERR Log table created for logging during the execution of the procedures

 

Table Description Below:

T_CUSTOMER Table which stores the Customer Information 

CUST_ID  

  Id to identify the Customer

CUST_NAME

 Name of the Customer

CUST_ADDRESS

Address  of the Customer

CUST_CITY 

 City of the Customer

CUST_STATE 

State Code of the Customer

CUST_ZIP_CODE

 Zip Code of the Customer

CUST_MAIL

   Email-ID for Customer

CUST_PHONE

 Contact Number of the Customer

 

T_ORDER_PLACEMENT Table which stores the Customer order

ORDER_ID

Id to identify order of the Customer

CUST_ID

Id to identify the Customer  ( References T_CUSTOMER)

ORDER_DATE

 Date of the order placement

SHIPMENT_DATE 

Delivery date of the Order

SHIP_ADDRESS

Delivery Address Line  of the Order

SHIP_CITY

Delivery City of the Order

SHIP_STATE

 Delivery State of the Order

SHIP_ZIP_CODE

Delivery Zip code of the Order

SHIPMENT_STATUS

Shipment Status of the Order

 

T_ORDER_DETAILS Table which stores the Customer Order Details 

ITEM_ID

 Sequential Id to each Order Item

ORDER_ID

Id to identify order  ( References T_ORDER_PLACEMENT)

STOCK_ID

Id to identify the Stock item (References T_STOCK_DETAILS)

QUANTITY

Quantity of the order item

DISCOUNT_PERCENTAGE 

Discount for the order item

TOTAL_COST

Cost of the item after detecting the Discount

 

T_STOCK_DETAILS Table which stores the Stock item Details

 STOCK_ID

 Id to identify Stock item of the order

 STOCK_NAME   

 Name of the stock item

 PRICE

 Cost of the each item

STOCK_BALANCE_QTY

 Remanining stock balance quantity

 

T_LOG_ERR Table which stores Error Details

MESSAGE

Error message along with Error code during Exceptions

LOG_DATE

Sysdate

7.1 To returns the orders details

38 seconds InCorrect

Write a query that returns the orders which was shipped with minimum duration from the date of the order placed. 

 

Design rules:

  1. The output must contain the below columns ORDER_ID, MINIMUM_DURATION_IN_DAYS 
  2. The column MINIMUM_DURATION_IN_DAYS can be acheived by calculating the number of days between the date of order and shipment date and it must pick the least duration days out of all orders. 
  3. Sort the query using ascending order of the order_id.

 

Guidelines:

  1. click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Do not change the database structure or rename table/column names 
  9. Please make sure that the editor will contain ONLY the solution query on your last save. Once you are done, please remove other queries which you have tried out and have ONLY the solution query. Then click on 'Submit' button.
  10. The order of the columns in the sample output should match with your query
  11. Sample output rows is just for Associate's reference and this need not match the actual output

 

Sample Output:

ORDER_ID MINIMUM_DURATION_IN_DAYS
12345 1

Expected Query
SELECT order_id,(shipment_date - order_date)AS MINIMUM_DURATION_IN_DAYS
FROM t_order_placement
WHERE (shipment_date - order_date)= ( SELECT MIN(shipment_date-order_date) FROM t_order_placement)
ORDER BY ORDER_ID;
Submitted Query
select * from T_order_details;
Test Case Execution
Test Case Name Test Case Description Primary TestCase Secondary TestCase
Testing minimum shipped order Testing minimum shipped order

7.2 Update the discount percentage

Not Answered

Write a query that updates the discount percentage based on the below constraints : 

 

Design Rules:

  1. If the total cost is greater than 2000, then discount percentage must be set as 50% 
  2. Else set the discount percentage as 10%

 

Guidelines:

  1. click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Do not change the database structure or rename table/column names 
  9. Please make sure that the editor will contain ONLY the solution query on your last save. Once you are done, please remove other queries which you have tried out and have ONLY the solution query. Then click on 'Submit' button

7.3 Retrieves the customer details along with the order and stock details

Not Answered

Write a query that retrives the customer details along with the order and stock details. (Retrieve only the columns which is mentioned in the design rules)

Use Joins to achieve this. 

Design rules:

  1. The output must contain the following columns Cust_id, order_Date,order_id, stock_id
  2. Sort the output based on the ascending order of the cust_id, order_dateorder_idstock_id.

 

Guidelines:

  1. click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Do not change the database structure or rename table/column names
  9. Please make sure that the editor will contain ONLY the solution query on your last save. Once you are done, please remove other queries which you have tried out and have ONLY the solution query. Then click on 'Submit' button
  10. The order of the columns in the sample output should match with your query
  11. Sample output rows is just for Associate's reference and this need not match the actual output 

 

Sample Output:

CUST_ID ORDER_DATE ORDER_ID STOCK_ID
101 12-FEB-12 12345 1002
101 05-NOV-12 98765 1005
102 14-FEB-12 56789 1006

7.4 Retrieves the shipment status of the customer

Not Answered

Write a Pl / Sql function that takes customer id as input and retrieves the shipment status of the customer. 

         Input parameter :Customer id

        Output parameter : SHIPMENT_STATUS

Exception scenario

          If there is no customer with the given input id, then raise application error expcetion with the error message as 'ERROR'  

 

Guidelines:

  1. Click on 'Solve Question' button to get the SQL Editor window
  2. You can try executing your SQL query, using 'Run' button. The SQL Query output will be displayed to you
  3. Use 'Submit' button to submit your answers for auto evaluation and scoring
  4. You can go back to main question using 'Back' button
  5. You can retrieve the previously executed queries from the 'Log' tab
  6. Editor is enabled with 'Auto Save' feature hence your query will be auto saved
  7. Do not attempt to create any new database objects or delete existing database objects
  8. Do not change the database structure or rename table/column names
  9. Please make sure that the editor will contain ONLY the solution query on your last save. Once you are done, please remove other queries which you have tried out and have ONLY the solution query. Then click on 'Submit' button
  10. Do not alter the provided skeleton's method signature. Please proceed with the same procedure name and same out parameter


Report generated time : 18-02-2020 04:04 PM

Powered by banyan-logo