ORACLE11 25
Database System - Lab - 3 Guest on 9th March 2021 11:32:10 AM
  1. oracle
  2. sample scheme
  3.  
  4. DEFAULT username: SYSTEM
  5. pass: 123
  6.  
  7. conn sys/123@localhost:1521/XEPDB1 AS sysdba;
  8.  
  9. Assignment:
  10. HR.EMPLOYEES - Fix the TABLE INTO the ascending ORDER
  11.  
  12.  
  13. SELECT DEPARTMENT_NAME AS DEPARTMENTNAME FROM hr.departments;
  14. Changes the name OF TABLE during the runtime
  15.  
  16.  
  17. SELECT * FROM jobs WHERE job_title LIKE 'S%e';
  18. Begins WITH S AND ends WITH e
  19.  
  20. SELECT * FROM jobs WHERE job_title NOT LIKE 's%';
  21. WHERE there IS no "s".
  22.  
  23.  SELECT * FROM hr.jobs WHERE job_title LIKE '_r%';
  24. WHERE job title has r IN the SECOND position
  25.  
  26. SELECT * FROM hr.jobs WHERE job_title LIKE '%es%';
  27. IN ANY position
  28.  
  29.  
  30. SELECT * FROM hr.regions WHERE REGION_ID='1' OR Region_Name='Europe';
  31.  
  32. SELECT * FROM hr.regions WHERE REGION_ID='2' OR Region_ID='4';
  33. SELECT * FROM hr.regions WHERE NOT REGION_ID='1'; - this will show ALL except FOR 1
  34. SELECT * FROM departments WHERE NOT LOCATION_ID='17000';
  35.  
  36. SELECT CONCAT(CONCAT(job_title, ' '), max_salary) AS job_information FROM hr.jobs; - this IS used FOR the concatenation WITH SPACE
  37.  CONCAT(CONCAT(job_title, ' '), max_salary)
  38.  
  39.  
  40. SELECT COUNT(*) FROM hr.jobs; - take the totalnumber OF tables IN hr.jobs
  41.  
  42. assignment wildcards - research about it

Coding Base is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.