What is the full form of PL/SQL?
Procedural Language extensions to the Structured Query Language
Name two DBs using SQL?
Oracle, MySQL, DB2
What is the output of this? (in oracle)
select 'PL sql' from dual;
'PLSQL'
PL sql
On Whose order Kattappa killed Bahubali?
Rajmata Shivgami
What aggregate function would you use to get average of values of a number column?
AVG
What is the output of this?
SELECT TO_CHAR( SYSDATE-5, 'FMMonth DD, YYYY' ) RightDate FROM dual;
RIGHTDATE
September 13, 2020
What kind of SQL statement is 'INSERT'?
Data Manipulation Language (DML) Statement
What is the max integer we can fit in number(7,2) datatype?
99999
What kind of SQL statement is 'ALTER'?
Data Definition Language (DDL) Statement
Who plays Ram's role in Ramanand Sagar's Ramayan?
Arun Govil
Output of this?
SELECT id, Country FROM Customers GROUP BY Country;
Not a group by expression.
By what name Scarlett Johansson's character is known as in Marvel Movies?
Black Widow: Natasha Romanova
What is the difference between DISTINCT and UNIQUE?
UNIQUE is a constraint and DISTINCT keyword is used while querying our results.
What is an Inner Join?
The INNER JOIN keyword selects records that have matching values in both tables.
What would this do?
SELECT * INTO Records FROM Customers;
Creates a backup copy of Customers as a new table Records
How many grand slam titles have Roger Federer won?
20
What would this do?
select * from customers WHERE CustomerName LIKE 'a_%_%';
Finds any values that starts with "a" and are at least 3 characters in length
What will this do?
SELECT CustomerName FROM Customers UNION ALL
SELECT City FROM Suppliers ORDER BY City;
Union of Customer name and City
What would this do?
SELECT SupplierName FROM Suppliers WHERE EXISTS (SELECT ProductName FROM Products WHERE Products.SupplierID = Suppliers.supplierID AND Price = 22);
Returns TRUE and lists the suppliers with a product price equal to 22:
What is the output?
CREATE TABLE Orders ( OrderID int NOT NULL, OrderNumber int NOT NULL, PersonID int, PRIMARY KEY (OrderID), CONSTRAINT FK_PersonOrder FOREIGN KEY (PersonID) REFERENCES Persons(PersonID));
insert into Orders(ID,PersonId) values (10,55);
OrderNumber Cannot be null;
What is the code doing?
DECLARE
CURSOR c1 is
SELECT ename, empno, sal FROM emp
ORDER BY sal DESC;
my_ename VARCHAR2(10);
my_empno NUMBER(4);
my_sal NUMBER(7,2);
BEGIN
OPEN c1;
FOR i IN 1..5 LOOP
FETCH c1 INTO my_ename, my_empno, my_sal;
EXIT WHEN c1%NOTFOUND;
INSERT INTO temp VALUES (my_sal, my_empno, my_ename);
COMMIT;
END LOOP;
CLOSE c1;
END;
select the five highest paid employees from the emp table
What is the output of the following?
DECLARE
WELCOME varchar2(10) := 'weLcome';
BEGIN
DBMS_Output.Put_Line("welcome");
END;
/
identifier 'welcome' must be declared
When was USSR disintegrated completely?
Dec 25, 1991
What is the output of the following?
CREATE OR REPLACE PROCEDURE pri_bool(
boo_name VARCHAR2,
boo_val BOOLEAN
) IS
BEGIN
IF boo_val IS NULL THEN
DBMS_OUTPUT.PUT_LINE( boo_name || ' IS ');
ELSIF boo_val = TRUE THEN
DBMS_OUTPUT.PUT_LINE( boo_name || ' IS NOT');
ELSE
DBMS_OUTPUT.PUT_LINE( boo_name || ' What?');
END IF;
DBMS_OUTPUT.PUT_LINE( ' Fun ');
END;
/
exec pri_bool('PL-SQL',null);
PL-SQL IS Fun.
When did Oracle buy MySql?
In January 2008, Sun Microsystems bought MySQL AB for $1 billion. In April 2009, Oracle Corporation entered into an agreement to purchase Sun Microsystems, then owners of MySQL.