SQL Practice | Day 4

SCHEMA:

REGIONS(REGION_ID, REGION_NAME)
COUNTRIES(COUNTRY_ID, COUNTRY_NAME, REGION_ID)
LOCATIONS(LOCATION_ID, STREET_ADDRESS, POSTAL_CODE, CITY,STATE_PROVINCE, COUNTRY_ID)
DEPARTMENTS(DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID,LOCATION_ID)
EMPLOYEES(EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID)
JOB_HISTORY(EMPLOYEE_ID, START_DATE, END_DATE, JOB_ID, DEPARTMENT_ID)
JOBS(JOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY)

Question A: For each employee print last name, salary, and job title. Continue reading “SQL Practice | Day 4”

Advertisements

SQL Practice | Day 3

Member(mid, mname, email, address)
Books(bid, bname, yearOfPublication, publisher)
Borrows(mid, bid, date)
Author(aid, aname)
Writes(bid, aid)

Question1: Find the name of the books either published before 1980 or are “Computer” related. (i.e. have “Computer” in their names).

Continue reading “SQL Practice | Day 3”