Tag Archives: SQL

Oracle

1. Database server = Instance (Processes + Memory) + Files (Database)

2. Single Instance Database = 1 Instance – 1 Database

3. RAC = Multi instance – 1 Database

4. On client access, listener creates dedicated server process which then accesses the database. Dispatcher pushes SQL in SQL queue, instead of creating individual server process for each client.

5. Data files:

>> Table Space is associated with .dbf files. One Table Space may be associated with several .dbf files.

>> Table space > Segments > Extents > Blocks (Header, table info, row info, data)

6. Processes:

>> Server processes: represent client.

>> Background processes: processes running since server start (DBWriter)

>> Slave processes: work for either server or BG processes

7. Partitions: Range partitions, hash partitions, list partitions, sub partitions (e.g. range+hash)

Advertisements

Leave a comment

Filed under Uncategorized

SQL Ex Ru: Question 25

It is a try. Not working.

SELECT distinct maker
from
(
SELECT distinct model, ram, speed, rank() over(order by ram asc, speed desc) as pos FROM PC
) AS A
inner join product B
ON A.model = B.model
where a.pos = 1

Leave a comment

Filed under SQL

SQL Ex Ru: Question 24

SELECT model FROM
(
SELECT model, Price, RANK() OVER(ORDER BY Price DESC) pos
FROM
(
SELECT model, price from PC where price = (select max(price) from PC)
UNION
SELECT model, price from Laptop where price = (select max(price) from Laptop)
UNION
SELECT model, price from Printer where price = (select max(price) from Printer)
) B
) A
WHERE pos = 1

Leave a comment

Filed under SQL