Description
This week’s lab gets you started, connected, and uses your first commands while learning the interface for SQL Developer and a few string formatting techniques.
Getting Started
Your submission will be a single text-based SQL file with the solutions provided.
Create a new Worksheet in SQL Developer. Save the file as L01_ID_LASTNAME.sql
Your submission needs to be commented and include the question, the solutions, and the results. Please note the results should be commented lines (so the file still runs as submitted) Tasks
Hopefully, you downloaded demobld11 file and ran the script that will build the tables as outlined in the Week 0 document.
1. Start by entering in the SQL Developer worksheet:
a. SELECT * FROM EMPLOYEES;
b. SELECT * FROM DEPARTMENTS;
c. SELECT * FROM JOB_HISTORY;
d. Which one of these tables appeared to be the widest? or longest? (Answer in commented text)
2. If the following SELECT statement does NOT execute successfully, how would you fix it?
(Answer in commented text)
SELECT last_name “LName”, job_id “Job Title”,
3. There are THREE coding errors in this statement. Can you identify them?
(Answer in commented text) Then, correct them and provide a working statement.
SELECT employee_id, last name, commission_pct Emp Comm, FROM employees;
4. What command would show the structure of the LOCATIONS table?
(Answer in commented text)
5. Create a query to display the output shown below.
BONUS: if you can only show the country code if there is no province
Example Submission
— ***********************
— Name: Your Name
— ID: #########
— Purpose: Lab 1 DBS301
— ***********************
— Question 1 – write a brief note about what the question is asking
— Q1 Solution —
SELECT * FROM TABLE;
— Q2 Solution —
Reviews
There are no reviews yet.