Tags » GROUP BY » Page 2

Count Specific character from String using oracle sql

Simple Query to find the Specific character from a string.

Let us consider, a String ‘thisisagoodplace’ and want to find the count of ‘a’ in the string this below query will work. 30 more words

Plsql Posts

Oracle Assignment 6

  1. The following two tables are used to store Employee and their salary records.
CREATE TABLE EMPLOYEE (EMP_ID NUMBER GENERATED ALWAYS AS IDENTITY,
NAME VARCHAR2(50) NOT NULL,
DATE_OF_BIRTH DATE NOT NULL,
DESIGNATION VARCHAR2(50) NOT NULL,
DATE_OF_JOINING DATE,
DATE_OF_RESIGNATION DATE,
LAST_WORKING_DAY DATE,
CONSTRAINT EMPLOYEE_PK PRIMARY KEY(EMP_ID));

CREATE TABLE EMPLOYEE_SALARY(EMP_ID NUMBER NOT NULL,
MONTH NUMBER(2) NOT NULL,
YEAR NUMBER(4) NOT NULL,
GROSS_EARNINGS NUMBER(10,2) NOT NULL,
DEDUCTIONS NUMBER(10,2) DEFAULT 0 ON NULL,
NET_SALARY AS (TOTAL_EARNINGS - TOTAL_DEDUCTIONS),
CONSTRAINT EMPLOYEE_SALARY_PK PRIMARY KEY (EMP_ID),
CONSTRAINT EMPLOYEE_SALARY_FK1 FOREIGN KEY (EMP_ID) 
REFERENCES EMPLOYEE(EMP_ID)); 610 more words
Database

Oracle Assignment 5

  1. Write a function which checks whether the year passed to it is current year. If it is current year then the function should return 1 otherwise it should return 0.
  2. 601 more words
Database

Oracle Assignment 4

  1. Write SQL query to fetch top 5 EMPID having high net salary than rest of employees. All EMPID with same salary as the fifth highest value also should be displayed.
  2. 478 more words
Database

3 Solutions to 2018 Oracle SQL Puzzle of the Week #11

Mimic ROW_NUMBER function

Write a single SELECT statement that produces the same result as the following one:

SELECT e.*, ROW_NUMBER()OVER(PARTITION BY deptno ORDER BY ename) rn
FROM scott.emp e… 340 more words
Tricks And Workarounds

GROUPING SETS (and ROLLUP & CUBE)

As part of my preparation for the 70-761 exam I’ve been trying to get a full understanding of some of the T-SQL I’m less familiar with. 1,396 more words

Exam Preparation

Instrucciones Básicas de SQL en SQL Server, Group by y Compute by

Serie de videos con los conceptos e instrucciones básicas para escribir consultas en SQL Server.  Segundo video donde se muestra el uso de las instrucciones para agrupar GROUP BY y COMPUTE BY, esta última instrucción fue retirada a partir de SQL Server 2012 por lo que funciona en la versión SQL 2008R2 y anteriores.

"SQL Server"