Sql Questions

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Sql Questions as PDF for free.

More details

  • Words: 210
  • Pages: 1
Structured Query Language Name:

André Botha 22320165

The HR department of company ABC manages their staff by means of various data tables. The following table is an excerpt for a table named Employees. The column headings in the table correspond to the field names in the data table. Surname Botha Visagie Mbati Sepeng Ras 1

Initials SG P DF KJ LG

Gender Male Male Female Male Female

Write two different SQL statements to list the surnames, initials and the gender of all the employees in the data table. SELECT * FROM Employees; SELECT [Surname],[Initials],[Gender] FROM Employees;

2

Write a SQL statement to list the surnames and initials of all the employees in the data table. SELECT [Surname],[Initials] FROM Employees;

3

Write two different SQL statements to list the surnames, initials and gender for all the male employees. SELECT [Surname],[Initials],[Gender] FROM Employees WHERE [Gender] =’Male’; SELECT * FROM Employees WHERE [Gender] =’Male’;

4

Write two different SQL statements to list the surnames, initials and gender for all the female employees. SELECT [Surname],[Initials],[Gender] FROM Employees WHERE [Gender] =’Female’; SELECT * FROM Employees WHERE [Gender] =’Female’;

5

Write a SQL statement to list the surname, initials and the gender for employee Mbati in the data table. SELECT * FROM Employees WHERE [Surname] =’Mbati’;

Related Documents

Sql Questions
November 2019 5
Sql Questions
October 2019 8
Sql Questions
October 2019 8
Sql Questions
November 2019 9
Sql Questions
October 2019 8
Sql Questions
November 2019 7