0% found this document useful (0 votes)
4 views5 pages

Implementation of Commands in MySQL

Uploaded by

Bulletproof
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Implementation of Commands in MySQL

Uploaded by

Bulletproof
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

COMSATS UNIVERSITY ISLAMABAD, WAH CAMPUS

DATABASE SYSTESM
LAB TASK NO.02
Registration No.: FA23-BCS-043-3A

Name: Eman Zahra

Topic: Implementation of Different Commands in MySQL.

Activity No.01: Selecting all columns.

Syntax: SELECT * from departments; (name of the table created in departments)

Output:
Activity No.02: Select specific columns.

Syntax: select department_id, location_id from departments;

Output:

Activity No. 03: Using Arithmetic Operators.

Syntax: select last_name, salary, salary + 300 from employees;

Output:

Activity No. 04: NULL values in Arithmetic Expression.


Syntax: select last_name, 12*salary*commission_pct from employees;

Output:

Activity No. 05: Using Column Aliases.

Syntax: select last_name AS name, commission_pct comm from employees;

Output:

Activity No.06: Using Concatenation Operator.

Syntax: select CONCAT (last_name,job_id) AS “Employees” from employees;


Output:

Activity No.07: Using Literal Character Strings.

Syntax: select CONCAT(last_name, ‘is ’,job_id) AS ‘Employee Details’ from employees;

Output:

Activity No.08: Using DISTINCT Keyboard to get rid of Duplicates.

Syntax: select DISTINCT department_id, job_id from employees;

Output:
Activity No. 9: Using the DESCRIBE Keyword.

Syntax: DESCRIBE employees;

Output:

You might also like