YouTube2Text

ORACLE - SQL AND PLSQL - 100 QUESTIONS WITH ANSWERS — Transcript

by Karthick Ravichandran · 7,746 words · 1,442 segments · language en · Watch on YouTube

Full transcript

  1. 0:01hey guys good morning this is
  2. 0:05and this video especially we're
  3. 0:07recording for those people who are
  4. 0:10searching for SQL and pl SQL jobs can
  5. 0:14refer this video
  6. 0:16not only for a specific batch I'm
  7. 0:18recording for this uh
  8. 0:20recording this
  9. 0:22interview question session it's for all
  10. 0:25SQL SQL Developers
  11. 0:28foreign
  12. 0:34community
  13. 0:45in the video
  14. 0:48helpful for English
  15. 0:51between case and decode
  16. 0:54defaulty or interview question
  17. 0:57is
  18. 1:05concept
  19. 1:10records
  20. 1:37and decode is a Only Solution in SQL
  21. 1:40okay case was
  22. 1:48relational and logical operators
  23. 2:07okay
  24. 2:08so case law
  25. 2:15foreign foreign
  26. 2:50both are used to compare data between
  27. 2:54columns
  28. 2:55we can use relational and logical
  29. 2:57operators in case whereas we cannot use
  30. 3:00and decode case will be faster than
  31. 3:03decode
  32. 3:04so by default the code is acting as an
  33. 3:07equal to operator
  34. 3:10we can use case insect select segment as
  35. 3:14well as an independent Block in PL SQL
  36. 3:16block
  37. 3:17but decode can be used only in
  38. 3:20select the statement
  39. 3:24okay and also we can use a case and
  40. 3:27decode
  41. 3:28in where condition
  42. 3:31wherever conditions are applied based on
  43. 3:33if this then this if that then this in
  44. 3:38such kind of situations
  45. 3:40if you want to apply this case or decode
  46. 3:44in
  47. 3:45where condition we can apply so there is
  48. 3:48no issues in that
  49. 3:51difference between nvl and nvl2
  50. 3:56randomly
  51. 3:57single row function will have null
  52. 3:59functions
  53. 4:02null value is
  54. 4:09nvl will accept two arguments n will 2
  55. 4:13will accept three arguments
  56. 4:16in nvl if the first argument is null
  57. 4:19then the second argument will be
  58. 4:21displayed
  59. 4:22in nbl2 if the first argument is null
  60. 4:26then third argument will be displayed if
  61. 4:29the first argument is not null then
  62. 4:31second argument will be displayed
  63. 4:35null's first nulls last
  64. 4:39null values management
  65. 4:45hippo employees stable under Justin
  66. 4:48records it is
  67. 4:52commission PCT
  68. 5:04foreign
  69. 5:38foreign
  70. 5:58Union will display unique values in
  71. 6:01ascending order
  72. 6:03Union all will display the records as it
  73. 6:07is in the query
  74. 6:10Union all will be faster than Union
  75. 6:13videos
  76. 6:33primary key will not accept duplicate
  77. 6:36values and null values
  78. 6:38unique constraint
  79. 6:40will not accept duplicate values but it
  80. 6:43will accept multiple null values no
  81. 6:46issues in that
  82. 6:47a table can have only one primary key
  83. 6:50but unique connection can have multiple
  84. 6:53both primary K and unique concern if you
  85. 6:56are keeping on a column Oracle will
  86. 6:59create unique index on that column
  87. 7:03is
  88. 7:08View
  89. 7:14database objects
  90. 7:16view is used to store a query
  91. 7:21materialist view is used to store a
  92. 7:24query result
  93. 7:28and generally we just hide the logic by
  94. 7:32using View
  95. 7:35if I want to store that logic data I
  96. 7:38will be using materialized view
  97. 7:42we have two types of view simple View
  98. 7:44and complex View we can perform BML
  99. 7:47operation on simple view but we cannot
  100. 7:49perform
  101. 7:50on complex view we can create a view for
  102. 7:54non-existing object by using Force View
  103. 7:57we have with read only in which check
  104. 7:59option as a restriction method in views
  105. 8:03in check option we need a where
  106. 8:05condition only the condition satisfied
  107. 8:08records alone will be enabled for edit
  108. 8:12option
  109. 8:13and in simple view we can able to create
  110. 8:16this restriction method
  111. 8:18and complexity is nothing but if the
  112. 8:20query having group functions analytical
  113. 8:23functions sub queries joins set
  114. 8:25operators dictionary tables single row
  115. 8:28functions
  116. 8:30and these kind of things that we have
  117. 8:32formed as a query and that query is
  118. 8:35stored in a view
  119. 8:36we can call it as a complex View
  120. 8:40we can create triggers for view by using
  121. 8:44instead option
  122. 8:46and view will be
  123. 8:49error when you are making changes on the
  124. 8:52base table
  125. 8:54which we are mentioning in the query are
  126. 8:56if any changes happen the column name
  127. 9:00The View will not work because the query
  128. 9:02will not work
  129. 9:03so V will not be work
  130. 9:05the solution for this is we need to
  131. 9:08recreate The View
  132. 9:10else
  133. 9:11The View still show
  134. 9:13Seattle
  135. 9:15metal issue we have three refresh
  136. 9:17Concepts like a complete refresh sorry
  137. 9:20complete refresh fast refresh and force
  138. 9:23refresh
  139. 9:25for fast and force log table is
  140. 9:27mandatory
  141. 9:29log table is used to track the row ID or
  142. 9:32primary key ID to track what data got
  143. 9:36you know changed
  144. 9:39so that changes will be tracked by log
  145. 9:43table so at the time of refreshing the
  146. 9:45metal issue Oracle will refresh the log
  147. 9:48table
  148. 9:49so either
  149. 9:51cost or Force
  150. 9:53are complete Oracle will be choosingly
  151. 9:56so for complete refresh we will be using
  152. 9:59dbms underscore embu.refresh of Metals
  153. 10:02view name
  154. 10:03comma
  155. 10:05C
  156. 10:07okay for fast we'll be using f
  157. 10:11and for Force we'll be using question
  158. 10:13mark
  159. 10:14to refresh the most Limitless View
  160. 10:17and Matrix you generally used
  161. 10:20for the purpose of data report
  162. 10:23generation
  163. 10:26instead of accessing keep on the master
  164. 10:29table
  165. 10:30where I can have the same data in my
  166. 10:32Mentalist view whenever the same data is
  167. 10:35getting accessed I can use
  168. 10:38metal issue
  169. 10:40which improves the database performance
  170. 10:42generally the metal issues are used for
  171. 10:46remote kind of
  172. 10:47database systems
  173. 10:50in the points don't mention any other
  174. 10:53points we cannot perform it in a DML
  175. 10:56operation on em View
  176. 10:58we cannot create index or View but we
  177. 11:02can create index and mu
  178. 11:06and next Point replace and Translate
  179. 11:10both are string manipulation function
  180. 11:14our character manipulation function
  181. 11:17if we want to change a word by another
  182. 11:20word I can use replace
  183. 11:24if I want to convert a letter by another
  184. 11:26letter I can use Translate
  185. 11:30in string and substring
  186. 11:32these function are also string
  187. 11:35manipulation function
  188. 11:37if I want to search
  189. 11:39a particular character position
  190. 11:43in a word I can use in string
  191. 11:47if I want to extract a particular
  192. 11:51word or letters from a statement or from
  193. 11:54a word I can use substring
  194. 11:57in string will accept four arguments
  195. 12:00substring will accept the three
  196. 12:01arguments
  197. 12:03replace will accept three arguments
  198. 12:07and translate is also accepting three
  199. 12:10arguments
  200. 12:11if you are missing the third argument
  201. 12:15the argument which you mentioned as a
  202. 12:17second argument will be removed from the
  203. 12:21given input if you are not mentioning
  204. 12:24the third argument whereas if you are
  205. 12:27removing if you are not mentioning the
  206. 12:29third argument it will be an error in
  207. 12:30Translate
  208. 12:32then
  209. 12:34foreign
  210. 12:41are applicable for SQL loader feature
  211. 12:44SQL loader is a bulk loader utility
  212. 12:47where we are using to load data in a
  213. 12:50bulk manner
  214. 12:52so these files
  215. 12:54are nothing but if I want to track the
  216. 12:57process summary
  217. 12:59of the loading I can use log file
  218. 13:03while loading data if I face any Oracle
  219. 13:06kind of issues those errors will be
  220. 13:09tracked in bad file
  221. 13:12if I mention any condition
  222. 13:14Over Control file
  223. 13:16using when clause
  224. 13:18if those condition failed records will
  225. 13:21be tracked then discard phase
  226. 13:25and
  227. 13:27there are two types of methodology
  228. 13:30one is
  229. 13:32direct path and another one is
  230. 13:34conventional power
  231. 13:36if you are mentioning direct equal to
  232. 13:38true the record loading concept will be
  233. 13:41faster whereas false it will be checking
  234. 13:45every constraints and tables and what
  235. 13:47are the parameters we have mentioned on
  236. 13:50the table
  237. 13:51so these parameters will be bypassed in
  238. 13:54direct path
  239. 13:56so records loading concept will be
  240. 13:58faster
  241. 14:00and which version of Oracle that you are
  242. 14:02using currently currently I'm using
  243. 14:04lebanci version of Oracle and I have
  244. 14:06basic knowledge of 12C in that g is
  245. 14:10nothing but grid and C is something but
  246. 14:12cloud
  247. 14:13and ie stands for integration
  248. 14:16what about your DB size you can mention
  249. 14:197 TB
  250. 14:21or 6 DB TB in the sense terabyte
  251. 14:25what are the connection strings required
  252. 14:27to connect DB
  253. 14:29so for that uh
  254. 14:31service name host port
  255. 14:36and
  256. 14:39user ID and password
  257. 14:42these are the things are required
  258. 14:45to connect to DB
  259. 14:48and next question
  260. 14:52when you get a viewers already have
  261. 14:55mentioned
  262. 14:56while discussing about view on M View
  263. 14:58when our word test synonym translation
  264. 15:02is no longer valid I have created a
  265. 15:05synonym
  266. 15:06I have dropped a base object if if I now
  267. 15:10trying to access that synonym this error
  268. 15:13will come
  269. 15:14object is not there
  270. 15:16but synonym is still there then it will
  271. 15:20be a problem while accessing the
  272. 15:22particular synonym
  273. 15:23list of some dictionary tables
  274. 15:26user tables
  275. 15:28user objects user synonyms user
  276. 15:32sequences user in the columns user tab
  277. 15:36columns user con columns user indexes
  278. 15:41user underscore M views user underscore
  279. 15:44snapshots
  280. 15:45DB underscore history snapshot
  281. 15:49user underscore Source user underscore
  282. 15:52errors
  283. 15:54user underscore procedures
  284. 15:57so these are the
  285. 15:59Oracle dictionary tables
  286. 16:02list 5 11g feature virtual column Escape
  287. 16:07interval table partitioning regular
  288. 16:10expression
  289. 16:11and pivot unpivot
  290. 16:14and follows trigger compound trigger
  291. 16:18and these are the things that we can
  292. 16:20mention here
  293. 16:22list some of Oracle separate packages
  294. 16:25so for that we can say like DPMS
  295. 16:29underscore output dbms underscore
  296. 16:32scheduler dbms underscore jobs util
  297. 16:36underscore file
  298. 16:37and utl underscore SMTP
  299. 16:41dbms underscore utility
  300. 16:43dbms underscore metadata
  301. 16:46and deformation underscore output
  302. 16:49we can mention all this
  303. 16:53what is context switching
  304. 16:55important interview question
  305. 16:57context switching is something but the
  306. 16:59communication between SQL engine and
  307. 17:01plsql engine
  308. 17:03so while the the processing in a bulk
  309. 17:06manner the context switching will be
  310. 17:09less if you're using Loop the context
  311. 17:12switching will be high
  312. 17:13because while using Loop the records
  313. 17:16will be processed one by one
  314. 17:19and delete Cascade and non red signal
  315. 17:21these statements are applicable whenever
  316. 17:24we have a relationship between two
  317. 17:25tables
  318. 17:26one table should have primary key the
  319. 17:29primary key should refer by another
  320. 17:30table
  321. 17:32so I just want to remove a record
  322. 17:37which is a connection between two tables
  323. 17:39I cannot
  324. 17:40for that now if I want to if I you know
  325. 17:44trying to remove the records directly
  326. 17:46from
  327. 17:47parent table so I cannot able to remove
  328. 17:50that because there is a relationship
  329. 17:52between the child table
  330. 17:54so in that case
  331. 17:56I will be removing uh records from the
  332. 17:58child table then only I can able to
  333. 18:00remove record from parent table
  334. 18:02I want to
  335. 18:04remove the child record automatically
  336. 18:08when I remove the record from parent
  337. 18:09table
  338. 18:11so for that I will be using on Direct
  339. 18:13cascading
  340. 18:15cash can sense a reflection
  341. 18:18so I am trying to remove the record from
  342. 18:20parent table
  343. 18:22automatically the child record data will
  344. 18:25get removed so I will be using ondil
  345. 18:27Cascade in foreign key table
  346. 18:30so consider for example here Department
  347. 18:33table is parent table and employee
  348. 18:34stable is table table
  349. 18:36Department ID is you know linked with
  350. 18:39employees table
  351. 18:40so there we have three records Stephen
  352. 18:43ninalex
  353. 18:44if I'm trying to remove a record 90
  354. 18:48executive record from departments table
  355. 18:51it will throw an error what I am trying
  356. 18:53to do is
  357. 18:55I am just going to mention handle
  358. 18:58Cascade in employee stable foreign key
  359. 19:00column
  360. 19:01so you will be removing the foreign key
  361. 19:04and again you will be altering the table
  362. 19:07alter table table name
  363. 19:09add constraint constraint name for in
  364. 19:13key of Department ID
  365. 19:15references employees table of Department
  366. 19:18ID
  367. 19:21sorry so we are going to keep foreign
  368. 19:23key right yes
  369. 19:25references departments table of
  370. 19:28Department ID and cash cap
  371. 19:31I am repeating the statement alter table
  372. 19:34employees
  373. 19:36add constraint consent name foreign key
  374. 19:39of Department ID references Department
  375. 19:41stable Department ID and cascade
  376. 19:45so we need to keep on Del Cascade only
  377. 19:48in
  378. 19:48parent if not in the parent table only
  379. 19:51in child table
  380. 19:52and even on will set null as well
  381. 19:56so on the Sentinel is nothing but if I'm
  382. 19:59removing record from the parent table
  383. 20:01automatically
  384. 20:03that foreign key data will set null
  385. 20:06so it will not be removed from the table
  386. 20:10instead of that we'll be using on Direct
  387. 20:13set null
  388. 20:14so for example if it is 90 I am removing
  389. 20:17from a department stable automatically
  390. 20:20the streamer Nina Lex Department ID will
  391. 20:23be null
  392. 20:25if you are using on delete set null
  393. 20:29no violated in the sense
  394. 20:33came on a point no validated
  395. 20:36I have a table and column where there is
  396. 20:40no primary key and table is having some
  397. 20:43duplicate values
  398. 20:44now if I'm trying to keep primary on a
  399. 20:47column Oracle will not allow me to keep
  400. 20:49primary chemical because
  401. 20:51primary key will not accept duplicate
  402. 20:54values and as well as null values since
  403. 20:56the column is already having duplicate
  404. 20:58values
  405. 20:59you will be getting an error called
  406. 21:01unique connection violation error
  407. 21:03so but the requirement is I need to keep
  408. 21:06primary key against the data
  409. 21:08so what I am doing here is I will be
  410. 21:13bypass that unique index creation
  411. 21:15because
  412. 21:16while creating primary key on a column
  413. 21:18Oracle will create a unique Index right
  414. 21:21so to bypass that in unique index
  415. 21:25I have to create a normal B tree index
  416. 21:27on that column the column which you want
  417. 21:29to keep primary key so create a normal
  418. 21:32beta index create index index name on
  419. 21:35the column name
  420. 21:37after that we have to alter the
  421. 21:41table by using alter table table name
  422. 21:44add constraint constraint name primary
  423. 21:47key of that column name with no validate
  424. 21:51so primary key of the column name space
  425. 21:54no value data
  426. 21:56if you are using this statement
  427. 21:59the statement is
  428. 22:02alternate table table name add
  429. 22:05constraint
  430. 22:07constrain name
  431. 22:10primary key
  432. 22:13of that column name
  433. 22:16no validate
  434. 22:20when you run the statement the existing
  435. 22:22duplicate record will not be considered
  436. 22:25so it will be acting as a primary key
  437. 22:27hereafter
  438. 22:30so that's one statement how to rebuild
  439. 22:32index
  440. 22:34you can rebuild index by using alter
  441. 22:37index index name
  442. 22:39rebuild
  443. 22:43if the requirement is
  444. 22:45for production database
  445. 22:48because we have three different database
  446. 22:50systems like Oneness for development and
  447. 22:53another one is for testing and finally
  448. 22:56we have for protection
  449. 22:58so if the issue is for production
  450. 23:00database then we will need to we need to
  451. 23:03add one more keyword online if it is not
  452. 23:06production no need to mention online
  453. 23:09foreign
  454. 23:13whenever a column frequently accessed in
  455. 23:17where condition we can think about index
  456. 23:20and indexer
  457. 23:23you know used to retrieve the data
  458. 23:25faster but not all the times
  459. 23:27whenever
  460. 23:29the retrieval percentage is between 25
  461. 23:32to 30 percentage then it is good to have
  462. 23:35an index on a column else it is not good
  463. 23:37Optimizer will not access that index we
  464. 23:41can able to see whether the created
  465. 23:45index accessed in that query or Not by
  466. 23:48explaining but seeing where to explain
  467. 23:50plan
  468. 23:51so how will you take explain plan
  469. 23:53explain plan four followed by the query
  470. 23:56which you want to take explain plan then
  471. 23:59select a dbms underscore expand or
  472. 24:02display from dwell will help you to
  473. 24:05generate the explain Plum and see the
  474. 24:08explain plan
  475. 24:09and types of index B tree index bitmap
  476. 24:12index
  477. 24:13unique index Composite Index reverse key
  478. 24:16index function based index
  479. 24:19and if the column is having very less
  480. 24:21duplicate values we can call it as a
  481. 24:24high quality column and this column is
  482. 24:27frequently accessed in where Clause we
  483. 24:30can go for battery index
  484. 24:32the column is having only duplicate
  485. 24:34values and called frequently in wire
  486. 24:36condition
  487. 24:37such column can be indexed by bitmap
  488. 24:40index
  489. 24:42we can call it as a low quantity column
  490. 24:45and explain about refresh methods in
  491. 24:48view that I mentioned already while
  492. 24:50discussing about mu we have three
  493. 24:53refresh methods complete fast Force I
  494. 24:56want to refresh the entire records
  495. 25:01of a material metal issue
  496. 25:03what are the things that have made
  497. 25:05changes in the base table
  498. 25:08is more than 60 to 70 percentage means
  499. 25:11then I can go for complete refresh
  500. 25:14if it is less than that you can use fast
  501. 25:17or Force refresh so those refresh can be
  502. 25:21done by execute dbms underscore mu dot
  503. 25:25refresh
  504. 25:26May place your name and C
  505. 25:28C stands for complete refresh
  506. 25:31what is correlated supporting
  507. 25:34either remember
  508. 25:48um
  509. 25:53So based on inner query the subway got
  510. 25:56defined right if inner query joining
  511. 26:00with outer query or depending on outer
  512. 26:02query we can call it as a correlated sub
  513. 26:06query so incarnated subquery inner query
  514. 26:09cannot work independently
  515. 26:13so if inner query depending on outer
  516. 26:17query we can say it is a correlated
  517. 26:20subquery
  518. 26:24okay fine
  519. 26:27next
  520. 26:29difference between group functions and
  521. 26:32analytical functions
  522. 26:34group functions will return one row for
  523. 26:37each group
  524. 26:39analytical function will return one row
  525. 26:41for each row
  526. 26:44and min max some average count or group
  527. 26:48functions rank density
  528. 26:52pivot and pivot roll up Cube
  529. 26:55those are nothing but analytical
  530. 26:57functions
  531. 26:59what is stable
  532. 27:02collection of records that composed of
  533. 27:05rows and columns nothing but a table it
  534. 27:08is a database object
  535. 27:10where we can use to store data in it
  536. 27:14table space
  537. 27:16is nothing but
  538. 27:19a space we can have
  539. 27:21multiple objects in it it is not only
  540. 27:24for table
  541. 27:26so don't understand by the name it is
  542. 27:29only for table no it is not so we can
  543. 27:32have index in tablespace we can have
  544. 27:35other database objects also inside one
  545. 27:37tablespace so table space is nothing but
  546. 27:40a separate memory space where we can
  547. 27:43have other database objects as well
  548. 27:47how an SQL statement works for that we
  549. 27:51should aware of three steps
  550. 27:54the first thing is something but syntax
  551. 27:56check
  552. 27:57whether the returns SQL statement uh
  553. 28:01you know created properly
  554. 28:04the second check is nothing but a
  555. 28:06semantic check
  556. 28:08semantic is something but whether the
  557. 28:10column name and table name view name the
  558. 28:13object names and
  559. 28:14stuff you mentioned after select
  560. 28:17or after from or after where you
  561. 28:20mentioned
  562. 28:21correct or not so that will be checked
  563. 28:23in semantic the syntax and symmetic we
  564. 28:26can call it as a compile time check
  565. 28:29if you have any issues in that then it
  566. 28:31will be an error
  567. 28:33so for syntax error we will be receiving
  568. 28:36SQL command not properly ended from
  569. 28:38Clauses expected
  570. 28:41where
  571. 28:42we cannot use a group function in where
  572. 28:45clause
  573. 28:46Windows function not already here
  574. 28:49these are the things we can say at the
  575. 28:50system syntax issue
  576. 28:53and semantic nothing but invalid
  577. 28:55identifier table or view does not exist
  578. 28:59these things that you can say as a
  579. 29:01semantic issue the finally Oracle will
  580. 29:05do third check as a shared pull check or
  581. 29:08Library catch a check
  582. 29:09which is nothing but the statement which
  583. 29:12are executing second time or first time
  584. 29:15if it is first time Optimizer will work
  585. 29:18on that it will generate explain plan
  586. 29:21based on the cost
  587. 29:23the the least cost explain plan will be
  588. 29:27generated by the optimizer
  589. 29:31so in that we'll be we can able to see
  590. 29:33the scans and access paths
  591. 29:36okay so how Optimizer worked to retrieve
  592. 29:41the data from the database
  593. 29:44okay so if second time we are running
  594. 29:48that same query
  595. 29:51Oracle will identify that SQL ID from
  596. 29:53the respective catch
  597. 29:55if catch is found then Oracle will go
  598. 29:58for soft Crossing else Oracle will go
  599. 30:01for hard parts
  600. 30:03so here definitely you have to mention
  601. 30:04about hard parsing and soft passing
  602. 30:08how to take explain just to have
  603. 30:10explained
  604. 30:12if I want to filter the data directly
  605. 30:15from the table I can use where clause
  606. 30:17if I want to filter the records from the
  607. 30:21group by concept then
  608. 30:23I can use having Clause so condition
  609. 30:26with group function I have to mention
  610. 30:28having Clause from directly table I can
  611. 30:32use where clause
  612. 30:35one sequence is created if you run curve
  613. 30:37well then it will be an error because
  614. 30:40sequence must be initialized at the time
  615. 30:43of next well
  616. 30:44once you create the sequence you're
  617. 30:46supposed to run next 12 statement not
  618. 30:48the curveball statement if curable then
  619. 30:51error
  620. 30:53joints
  621. 30:56query that can be connected with the
  622. 30:59query
  623. 31:01one query will be acting as a inner
  624. 31:03query and another query I will be acting
  625. 31:04as
  626. 31:05outer pouring
  627. 31:07so in a query that outer query
  628. 31:09connection means so we can call it as a
  629. 31:11sub query
  630. 31:13and we have seven types of sub query
  631. 31:15single row sub query multi row sub query
  632. 31:18multiple Columns of query correlated sub
  633. 31:21query scale or sub query inline view sub
  634. 31:23query nested sub query
  635. 31:26so these are the sub query we can call
  636. 31:28it as uh you know types of subqueries
  637. 31:32set operators
  638. 31:35we can relate
  639. 31:37between
  640. 31:38two queries data
  641. 31:41so in between queries we'll be using set
  642. 31:43operators so we have four operators
  643. 31:45union union or intersect and minus which
  644. 31:48helps us to compare data between two
  645. 31:51queries
  646. 31:53and whereas joins
  647. 31:55if I want to retrieve record from
  648. 31:58multiple tables I will be using joins
  649. 32:01so single query you can able to see
  650. 32:03multiple table data we have seven types
  651. 32:07of joints inner join are equally join
  652. 32:10natural join
  653. 32:12left out Regine operator joins full
  654. 32:14outer join self join and cross join
  655. 32:18cross chain is also known as Cartesian
  656. 32:20product
  657. 32:22and after that we have types of tables
  658. 32:27I have already mentioned that
  659. 32:29how data import export happening in
  660. 32:32database
  661. 32:34so we have Excel table SQL loader impdb
  662. 32:38and exp DB
  663. 32:39so you all have to you know aware of
  664. 32:43this uh acceler table concept which will
  665. 32:46help you to
  666. 32:47load the data or pump the data so in
  667. 32:50Excel table we will use uh
  668. 32:54what data loading as well as data
  669. 32:57pumping so Oracle underscore loader
  670. 33:00Oracle underscore data pump
  671. 33:02is a type of
  672. 33:04thing that we are working in Excel table
  673. 33:06we need to create a directory
  674. 33:09and we need to understand the data after
  675. 33:12that we have to form a column structure
  676. 33:16then we have to mention type
  677. 33:18organization XML before that
  678. 33:20organization external type default
  679. 33:23directory and access parameter in that
  680. 33:25three things to be mentioned records
  681. 33:27will delimited by new line Fields turned
  682. 33:30by comma missing field values are null
  683. 33:33and then column mapping should be
  684. 33:35happening and then location should be
  685. 33:36mentioned and then reject limited
  686. 33:39unlimited parallel five things to be
  687. 33:41none so using this particular syntax we
  688. 33:44can able to load the data and similarly
  689. 33:46for
  690. 33:47unload the data
  691. 33:49and how to check
  692. 33:52data count of a table
  693. 33:55so already we have discussed about this
  694. 33:57query count of star sum of One Max of
  695. 33:59problem from employees table which helps
  696. 34:01you
  697. 34:02to identify the number of Records
  698. 34:04available in the respective table and as
  699. 34:06well as
  700. 34:07you can use num underscore rows from
  701. 34:10user tables
  702. 34:11so that's what we're calling it as a
  703. 34:13dictionary table where you can identify
  704. 34:15all the information about the table
  705. 34:16which you want to see
  706. 34:19so in where condition you have to
  707. 34:21mention the table name in capital letter
  708. 34:22already over aware of that the digital
  709. 34:25table will be captured in the record in
  710. 34:27capital letter
  711. 34:36capital letters else
  712. 34:45difficult in the sense
  713. 34:51okay without creating additional object
  714. 34:54how to stop insert data on weekends
  715. 34:58time
  716. 35:02seconds
  717. 35:08took care of that column name comma the
  718. 35:14in one comma 7
  719. 35:17or not till 1 comma Seven
  720. 35:20Corners because
  721. 35:24foreign
  722. 35:47both will generate a sequence number
  723. 35:49both will generate sequence number based
  724. 35:53on over and order by column
  725. 35:57if order by column is you know having
  726. 35:59duplicate values then the sequence
  727. 36:01number will be skipped we can say it is
  728. 36:04a ram
  729. 36:05if sequence number does not skip means
  730. 36:08we can call it as a dense run
  731. 36:10and difference between row number rho ID
  732. 36:13and row number
  733. 36:16ronum and row ID both are pseudo columns
  734. 36:20in SQL and we can say row number as a
  735. 36:23mechanical function
  736. 36:25ronum
  737. 36:27will generate a sequence number from one
  738. 36:31to something so on
  739. 36:33and how many records will be displayed
  740. 36:37it is purely based on the query data
  741. 36:41so how many records the query is
  742. 36:43retrieving that many numbers will be
  743. 36:45displayed as a sequence number
  744. 36:47so row num is a pseudo column will
  745. 36:49generate sequence number automatically
  746. 36:51based on the query result
  747. 36:54which will not be stored in database you
  748. 36:57can use where condition using row num
  749. 36:59equal to 1 less than or less than or
  750. 37:02equal to apart from that it will not
  751. 37:04work for anything
  752. 37:05whereas rhoad is something but a soda
  753. 37:08column and which will generate
  754. 37:1018 digit alpha numeric unique ID that
  755. 37:15will be stored in database
  756. 37:17while inserting data into a table Oracle
  757. 37:19will create this ID
  758. 37:21it is an unique representation of every
  759. 37:24row in a table
  760. 37:26Oracle refers row ID for
  761. 37:30data retrieval faster
  762. 37:34okay and row number
  763. 37:36and you can apply wire condition by
  764. 37:38using a row ID which will retrieve the
  765. 37:41record faster
  766. 37:42row number is also generating a sequence
  767. 37:46number automatically based on the over
  768. 37:49order by clause
  769. 37:51and finally
  770. 37:5315th question we have
  771. 37:56how many primary key and long data type
  772. 37:59we can
  773. 38:00able to keep in a table only one
  774. 38:04answer this one
  775. 38:06what is the difference between
  776. 38:09daily Trend truncate and drop
  777. 38:11delete is a DML command
  778. 38:14truncate and drop is a ddl command which
  779. 38:18is an auto commit language
  780. 38:20there it is a non-auto commit language
  781. 38:23we can apply where condition
  782. 38:27or we cannot apply web condition if you
  783. 38:29are not applying wire condition means
  784. 38:31entire record will get removed from the
  785. 38:33database
  786. 38:35and not finally like temporarily the
  787. 38:38record will be handled in redo log file
  788. 38:41the DML operations not only delayed
  789. 38:44insert update delete merge all these
  790. 38:48commands
  791. 38:49records will be captured temporarily in
  792. 38:51redo log file once we do commit then it
  793. 38:55will reflect in database otherwise
  794. 38:57once we do rollback
  795. 39:00the records there in the redo log file
  796. 39:02will be transferred to RK block files
  797. 39:06in truncate that concept is not
  798. 39:08available
  799. 39:13truncate will remove entire record we
  800. 39:15cannot apply wire condition
  801. 39:17their entire record will get remote but
  802. 39:20table will be there the structure will
  803. 39:22be there if I want to remove the table
  804. 39:24or any object I can use a drop command
  805. 39:27so drop is also Auto committed
  806. 39:30and the difference Main
  807. 39:33about David and truncate is high water
  808. 39:37high water mark is the boundary line
  809. 39:39between used and unused space
  810. 39:44so it will be refreshed in truncate it
  811. 39:46will not get refreshed in delayed so we
  812. 39:49need to refresh the high Watermark by
  813. 39:51using Gathering statistics of the table
  814. 39:54while refreshing the table we can easily
  815. 39:57update the high water mark execute
  816. 40:01dbms underscore stats dot gather table
  817. 40:05stats of schema name and table name
  818. 40:07which help you
  819. 40:10to refresh the table and refresh the
  820. 40:12heaven work you can able to see whether
  821. 40:15the table got refresh or not
  822. 40:18user tables last analyzed column you can
  823. 40:22able to see whether the table is
  824. 40:23invarried or valid
  825. 40:25okay in Num underscore we can see how
  826. 40:27many records are there in the table
  827. 40:30and in same way in last and list column
  828. 40:32we can able to see at what time the
  829. 40:35table got analyzed finally
  830. 40:38merge syntax
  831. 40:41much syntax is uh so merge is a syntax
  832. 40:46where we can you know
  833. 40:49uh accomplish multiple DML statement in
  834. 40:52a single statement
  835. 40:54and it is nothing but merge into table
  836. 40:57name using table name
  837. 40:58on condition when matched then
  838. 41:03update
  839. 41:04and delete also can be mentioned when
  840. 41:07not matched then inset
  841. 41:09this is syntax you have to mention no
  842. 41:11other statement merge into table name
  843. 41:13using table name on condition when
  844. 41:16matched then update will not match then
  845. 41:19insert so this statement that you have
  846. 41:21to run
  847. 41:25and after that we have what is interval
  848. 41:28table partitioning
  849. 41:29applicable only for range partitioning
  850. 41:33the records which we not partition
  851. 41:37those records will be captured
  852. 41:41in interval partitioning which generated
  853. 41:44by our you know Oracle automatically
  854. 41:46while inserting
  855. 41:48and partition data into the table or
  856. 41:50okay will create a new Partition
  857. 41:53Oracle itself will be generating the
  858. 41:56name of the partition so it will be
  859. 41:58starting
  860. 41:59from its sys
  861. 42:01and you can able to see that in user tab
  862. 42:03partitions this feature introduced in
  863. 42:06leveraging
  864. 42:07how to print 1 to 10 in SQL select a
  865. 42:11level from viewl connected by level less
  866. 42:13than equal to
  867. 42:1510.
  868. 42:16how to print a to z so for that we have
  869. 42:20to use C HR function
  870. 42:23so in that we'll be using a 60
  871. 42:26five I think so 65 what is the alphabet
  872. 42:29for uh
  873. 42:3165 let me check
  874. 42:36yes 65 is uh
  875. 42:38a what we can do is 64 plus level
  876. 42:43so I need 26 characters nine so connect
  877. 42:46my level less than or equal to 26. so
  878. 42:49this query will generate uh alphabetical
  879. 42:52order
  880. 42:54and then we have a value used gtt in
  881. 42:58your project
  882. 42:59and types of gdt
  883. 43:02whenever my project requirement says I
  884. 43:05need to manage temporarily a bulk amount
  885. 43:08of data
  886. 43:09and I want to
  887. 43:11I'm supposed to make some DML operation
  888. 43:13on such data I can keep the data inside
  889. 43:16gtt so what I can do I will be
  890. 43:19maintaining a temporary table either by
  891. 43:23on Commit electrodes on Commit pressure
  892. 43:25rows up to my requirement
  893. 43:27and I can manage the data so recently we
  894. 43:30have used gtt to manage bulk amount of
  895. 43:33data instead of accessing the master
  896. 43:35table I can access
  897. 43:37GTD and gtt record will be captured to
  898. 43:40and move to
  899. 43:42master table
  900. 43:45is it possible to change data type when
  901. 43:47the table is having data already we
  902. 43:50cannot make changes in data type if
  903. 43:54table is already having data what we are
  904. 43:57supposed to do is we need to
  905. 44:01create a new column
  906. 44:04with a different name and then we have
  907. 44:06to transfer the data toward
  908. 44:08towards that column and then we need to
  909. 44:12change the data type of the existing
  910. 44:14column so meaning you need to transfer
  911. 44:17the data to the newly created column is
  912. 44:20you need to go for update segment once
  913. 44:23the transfer is done then you can able
  914. 44:24to
  915. 44:26change the data type and then we will be
  916. 44:28transferring again to the existing
  917. 44:29column so that thing should be happen
  918. 44:32else you cannot create a you cannot
  919. 44:36update you cannot change the data type
  920. 44:39of the column which column is already
  921. 44:40having data
  922. 44:42how to realign the column means we can
  923. 44:46use invisible and visible to realign the
  924. 44:49column
  925. 44:52print
  926. 44:53given
  927. 44:55number inverse so this video
  928. 44:58I'm just trying to you know do for a
  929. 45:01theoretical way so I will be you know
  930. 45:05skipping uh the technical queries I will
  931. 45:08be teaching different video so the first
  932. 45:10in the video
  933. 45:12theoretical Concepts because it is
  934. 45:19not good actually
  935. 45:37so which question we are coming around I
  936. 45:40think this query
  937. 45:41this statement would just say lead lager
  938. 45:47and the date of a previous date
  939. 45:50I will be using lead
  940. 45:53and the rate our next date
  941. 45:55lag I will be using both our analytical
  942. 45:58function
  943. 46:00because
  944. 46:25[Music]
  945. 46:28but next to PL SQL stuffs
  946. 46:32management
  947. 46:41what is cursor cursor is something but
  948. 46:44SQL private work area
  949. 46:46and there are two types of cursor
  950. 46:48implicit cursor and explicit cursor
  951. 46:51cursor can process only one row at a
  952. 46:54time
  953. 47:00what whatever
  954. 47:01we have studied what are the things that
  955. 47:04you know about cursor you can mention
  956. 47:07Ed
  957. 47:14something but SQL private area
  958. 47:20then again I'm telling what cursor can
  959. 47:23process only water at a time
  960. 47:26cursor can process compile time data
  961. 47:31okay there are two types of cursor
  962. 47:33implicit cursor and explicit cursor
  963. 47:37and cursor can manage the attributes
  964. 47:40like found not found is open and broken
  965. 47:44difference between Loop and while loop
  966. 47:48Loop will start the execution process
  967. 47:51and will come out from the loop
  968. 47:54when the condition is satisfies
  969. 47:56while
  970. 47:58before executing when the condition is
  971. 48:01satisfies it allows the loop to execute
  972. 48:07difference between cursor and refursor
  973. 48:09cursor is an SQL private work area
  974. 48:13there are two types of cursor in place
  975. 48:15in the next place what are the things
  976. 48:16that we can
  977. 48:17mention we have mentioned here we can
  978. 48:20mention okay
  979. 48:23cursor can process only one row at a
  980. 48:25time whenever there is a scenario that I
  981. 48:29need to validate data one by one
  982. 48:31I will be using uh cursor
  983. 48:34rough cursor is a data timing
  984. 48:38which is
  985. 48:40two types
  986. 48:42strong layer of person weak layer of
  987. 48:44cursor and general used as an output
  988. 48:47parameter and whenever the application
  989. 48:50screen having Lov
  990. 48:52Lov list of values or any any screen
  991. 48:55content to be displayed in a detailed
  992. 48:57manner multiple columns are single
  993. 49:00columns multiple data or single data
  994. 49:03everything will be managed by rough
  995. 49:05cursor parameter
  996. 49:07mostly used as an output output
  997. 49:09parameter
  998. 49:11and different between row level and
  999. 49:14statement level
  1000. 49:15trigger so trigger automatically for us
  1001. 49:19when an event occurs events are nothing
  1002. 49:21but insert update delete
  1003. 49:23and timing points are nothing but before
  1004. 49:25and after instead of
  1005. 49:27if we create trigger for view we'll use
  1006. 49:30instead of
  1007. 49:32and statement level if I want to fire a
  1008. 49:34trigger for a statement for insert or
  1009. 49:36for update for a delete a new statement
  1010. 49:39level trigger it will fire the trigger
  1011. 49:41only once
  1012. 49:43whereas roller will trigger how many
  1013. 49:45records got affected because of that
  1014. 49:47statement that many times trigger will
  1015. 49:49get fired I am doing an update statement
  1016. 49:51that will reflect on 10 rows means that
  1017. 49:55particular PL SQL block will execute 10
  1018. 49:57times
  1019. 50:00foreign
  1020. 50:04so this thing can be solved by using
  1021. 50:07compound Trigger or pragma autonomous
  1022. 50:09transaction keyword
  1023. 50:10and whenever we are inserting
  1024. 50:14our data into a table and the same
  1025. 50:17action for the trigger then it will be a
  1026. 50:20mutating table error
  1027. 50:22possible to perform DML operation on MBO
  1028. 50:25trigger
  1029. 50:26in mu we cannot perform
  1030. 50:28intrigger we can perform but
  1031. 50:33we cannot commit inside a trigger
  1032. 50:36so if you need commit for DML operation
  1033. 50:39then we should go for problem autonomous
  1034. 50:42transaction you should mention declare
  1035. 50:44keyword
  1036. 50:45after that that statement we can also
  1037. 50:48perform a DML operation but we cannot
  1038. 50:51run in select statement for that also we
  1039. 50:54need to mention program autonomous
  1040. 50:56transaction and whenever we use this
  1041. 50:59keyword commit is required
  1042. 51:01is nothing but
  1043. 51:03an independent transaction
  1044. 51:08independent transactions nothing but
  1045. 51:10compiler redirective statement
  1046. 51:14the statement which you are running with
  1047. 51:16the program autonomous transaction
  1048. 51:18will not affect the commit outside of
  1049. 51:21the statement which you outside of the
  1050. 51:22program which we executed
  1051. 51:25those commit statement is applicable
  1052. 51:28only for the block
  1053. 51:30which having problem autonomous
  1054. 51:32transaction Raghu Mata Namaste
  1055. 51:34transaction the keyword is
  1056. 51:48foreign
  1057. 52:13overloading
  1058. 52:17is nothing but we can have the same name
  1059. 52:21of the sub program names and that can be
  1060. 52:25differentiated by
  1061. 52:27word parameter time parameter name and
  1062. 52:31data type number of variables
  1063. 52:34we can differentiate by that so we can
  1064. 52:37say it is a package overloading
  1065. 52:41Global things are nothing but what are
  1066. 52:44the things that we are declaring inside
  1067. 52:45package specification either can be a
  1068. 52:48type or variables constant variables
  1069. 52:52cursor sub programs anything rough
  1070. 52:55cursor what are the things that we are
  1071. 52:57declaring inside package specification
  1072. 52:59we can call it as a global steps
  1073. 53:02and in between
  1074. 53:04procedure or function if you are
  1075. 53:07declaring any variables those variables
  1076. 53:10can be used only within that procedure
  1077. 53:12or function
  1078. 53:13we can calling it as a
  1079. 53:15local variables
  1080. 53:19and
  1081. 53:20procedure and function difference
  1082. 53:23Evergreen question
  1083. 53:25both are sub programs
  1084. 53:27both are used to accomplish specific
  1085. 53:30business requirement from DB and
  1086. 53:34procedure may or may not return a value
  1087. 53:36function must return a value
  1088. 53:38function can be called in a select
  1089. 53:41statement whereas procedure we cannot
  1090. 53:43call
  1091. 53:44procedure and function both are
  1092. 53:46performing literally the same thing
  1093. 53:49but why we are going for function is
  1094. 53:52when the requirement
  1095. 53:55no says that I need to call
  1096. 53:59in a select statement then that case we
  1097. 54:01can only go for a function not by a
  1098. 54:03procedure so we can accomplish by
  1099. 54:06function remaining steps we can do
  1100. 54:09everything by procedure
  1101. 54:11and we can perform anything whatever we
  1102. 54:14want inside function procedure all are
  1103. 54:16saving
  1104. 54:18okay fine forward declaration is nothing
  1105. 54:20but
  1106. 54:21I have uh not declared
  1107. 54:25as a program in a package specification
  1108. 54:29I am just
  1109. 54:31no declare or used
  1110. 54:34inside package body still like unable to
  1111. 54:37access that function or procedure only
  1112. 54:41within that package body
  1113. 54:44outside of the body I cannot access so
  1114. 54:47you cannot call that procedure by using
  1115. 54:49package in m dot
  1116. 54:51that procedure name no it will throw an
  1117. 54:53error because
  1118. 54:55you can access
  1119. 54:56those kind of method
  1120. 54:59you can go for that kind of method only
  1121. 55:01if you are declaring that in package
  1122. 55:04specification
  1123. 55:05so if you are trying to access
  1124. 55:08that package local procedure
  1125. 55:12which you didn't declare in package
  1126. 55:15specification
  1127. 55:17that procedure should be declared in
  1128. 55:20that particular package body
  1129. 55:23without declaring in that package body
  1130. 55:26you cannot able to access
  1131. 55:28so the Declaration should happen before
  1132. 55:31the procedure defining in another
  1133. 55:34program so such a declaration we can
  1134. 55:36call it as a forward declaration so I'm
  1135. 55:39just explaining about this in a detailed
  1136. 55:42manner for example my back range is
  1137. 55:45having
  1138. 55:45three procedures sp1 SP2 and sp3
  1139. 55:49and package body
  1140. 55:52sp4 I'm defining
  1141. 55:55say sp4s I'm doing some PL SQL Concepts
  1142. 55:59here
  1143. 56:02so here I'm doing some insert operation
  1144. 56:05where the pl SQL compiler will ask you
  1145. 56:09to declare
  1146. 56:10before this uh
  1147. 56:12procedure you are using anywhere else
  1148. 56:15inside the package body
  1149. 56:17so you have to declare you know
  1150. 56:19a package in the package or the first
  1151. 56:24line create a replace package body
  1152. 56:27package name as
  1153. 56:31procedure sp4
  1154. 56:35semicolon which it is
  1155. 56:53so that's very very important point
  1156. 56:55about the
  1157. 56:57forward declaration
  1158. 57:03so can I create a package without body
  1159. 57:07yes
  1160. 57:08declaration
  1161. 57:10don't get confused about this kind of
  1162. 57:12question declaration mandatory
  1163. 57:18can I create a package without a species
  1164. 57:24so you have to create a spec yes fine
  1165. 57:27you have to create only body no it is
  1166. 57:30not alone
  1167. 57:32so without specification package cannot
  1168. 57:34be created without body we can create a
  1169. 57:37package
  1170. 57:39can a call function inside a procedure
  1171. 57:41inside a function we can call a process
  1172. 57:43yes we can call function inside
  1173. 57:45procedure closer inside function
  1174. 57:48is it possible to call a procedure
  1175. 57:51inside a trigger yes I want to perform a
  1176. 57:54particular action that action is stored
  1177. 57:56in database that procedure is to be
  1178. 57:58called in a
  1179. 57:59trigger yes we can still able to use
  1180. 58:03can I call a standalone procedure inside
  1181. 58:06package yes
  1182. 58:08what is procedure
  1183. 58:11I want to perform a specific action I
  1184. 58:15just stored that action inside a
  1185. 58:16procedure I want to perform that perform
  1186. 58:19the same action then I can call anywhere
  1187. 58:22else
  1188. 58:24if a created means I can call anywhere
  1189. 58:26if I declared means I cannot call only
  1190. 58:30the package specification declaration
  1191. 58:33part alone can be used globally
  1192. 58:36okay
  1193. 58:40why we use with cursor as I mentioned
  1194. 58:42already
  1195. 58:44collection there are three types of
  1196. 58:46collections
  1197. 58:47associative array
  1198. 58:49nested table and V array first last next
  1199. 58:54prior delete the term
  1200. 58:58limit count delete
  1201. 59:01exist extend these are nothing these are
  1202. 59:03the methods or collection methods and
  1203. 59:06generally we use collections to handle
  1204. 59:08multiple rows
  1205. 59:10okay whenever use collection we used to
  1206. 59:13go for bulk collector statement to
  1207. 59:15process uh
  1208. 59:16you know bulk amount of data in single
  1209. 59:19stage
  1210. 59:21raise and raise application error both
  1211. 59:23are
  1212. 59:24user different exceptions
  1213. 59:28we can Define we can you know go for
  1214. 59:31exception in two ways
  1215. 59:33one thing is I just want to divert
  1216. 59:36I know in between PL SQL program 2
  1217. 59:39exception block I can go for raise
  1218. 59:42and I want to stop the execution in
  1219. 59:44between the pl SQL block and I want to
  1220. 59:48go for a concept same like Oracle how it
  1221. 59:52is you know throwing error I can go for
  1222. 59:54price application error the error code
  1223. 59:56range between minus 20 000 to minus 999
  1224. 1:00:01and message can be your wish
  1225. 1:00:04list of some predefined uh exception uh
  1226. 1:00:10no data found
  1227. 1:00:12cursor already open invalid cursor
  1228. 1:00:16and do 12 and index 0 divide
  1229. 1:00:22too many rows
  1230. 1:00:24invalid number so these are the things
  1231. 1:00:26that we can say
  1232. 1:00:27that's a pretty different exception
  1233. 1:00:36how to debug PL SQL program
  1234. 1:00:39so for example my program is having two
  1235. 1:00:42or two thousand of lines of coding there
  1236. 1:00:43I couldn't able to find the mistake
  1237. 1:00:45where it is happening
  1238. 1:00:47so in that case I can have a D minus
  1239. 1:00:50output statement every 100 rows of your
  1240. 1:00:53PL SQL Block in between that you can
  1241. 1:00:55mention like dbms output 1 dbms output 2
  1242. 1:00:59so you can have 20 dbms statements
  1243. 1:01:01inside 2000 lengths of your program
  1244. 1:01:03after executing that you can able to see
  1245. 1:01:06three not four five six and all then it
  1246. 1:01:09will be a problem between three and four
  1247. 1:01:11what you can do between three and four
  1248. 1:01:14you have 100 statements you can near
  1249. 1:01:16that statement you can hear the mistake
  1250. 1:01:18by using again dbms output like 3.1 3.2
  1251. 1:01:223.4 in between 20 lines of every
  1252. 1:01:25uh that in between that PL SQL uh three
  1253. 1:01:29and four blocks so after running this
  1254. 1:01:32you can able to see 3.3 not 3.4 3.5
  1255. 1:01:353.600 so then the mistake nothing but
  1256. 1:01:38between three point four and five so you
  1257. 1:01:41can able to near the error which happens
  1258. 1:01:45so in that way you can debug the pl SQL
  1259. 1:01:48program or you can use dbms profiler
  1260. 1:01:51issue
  1261. 1:01:54so trigger cursor syntax or mandatory
  1262. 1:01:58create or replace trigger trigger name
  1263. 1:02:01after inset or update or delete on table
  1264. 1:02:05name begin null and
  1265. 1:02:08cursor cursor name is followed by a
  1266. 1:02:10select statement open cursor fetch
  1267. 1:02:13cursor into variable variable should be
  1268. 1:02:15declared and closed cursor
  1269. 1:02:17refers or type type name is ref cursor
  1270. 1:02:20or sister of cursor
  1271. 1:02:24possible to create trigger for a view
  1272. 1:02:26case by using instead of timing point
  1273. 1:02:29difference between wear and nested table
  1274. 1:02:31yes both can be created and stored in
  1275. 1:02:34database
  1276. 1:02:35both are nothing but to handle
  1277. 1:02:38bunch of Records in a single stitch
  1278. 1:02:41and V array is a limited one
  1279. 1:02:43and nested table is an unlimited one we
  1280. 1:02:46can have n number of data in V8 nested
  1281. 1:02:49table
  1282. 1:02:50generally we use a nested table for our
  1283. 1:02:52projects
  1284. 1:02:55SQL is nothing but structure query
  1285. 1:02:58language
  1286. 1:02:59the extension to SQL is something but
  1287. 1:03:01procedural language structure language
  1288. 1:03:03that is nothing but PL SQL
  1289. 1:03:05you can have
  1290. 1:03:07you know uh single statements to be
  1291. 1:03:10executed kind of uh condition is an SQL
  1292. 1:03:13it is an english-like language can be
  1293. 1:03:16written in multiple lines case
  1294. 1:03:18insensitive language whereas PL SQL
  1295. 1:03:23is also case in sensitive language
  1296. 1:03:25multiple SQL statements can be executed
  1297. 1:03:28in single block
  1298. 1:03:29by using PL SQL
  1299. 1:03:32what is the coding standard coding
  1300. 1:03:34standard is something but for every
  1301. 1:03:36company people will be following some
  1302. 1:03:38coding structure you have to follow this
  1303. 1:03:41unit cap structure for every statement
  1304. 1:03:43you have to follow for cursor name like
  1305. 1:03:46this and the table name like this and
  1306. 1:03:49procedure name like this
  1307. 1:03:51and we can say it as a naming convention
  1308. 1:03:55so name of the object names and column
  1309. 1:03:58names should be in a proper way
  1310. 1:04:00it should be understandable readability
  1311. 1:04:02is mandatory for every program
  1312. 1:04:04when you're writing a query so you have
  1313. 1:04:07to split the query into select column
  1314. 1:04:08names next line from table name next
  1315. 1:04:11Lane where condition so that the
  1316. 1:04:13readability of the program will be good
  1317. 1:04:15so that nothing but
  1318. 1:04:17coding standard and naming convention
  1319. 1:04:20TTS stands for detailed technical
  1320. 1:04:23specification
  1321. 1:04:25dpfs stands for detailed functional
  1322. 1:04:27specification
  1323. 1:04:29and BRD stands for business requirement
  1324. 1:04:32document
  1325. 1:04:33and test cases nothing but once you've
  1326. 1:04:36created a procedure or function or
  1327. 1:04:37package or trigger you just go into unit
  1328. 1:04:41test
  1329. 1:04:42okay whether the written procedure
  1330. 1:04:45written object is you know working
  1331. 1:04:47perfectly or not that thing is nothing
  1332. 1:04:49but test case we can say those will be
  1333. 1:04:52recorded those will be you know uh
  1334. 1:04:55captured in a test case document so
  1335. 1:04:57meaning if any Java developer or any
  1336. 1:05:00front-end team is facing any issues with
  1337. 1:05:03the respective database object which you
  1338. 1:05:05did unit test case you'll be sharing the
  1339. 1:05:08document to them so that they will be
  1340. 1:05:11fixing their X Box uh from there and
  1341. 1:05:18difference between Authority definer and
  1342. 1:05:21Authority current user
  1343. 1:05:23obtained a question
  1344. 1:05:26is
  1345. 1:05:36for example I am having a
  1346. 1:05:39schema
  1347. 1:05:40S1 or SK Market
  1348. 1:05:46foreign
  1349. 1:06:15executed
  1350. 1:06:25on SP to RK is
  1351. 1:06:40we'll be using exec is
  1352. 1:06:58foreign
  1353. 1:07:40foreign
  1354. 1:08:06statements which cannot be executed
  1355. 1:08:09directly
  1356. 1:08:10kind of detail statement DCL statement
  1357. 1:08:12or
  1358. 1:08:13the statement which are framing by
  1359. 1:08:16developer
  1360. 1:08:18and those statements can be executed
  1361. 1:08:21only through Dynamic SQ execute
  1362. 1:08:23immediately is a keyword which help you
  1363. 1:08:26to execute the framed SQL statement not
  1364. 1:08:29only select
  1365. 1:08:30all kind of framed executable statements
  1366. 1:08:34can be executed by using
  1367. 1:08:37Dynamic SQL execute immediate is the
  1368. 1:08:40keyword
  1369. 1:08:41how to
  1370. 1:08:44fix PL SQL performance issues so for
  1371. 1:08:47that you have to learn about DPMS
  1372. 1:08:50profiler
  1373. 1:08:52you have to start the profiler and we
  1374. 1:08:54have to execute the pl SQL program which
  1375. 1:08:56having performance issues and then we
  1376. 1:08:59need to stop the profiler by using dbms
  1377. 1:09:03underscore profiler.stop profiler
  1378. 1:09:06okay and then we have to
  1379. 1:09:09check the pl skill profiler data unit
  1380. 1:09:13run stable what are the entries are
  1381. 1:09:16available in the respective table then
  1382. 1:09:18we have to identify the issues and then
  1383. 1:09:20we have to fix the issues with the
  1384. 1:09:22fixing Concepts
  1385. 1:09:24foreign
  1386. 1:09:59helpful to proceed controlling into them
  1387. 1:10:02can I return multiple values inside a
  1388. 1:10:04function can you return multiple values
  1389. 1:10:08in a function yes using collections
  1390. 1:10:12we're going to create or replace
  1391. 1:10:14function function name
  1392. 1:10:16return collection type to incredible and
  1393. 1:10:20the name
  1394. 1:10:22as
  1395. 1:10:27foreign yes we can return multiple
  1396. 1:10:31values
  1397. 1:10:32is it possible to
  1398. 1:10:34use multiple returns
  1399. 1:10:41multiple written statements
  1400. 1:10:44yes still we can able to see able to
  1401. 1:10:47write mention multiple return for
  1402. 1:10:49example begin intercola return one
  1403. 1:10:51return to return three written four
  1404. 1:10:54upper endless
  1405. 1:11:06first return statement rate will come
  1406. 1:11:08out still you can have multiple returns
  1407. 1:11:10keyword but it will come out from the
  1408. 1:11:12first return statement itself for
  1409. 1:11:14winning this alone
  1410. 1:11:17what is bulk collect and bulk binder so
  1411. 1:11:20I have already told you like on the
  1412. 1:11:21program
  1413. 1:11:23um
  1414. 1:11:27so that's important thing about uh well
  1415. 1:11:31collect and bulk Point program
  1416. 1:11:36you have to use
  1417. 1:11:38who are bulk collector and bulk mind
  1418. 1:11:41context switching reduce of by news
  1419. 1:11:44operations
  1420. 1:12:06okay
  1421. 1:12:10related question sir
  1422. 1:12:12parameters
  1423. 1:12:20so my program is depending on runtime
  1424. 1:12:23input means I can go for parameterized
  1425. 1:12:25cursor so I do not have a value directly
  1426. 1:12:31to pass in the sense I can go for
  1427. 1:12:32parameters to cursor so
  1428. 1:12:35Dynamic cursor is nothing but
  1429. 1:12:38we can have a
  1430. 1:12:41you know the pl SQL program
  1431. 1:12:44to be executed through
  1432. 1:12:47executive million
  1433. 1:12:49okay the program should have a cursor we
  1434. 1:12:52can execute those kind of a PL SQL
  1435. 1:12:55program inside your executive immediate
  1436. 1:12:57keyword such a thing is something but
  1437. 1:12:59Dynamic cursor
  1438. 1:13:01so you know DPA over any questions
  1439. 1:13:05possible to use cursor inside a query
  1440. 1:13:07yes I have already mentioned this
  1441. 1:13:11foreign foreign
  1442. 1:13:48foreign

About this transcript

This page contains the full transcript of ORACLE - SQL AND PLSQL - 100 QUESTIONS WITH ANSWERS by Karthick Ravichandran, generated from the public captions YouTube serves with the video. The transcript has 7,746 words across 1,442 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.