0% found this document useful (0 votes)
374 views1 page

Ass1 - Opt1 - OrderMgnt

The document provides instructions for an assignment involving writing SQL queries and views to test and analyze sample databases. It describes 5 questions - the first asks to create tables, add records, and write a view for one database, and the second asks to do the same for another database along with additional queries involving joins, subqueries, departments, and skills. Results including test data and query outputs should be packaged and submitted via email.

Uploaded by

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

Ass1 - Opt1 - OrderMgnt

The document provides instructions for an assignment involving writing SQL queries and views to test and analyze sample databases. It describes 5 questions - the first asks to create tables, add records, and write a view for one database, and the second asks to do the same for another database along with additional queries involving joins, subqueries, departments, and skills. Results including test data and query outputs should be packaged and submitted via email.

Uploaded by

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

For the following requests, print out respectively the screenshots to show test data (the table

data that you create to test each query), the query results, and pack them into the zip file
Assignment3_AccountName.zip along with your answers, then handle to the evaluator via email
([email protected])

Barem: Q1: 30%, Q2.1-20%, Q2.2-20%, Q2.3-15%, Q2.4-15%

Question 1
Given the following database (the solid-underline fields indicate primary keys, dotted-underline
fields indicate foreign keys)

 San_Pham (Ma_SP, Ten_SP, Don_Gia, Ma_KH)


 Khach_Hang (Ma_KH, Ten_KH, Phone_No, Ghi_Chu)
 Don_Hang (Ma_DH, Ngay_DH, Ma_SP, So_Luong)

Write SQL statements for following activities & print out respectively the screenshots to show
test data (the table data that you create to test each query) & query results:

1. Create the tables (with the most appropriate field/column constraints & types) and add at
least 3 records into each created table.
2. Create an order slip VIEW which has the same number of lines as the Don_Hang, with
the following information: Ten_KH, Ngay_DH, Ten_SP, So_Luong, Thanh_Tien

Question 2
Given the following database (the solid-underline fields indicate primary keys, dotted-underline
fields indicate foreign keys)

 Employee_Table (Employee_Number, Employee_Name, Department_Number)


 Employee_Skill_Table (Employee_Number, Skill_Code, Date Registered)
 Department (Department_Number, Department_Name)

Let write SQL statements for following activities & print out respectively the screenshots to show
test data (the table data that you create to test each query) & query results:

1. Create the tables (with the most appropriate field/column constraints & types) and add at
least 3 records into each created table.
2. Specify the names of the employees whore have skill of ‘Java’ – give >=2 solutions:
a. Use JOIN selection,
b. Use sub query.
3. Specify the departments which have >=3 employees, print out the list of departments’
employees right after each department.
4. Use SUB-QUERY technique to list out the different employees (include employee
number and employee names) who have multiple skills.
5. Create a view to show different employees (with following information: employee number
and employee name, department name) who have multiple skills.

You might also like