Introduction to Database: SQL Assignment, Cheat Sheet of Computer science

A continuous assessment tool for the course 'introduction to database' at california state university - northridge. The assignment requires students to write sql queries to perform various tasks on a relational database schema consisting of four tables: employee, branch, project, and task. The assignment covers 15 questions that test the students' understanding of sql concepts such as select, where, order by, distinct, between, in, substring, and aggregate functions like avg and count. The assignment is worth 15 marks and is due on may 8, 2024. The relational schema, the list of questions, and the submission guidelines. This assignment could be useful for university students enrolled in an introductory database course as it allows them to practice and demonstrate their sql skills.

Typology: Cheat Sheet

2023/2024

Uploaded on 05/21/2024

mohammed-al-dhahouri
mohammed-al-dhahouri 🇴🇲

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
In Academic Affiliation with California State University Northridge
Department of Information Technology
Continuous Assessment Tool
Second Semester 2023-’24
Course Code : COMP241
Course Name : Introduction to Database
Course Instructor : Dr. Sohail Iqbal
Due Day : Wednesday
Due Date : 08 /May/2024
Assessment tool : Assignment 1
Student Name : Mohammed Khamis Khamis ALdhouri
I.D. Number : 202000504
Section : ………………1……………..……………………
Question No.
Marks Obtained
Maximum
Marks
Comments if any
O1
O2
O3
O6
15
/15
/15
Outcomes Total
/15
Total Marks(in figures)
Total Marks(in words)
Evaluator’s Signature
Internal Moderator’s
Signature
External Moderator’s
Signature
Remark: Candidates are advised to read all instructions before answering.
pf3
pf4
pf5

Partial preview of the text

Download Introduction to Database: SQL Assignment and more Cheat Sheet Computer science in PDF only on Docsity!

In Academic Affiliation with California State University – Northridge

Department of Information Technology

Continuous Assessment Tool

Second Semester 2023-’

Course Code : COMP

Course Name : Introduction to Database

Course Instructor : Dr. Sohail Iqbal

Due Day : Wednesday

Due Date : 08 /May/

Assessment tool : Assignment 1

Student Name : Mohammed Khamis Khamis ALdhouri

I.D. Number : 202000504

Section : ……………… 1 ……………..……………………

Question No.

Marks Obtained (^) Maximum

Marks

Comments if any O1 O2 O3 O4 O5 O

Outcomes Total / 15

Total Marks(in figures) Total Marks(in words)

Evaluator’s Signature

Internal Moderator’s

Signature

External Moderator’s

Signature

Remark: Candidates are advised to read all instructions before answering.

Objectives : The following student learning outcomes of the course are in this continuous assessment

tool:

O6. Develop database system using basic command and function of SQL

The assignment covers the following graduate attributes:

  • Critical Thinking
  • Problem Solving

Description of the Tool :

In this assignment, you are required to write the SQL code for the given questions.

Task:

The following is the relational schema of part of the database that Saas Pty Ltd recently implemented:

[O6] [15 Marks]

Employee (EmployeeId, Name, Country, Phone, Email, Fax, Salary, BranchNo)

Branch (BranchNo, BranchName, Phone, Fax, Location, Address)

Project (ProjectId, Title, Duration, Location, Extension, Cost)

Task (EmployeeId, ProjectId, StartDate, CompletionDate)

Using the above schema, write SQL queries that will answer/process the following:

  1. List name, country and phone of all employees. [1 Mark]

SELECT name, country, phone

From Employee;

  1. List EmployeeId and fax of all the employees along with the titles of the projects. [1 Mark]

SELECT E.EmployeeId, E.fax, P.title

From employee as E, project as P, task as T

Where E.EmployeeId=T.EmplyeeId and

T.projectId=P.projectId;

  1. List project id, duration and location of all projects ordered by location in descending order. [1 Mark]

SELECT projectId, Duration, Location

  1. List all details of projects that are located in Sur, Salalah and Nizwa. [1 Mark]

SELECT *

FROM PROJECT

WHERE LOCATION IN (‘Salalah’, ‘SUR’, ‘NIZWA’);

  1. List EmployeeId, name and their branch names. [1 Mark]

SELECT E.employeeId, E.name, B.Branchname

FROM Employee as E, Branch as B

Where B.BranchNo=E.BranchNo;

  1. List all details about all branches ordered by location and, where the location is the same, by address

in descending order. [1 Mark]

SELECT *

FROM Branch

ORDER BY Location, Address DESC;

  1. Show the average salaries of employees. [1 Mark]

SELECT AVG (Salary)

FROM Employee;

  1. Show the total number of projects. [1 Mark]

SELECT COUNT(*)

FORM Project;

Submission Date (s): Wednesday (08/May/2024)

Assessment Weighting: 15 Marks

WHAT TO SUBMIT

You are required to submit a soft copy (pdf file) of your assignment which contains SQL code for the

given task through Moodle.

Assessment Criteria:

No_._ Assessment Criteria Marks

3 Task: SQL

  • SQL code

Total Mark / 15

End of document