CT-067
Khansa Khan Ghauri
DBMS LAB 01
1. Display the last name concatenated with the job ID, separated by a comma and space, and name
the column Employee and Title.
2. Create a query to display all the data from the EMPLOYEES table. Separate each column by a
comma. Name the column THE_OUTPUT.
3. Show the structure of the DEPARTMENTS table. Select all data from the table.
Database Management System
CT-067
Khansa Khan Ghauri
4. Show the structure of the EMPLOYEES table. Create a query to display the last name, job code,
hire date, and employee number for each employee, with employee number appearing first.
Database Management System
CT-067
Khansa Khan Ghauri
5. Create a query to display unique job codes from the EMPLOYEES table.
Database Management System
CT-067
Khansa Khan Ghauri
6. There are four coding errors in this statement. Can you identify them?
SELECT employee_id, last_name sal x 12 ANNUAL SALARY FROM employees;
Missing AS keyword
Column name should be ‘salary’ not ‘sal’
Multiplication syntax should be written as ‘salary * 12’
Comma is missing between last_name and sal x 12
Database Management System
CT-067
Khansa Khan Ghauri
7. Make account on leetcode, head to https://leetcode.com/studyplan/top-sql-50/ and solve 5
questions in the select tag. The questions involve usage of “Where” clause.
1757: Recyclable And Low Fat Products
584: Find Customer Referee
595: Big countries
1148: Article Views I
Database Management System
CT-067
Khansa Khan Ghauri
1683: Invalid Tweets
Database Management System